CN113542764A - Video quick starting method and device, electronic equipment and computer readable medium - Google Patents

Video quick starting method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113542764A
CN113542764A CN202110782859.2A CN202110782859A CN113542764A CN 113542764 A CN113542764 A CN 113542764A CN 202110782859 A CN202110782859 A CN 202110782859A CN 113542764 A CN113542764 A CN 113542764A
Authority
CN
China
Prior art keywords
box
data
video
moov
offset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110782859.2A
Other languages
Chinese (zh)
Inventor
徐洋
陈金
张平
黄润怀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202110782859.2A priority Critical patent/CN113542764A/en
Publication of CN113542764A publication Critical patent/CN113542764A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the disclosure provides a method and a device for rapidly starting a video, an electronic device and a readable medium, wherein the method comprises the following steps: when a user receives a playing request of a target video, downloading a video stream of the target video and reading data of the first 8 bytes of the video stream to obtain head data of a first box; when the first box is determined not to be a preset structure according to the head data of the first box, reading the head data of a second box of the video according to the offset of the first box; determining the position of the moov box according to the head data of the second box; and reading the moov box based on the position of the moov box and analyzing the moov box so as to play the target video according to an analysis result. The video quick starting method, the video quick starting device, the electronic equipment and the readable medium can realize quick starting of the target video.

Description

Video quick starting method and device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of video playing technologies, and in particular, to a method and an apparatus for quickly starting playing of a video, an electronic device, and a computer readable medium.
Background
H.265 is also known as HEVC (High Efficiency Video Coding), which is a successor to the ITU-T H.264/MPEG-4AVC standard. Compared with h.264, h.265 has a higher compression rate, which means the same bit rate (also called bit rate is bit (bit) Per second, the higher the bit rate, the more data is transmitted Per second, and the clearer the image quality, the clearer the image quality of h.265, and the higher the compression rate, the lower the storage and transmission cost can be used.
Usually, the operating system performs video decoding by hardware (video card), and the advantages of the hardware decoding are low power consumption and high decoding speed. But some encoding formats are currently available such as: the hardware decoding support case of h.265 coding in browsers is not popular. Tested only supported in certain browsers customized (e.g., chrome and Edge 14).
In addition to hard decoding schemes, software decoding is also an efficient choice, since video decoding is a CPU-intensive task with high performance requirements, and the performance of decoders implemented in Web-page (Web) -end scripting languages is difficult to achieve.
And the current Web end soft decoding mp4 player can only support the situation that a moov box (moov box) is played quickly in front, while one situation of mp4 files with the moov box in the back is that the files cannot be played at all, and the other situation is that mp4 files are completely downloaded and then played, so that the requirement of quick playing cannot be realized under the situation that the files are not completely downloaded.
Therefore, a new method, apparatus, electronic device and computer readable medium for fast video playback are needed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the disclosure.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a method and an apparatus for quickly starting a video, an electronic device, and a computer-readable medium, which can quickly start a target video.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the embodiments of the present disclosure, a method for fast starting a video is provided, where the method includes: when a user receives a playing request of a target video, downloading a video stream of the target video and reading data of the first 8 bytes of the video stream to obtain head data of a first box; when the first box is determined not to be a preset structure according to the head data of the first box, reading the head data of a second box of the video according to the offset of the first box; determining the position of the moov box according to the head data of the second box; and reading the moov box based on the position of the moov box and analyzing the moov box so as to play the target video according to an analysis result.
In an exemplary embodiment of the present disclosure, determining that the first box is not the preset structure according to the header data of the first box includes: analyzing the head data of the first box to obtain a first box type of the first box; and if the first box type is not the preset structure type, determining that the first box is not the preset structure.
In an exemplary embodiment of the present disclosure, reading the header data of the second box of the video according to the offset of the first box includes: determining a first starting position when the header data of the first box is downloaded; superimposing the first start position with the offset of the first box to obtain a second start position of the header data of the second box; and downloading 8 bytes of data at a second starting position of the video stream to obtain the head data of the second box.
In an exemplary embodiment of the present disclosure, determining the position of the moov box from the head data of the second box includes: analyzing the head data of the second box to obtain a second box type and a second box offset of a second file; and if the second box type is a preset structure type, determining the position of the moov box according to the second initial position and the second box offset.
In an exemplary embodiment of the present disclosure, determining the position of the moov box according to the head data of the second box further includes: if the second box type is not the preset structure type, continuously reading the head data of a third box to a Kth box according to the offset of the second box until the Kth box is determined to be a moov box according to the head data of the Kth box, wherein K is an integer larger than 0; analyzing the head data of the Kth box to obtain the offset of the Kth box; and determining the position of the moov box according to the Kth starting position of the head data of the Kth box during reading and the offset of the Kth box.
In an exemplary embodiment of the present disclosure, reading the moov box based on the position of the moov box and parsing to play the target video according to a parsing result includes: analyzing the moov box to obtain meta data; decoding and rendering the video stream file according to the meta data to obtain audio original data and video original data of a target video; and playing the audio original data and the video original data of the target video.
According to a second aspect of the embodiments of the present disclosure, a video quick-start device is provided, which includes: the request receiving module is configured to download the head data of a first box of a video stream of a target video when a playing request of the target video is received; a first header data reading module configured to read header data of a second box of the video according to an offset of the first box when it is determined that the first box is not a preset structure according to the header data of the first box; a target box positioning module configured to determine a position of the moov box according to the head data of the second box; and the video playing module is configured to read the moov box based on the position of the moov box and analyze the moov box so as to play the target video according to an analysis result.
In an exemplary embodiment of the present disclosure, the first head data reading module includes: a header data parsing unit configured to parse header data of the first box to obtain a first box type and a first box offset of the first box; and the type judging unit is configured to determine that the first box is not a preset structure if the first box type is not a preset structure type.
According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, which includes: one or more processors; storage means for storing one or more programs; when executed by the one or more processors, cause the one or more processors to implement the video fast-start method of any of the above.
According to a fourth aspect of the embodiments of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, which when executed by a processor, implements the video fast-start method according to any one of the above.
According to the video quick playing starting method, the video quick playing starting device, the electronic equipment and the computer readable medium, when a user receives a playing request of a target video, only the data of the first 8 bytes of a video stream is downloaded first, and the head data of a first box is obtained; the method comprises the steps that the type of a first box can be determined according to the head data of the first box, and when the first box is determined to be not the structure type of a preset structure according to the head data of the first box, the head data of a second box of the video can be read according to the offset of the first box; the position of the moov box can be further determined according to the head data of the second box; and reading and analyzing the moov box based on the position of the moov box so as to realize quick start of the target video according to an analysis result.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. The drawings described below are merely some embodiments of the present disclosure, and other drawings may be derived from those drawings by those of ordinary skill in the art without inventive effort.
Fig. 1 is a system block diagram illustrating a video fast-start method and apparatus according to an exemplary embodiment.
Fig. 2(a), (b) schematically show the structure of mp4 file.
A schematic diagram of the box structure is schematically shown in fig. 3.
Fig. 4 is a flow chart illustrating a method for fast video launch in accordance with an exemplary embodiment.
Fig. 5 schematically shows a schematic diagram of the playback principle of the mp4 file.
Fig. 6 is a flow chart illustrating a method for fast video launch in accordance with another exemplary embodiment.
Fig. 7 is a block diagram illustrating a video quick-launch apparatus according to an example embodiment.
Fig. 8 schematically illustrates a block diagram of an electronic device in an exemplary embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The drawings are merely schematic illustrations of the present invention, in which the same reference numerals denote the same or similar parts, and thus, a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and steps, nor do they necessarily have to be performed in the order described. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The following detailed description of exemplary embodiments of the invention refers to the accompanying drawings.
Fig. 1 is a system block diagram illustrating a video fast-start method and apparatus according to an exemplary embodiment.
In the system 100 of the video quick start-up method and apparatus, the server 105 may be a server providing various services, such as a background management server (for example only) providing support for a video quick start-up system operated by users with the terminal devices 101, 102, 103 through the network 104. The background management server can analyze and process the received data such as the video quick playing starting request and feed back the video stream to the terminal equipment. The terminal device 101 (or 102, 103) may request, through the network 104, the server 105 to download the video stream of the target video when receiving a play request for the target video, the server 105 transmits the video stream of the target video to the terminal device 101 after receiving the download request, and then the terminal device 101 downloads the video stream of the target video from the server 105 and reads the data of the first 8 bytes of the video stream, so as to obtain the header data of the first box; when the first box is determined not to be a preset structure according to the head data of the first box, reading the head data of a second box of the video according to the offset of the first box; determining the position of the moov box according to the head data of the second box; and reading the moov box based on the position of the moov box and analyzing the moov box so as to play the target video according to an analysis result.
Fig. 2(a), (b) schematically show the structure of mp4 file. As shown in fig. 2(a), (b), the mp4 file is composed of boxes (box), mainly ftyp, moov, mdat, etc. Wherein the moov box in fig. 2(a) is located at the end of the mp4 file. A schematic diagram of a box structure is schematically shown in fig. 3, and as shown in fig. 3, a box (i.e., the box structure in fig. 3) includes header data (box header) and box data (box body). The header data is fixed 8 bytes, wherein the first 4 bytes of the box header are named box size and are used for describing the size of the box (hereinafter referred to as offset); the 4 following bytes of the box header are named box type, and are used for describing the type of the box (the type is ftyp, moov, mdat, etc.).
In FIG. 2(a) (b), the free box is optional and, if present, typically occurs between moov and mdat, i.e., moov-free-mdat. The data in free is usually all 0, the function of the data is equivalent to a placeholder, and the data is distributed to moov for use when the moov data is increased during real-time video shooting. Since the size of video data cannot be known in advance when the device records video, moov data increases as the data of mdat is shot increases if moov precedes mdat, and if there is no free reserved space, mdat data is continuously moved backwards to make the moov space free.
Fig. 4 is a flow chart illustrating a method for fast video launch in accordance with an exemplary embodiment. The video quick start-up method provided by the embodiment of the present disclosure may be executed by any electronic device with computing processing capability, for example, the terminal devices 101, 102 and/or 103, in the following embodiments, the method executed by the terminal device 101 is taken as an example for illustration, but the present disclosure is not limited thereto. The video quick starting method provided by the embodiment of the disclosure can comprise steps S402 to S408.
As shown in fig. 4, in step S402, when a user arrives at a play request for a target video, a video stream of the target video is downloaded and the data of the first 8 bytes of the video stream is read, and the header data of the first box is obtained.
In the embodiment of the present disclosure, the play request may be generated, for example, by a user operating the terminal device 101, for example, the terminal device 101 has a display screen panel, and displays a web browsing interface on the display screen panel, where the web browsing interface includes a play button of the target video, and when the user clicks the play button in the display screen panel, the terminal device 101 receives the play request of the target video. The terminal device 101 may request the server 105 to download a video stream of the target video. The video stream of the target video may be in an encoded mp4 file format of h.265, h.266, AVS2, AVS3, etc.
In step S404, when it is determined that the first box is not the preset structure based on the header data of the first box, the header data of the second box of the video is read based on the offset of the first box.
In the embodiment of the disclosure, the header data of the first box can be analyzed to obtain the first box type of the first box; and if the first box type is not the preset structure type, determining that the first box is not the preset structure. Wherein, the preset structure type can be moov box type. When the header data of the first box is analyzed, the data of the last 4 bytes of the header data of the first box can be read, and the type of the first box is determined according to the data of the last 4 bytes. The first box type may be, for example, ftyp, moov, mdat, etc., as previously referred to.
When the head data of a second box of the video is read according to the offset of the first box, a first starting position when the head data of the first box is downloaded can be determined; superposing the first initial position on the offset of the first box to obtain a second initial position of the head data of a second box; and downloading 8 bytes of data at the second starting position of the video stream to obtain the head data of the second box. The first start position when the header data of the first box is downloaded is the start position of the header data of the first box in the video stream file.
In step S406, the position of the moov box is determined from the head data of the second box.
Wherein, the header data of the second box can be analyzed to obtain a second box type and a second box offset of the second file; and if the second box type is the preset structure type, determining the position of the moov box according to the second starting position and the second box offset. The data of the last 4 bytes in the header data of the second box can be analyzed, and the type of the second box is determined; the first 4 bytes of data in the header data of the second box are parsed to determine the second box offset. And reads the second box specific data based on the second box offset.
In step S408, the moov box is read and parsed based on the position of the moov box to play the target video according to the parsing result.
In the embodiment of the disclosure, the box data of the moov box can be downloaded and obtained based on the position of the moov box, meta data is obtained through analysis in the downloading process, and then the steps of decoding and rendering are carried out on a video stream file according to the meta data to obtain the audio original data and the video original data of a target video; and playing the audio original data and the video original data of the target video so as to realize the quick start of the target video. In the software decoding flow of the disclosed embodiment, the HTML5 technology, that is, the WebAssembly technology is used to compile the ffmpeg high performance decoder into the wasm library, and the wasm file exists in binary form and contains platform-independent virtual instructions (like assembly instructions). Fig. 5 schematically shows a schematic diagram of the playback principle of the mp4 file. As shown in fig. 5, the player software in the terminal device 101 requests the mp4 file of the download target video as a data source to the server 105 through the network, and performs data transmission through various pipelines, during which a series of operations such as reading, conversion, classification, and copying of the video stream, for example, mp4 stream, require the steps of decapsulating, decoding, rendering, and the like. The solution of the disclosed embodiments may be applied to the decapsulation process shown in fig. 5 based on software decoding.
According to the video quick playing starting method provided by the embodiment of the disclosure, when a user receives a playing request of a target video, only the data of the first 8 bytes of a video stream is downloaded first, and the head data of a first box is obtained; the method comprises the steps that the type of a first box can be determined according to the head data of the first box, and when the first box is determined to be not the structure type of a preset structure according to the head data of the first box, the head data of a second box of a video can be read according to the offset of the first box; the position of the moov box can be further determined according to the head data of the second box; and reading and analyzing the moov box based on the position of the moov box so as to realize quick start of the target video according to an analysis result.
In an exemplary embodiment, in step S406, if the second box type is not the preset structure type, the head data of the third to K-th boxes are continuously read according to the second box offset until the K-th box is determined to be a moov box according to the head data of the K-th box, where K is an integer greater than 0; analyzing the head data of the Kth box to obtain the offset of the Kth box; and determining the position of the moov box according to the K-th starting position of the head data of the K-th box during reading and the offset of the K-th box.
The K-th start position of the head data of the K-th box during reading is the start position of the head data (8 bytes) of the K-th box during reading.
Fig. 6 is a flow chart illustrating a method for fast video launch in accordance with another exemplary embodiment. The video quick start-up method provided by the embodiment of the disclosure may include steps S602 to S610.
As shown in fig. 6, in step S602, when a user receives a play request for a target video, a video stream of the target video is downloaded and data of the first 8 bytes of the video stream is read, and header data of a first box is obtained and used as current header data of a current box. The read start position of the current header data (i.e., the kth start position of the aforementioned kth box, K ═ 1, 2, …, K) is recorded at the same time.
In step S604, the first 4 bytes of data in the current header data are parsed to obtain the offset of the current box, and the last 4 bytes of data in the current header data are parsed to obtain the type of the current box.
In step S606, it is determined whether the current box is a moov box according to the type of the current box. If so, go to step S610, otherwise go to step S608.
In step S608, a next download start position is obtained by accumulating the read position of the current header data and the offset of the current box, and 8 bytes of data are downloaded from the next download start position as updated header data of the current box, and the process returns to step S604.
In step S610, the box data of the moov box is downloaded and parsed according to the read start position of the current header data and the offset of the current box, so as to play the target video according to the parsing result.
According to the video quick starting method provided by the embodiment of the disclosure, when the mp4 file is read, only 8 bytes of head data of the box need to be read each time, the 8 bytes of head data are analyzed, the position of the moov box is quickly positioned, and then the target video can be quickly started by analyzing the moov box. The method is compatible with a fast starting mode of the moov box at the tail of the file, the downloading and analyzing work of the whole data of the box is skipped, and a large amount of time can be saved.
It should be clearly understood that this disclosure describes how to make and use particular examples, but the principles of this disclosure are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a Central Processing Unit (CPU). When executed by a central processing unit CPU, performs the above-described functions defined by the above-described methods provided by the present disclosure. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
Fig. 7 is a block diagram illustrating a video quick-launch apparatus according to an example embodiment. Referring to fig. 7, a video quick start device 70 provided by an embodiment of the present disclosure may include: a request receiving module 702, a first head data reading module 704, a position determining module 706, and a video playing module 708.
In the video quick-start apparatus 70, the request receiving module 702 may be configured to download the header data of the first box of the video stream of the target video when receiving a play request for the target video.
The first header data reading module 704 may be configured to read the header data of the second box of the video according to the offset of the first box when it is determined that the first box is not the preset structure according to the header data of the first box.
The target cartridge positioning module 706 may be configured to determine the position of the moov cartridge based on the head data of the second cartridge.
The video playing module 708 may be configured to read the moov box based on the position of the moov box and parse the moov box to play the target video according to a parsing result.
According to the video quick playing starting device provided by the embodiment of the disclosure, when a user receives a playing request of a target video, only the data of the first 8 bytes of a video stream is downloaded first, and the head data of a first box is obtained; the method comprises the steps that the type of a first box can be determined according to the head data of the first box, and when the first box is determined to be not the structure type of a preset structure according to the head data of the first box, the head data of a second box of the video can be read according to the offset of the first box; the position of the moov box can be further determined according to the head data of the second box; and reading and analyzing the moov box based on the position of the moov box so as to realize quick start of the target video according to an analysis result.
In an exemplary embodiment, the first header data reading module 704, when determining that the first box is not the preset structure according to the header data of the first box, may include: a header data parsing unit configured to parse header data of the first box to obtain a first box type and a first box offset of the first box; a type determination unit, configured to determine that the first box is not a preset structure if the first box type is not a preset structure type.
In an exemplary embodiment, the first header data reading module 704, when reading the header data of the second box of the video according to the offset of the first box, may include: a first position determining unit configured to determine a first start position when the header data of the first box is downloaded; a second position locating unit configurable to superimpose the first start position on the offset of the first box to obtain a second start position of the head data of the second box; and the head data reading unit can be configured to download 8 bytes of data at a second starting position of the video stream to obtain the head data of the second box.
In an exemplary embodiment, the target cartridge positioning module 706 may include: a header data parsing unit configured to parse header data of the second box to obtain a second box type and a second box offset of a second file; the first target box positioning unit may be configured to determine the position of the moov box according to the second start position and the second box offset if the second box type is a preset structure type.
In an exemplary embodiment, the target cartridge positioning module 706 may further include: the offset analysis unit can be configured to continue reading the head data of the third box to the Kth box according to the offset of the second box if the second box type is not the preset structure type until the Kth box is determined to be a moov box according to the head data of the Kth box, wherein K is an integer larger than 0; a target offset determination unit configured to parse the header data of the kth box to obtain an offset of the kth box; and the second target box positioning unit can be configured to determine the position of the moov box according to the Kth starting position of the head data of the Kth box during reading and the offset of the Kth box.
In an exemplary embodiment, the video playback module 708 may include: the box analysis unit can be configured to analyze the moov box to obtain meta data; a decoding rendering unit configured to decode and render the video stream file according to the meta data to obtain audio raw data and video raw data of a target video; and the video playing unit can be configured to play the audio original data and the video original data of the target video.
An electronic device 800 according to this embodiment of the invention is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, and a bus 830 that couples the various system components including the memory unit 820 and the processing unit 810.
Wherein the storage unit stores program code that is executable by the processing unit 810 to cause the processing unit 810 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 810 may perform the steps as shown in fig. 4 or fig. 6.
The storage unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The storage unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 800, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860. As shown, the network adapter 860 communicates with the other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method for rapidly starting a video, comprising the following steps:
when a user receives a playing request of a target video, downloading a video stream of the target video and reading data of the first 8 bytes of the video stream to obtain head data of a first box;
when the first box is determined not to be a preset structure according to the head data of the first box, reading the head data of a second box of the video according to the offset of the first box;
determining the position of the moov box according to the head data of the second box;
and reading the moov box based on the position of the moov box and analyzing the moov box so as to play the target video according to an analysis result.
2. The method of claim 1, wherein determining that the first box is not a default configuration based on the header data of the first box comprises:
analyzing the head data of the first box to obtain a first box type of the first box;
and if the first box type is not the preset structure type, determining that the first box is not the preset structure.
3. The method of claim 1, wherein reading header data of a second box of the video based on the offset of the first box comprises:
determining a first starting position when the header data of the first box is downloaded;
superimposing the first start position with the offset of the first box to obtain a second start position of the header data of the second box;
and downloading 8 bytes of data at a second starting position of the video stream to obtain the head data of the second box.
4. The method of claim 1, wherein determining the location of the moov box based on the header data of the second box comprises:
analyzing the head data of the second box to obtain a second box type and a second box offset of a second file;
and if the second box type is a preset structure type, determining the position of the moov box according to the second initial position and the second box offset.
5. The method of claim 4, wherein determining the location of the moov box based on the header data of the second box further comprises:
if the second box type is not the preset structure type, continuously reading the head data of a third box to a Kth box according to the offset of the second box until the Kth box is determined to be a moov box according to the head data of the Kth box, wherein K is an integer larger than 0;
analyzing the head data of the Kth box to obtain the offset of the Kth box;
and determining the position of the moov box according to the Kth starting position of the head data of the Kth box during reading and the offset of the Kth box.
6. The method of claim 1, wherein reading the moov box based on its position and parsing to play the target video according to the parsing result comprises:
analyzing the moov box to obtain meta data;
decoding and rendering the video stream file according to the meta data to obtain audio original data and video original data of a target video;
and playing the audio original data and the video original data of the target video.
7. A video quick starting device based on a webpage is characterized by comprising:
the request receiving module is configured to download the head data of a first box of a video stream of a target video when a playing request of the target video is received;
a first header data reading module configured to read header data of a second box of the video according to an offset of the first box when it is determined that the first box is not a preset structure according to the header data of the first box;
a target box positioning module configured to determine a position of the moov box according to the head data of the second box;
and the video playing module is configured to read the moov box based on the position of the moov box and analyze the moov box so as to play the target video according to an analysis result.
8. The apparatus of claim 7, wherein the first head data reading module comprises:
a header data parsing unit configured to parse header data of the first box to obtain a first box type and a first box offset of the first box;
and the type judging unit is configured to determine that the first box is not a preset structure if the first box type is not a preset structure type.
9. An electronic device, comprising:
at least one processor;
storage means for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202110782859.2A 2021-07-12 2021-07-12 Video quick starting method and device, electronic equipment and computer readable medium Pending CN113542764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110782859.2A CN113542764A (en) 2021-07-12 2021-07-12 Video quick starting method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110782859.2A CN113542764A (en) 2021-07-12 2021-07-12 Video quick starting method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113542764A true CN113542764A (en) 2021-10-22

Family

ID=78098476

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110782859.2A Pending CN113542764A (en) 2021-07-12 2021-07-12 Video quick starting method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113542764A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114845159A (en) * 2022-04-22 2022-08-02 北京百度网讯科技有限公司 Download data generation method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130259441A1 (en) * 2012-03-28 2013-10-03 Panasonic Corporation Recording apparatus and recording system
CN107872716A (en) * 2016-09-23 2018-04-03 杭州海康威视数字技术股份有限公司 A kind of stream data analytic method, device and the electronic equipment of rearmounted encapsulation
CN107979783A (en) * 2016-10-25 2018-05-01 杭州海康威视数字技术股份有限公司 A kind of stream data analytic method, device and electronic equipment
CN110784741A (en) * 2018-07-31 2020-02-11 中移(杭州)信息技术有限公司 Time-shifting response method and device of media data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130259441A1 (en) * 2012-03-28 2013-10-03 Panasonic Corporation Recording apparatus and recording system
CN107872716A (en) * 2016-09-23 2018-04-03 杭州海康威视数字技术股份有限公司 A kind of stream data analytic method, device and the electronic equipment of rearmounted encapsulation
CN107979783A (en) * 2016-10-25 2018-05-01 杭州海康威视数字技术股份有限公司 A kind of stream data analytic method, device and electronic equipment
CN110784741A (en) * 2018-07-31 2020-02-11 中移(杭州)信息技术有限公司 Time-shifting response method and device of media data

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114845159A (en) * 2022-04-22 2022-08-02 北京百度网讯科技有限公司 Download data generation method and device

Similar Documents

Publication Publication Date Title
CN112261416A (en) Cloud-based video processing method and device, storage medium and electronic equipment
WO2020155964A1 (en) Audio/video switching method and apparatus, and computer device and readable storage medium
CN108605160A (en) Information processing equipment and information processing method
CN104967862A (en) Video storage method and device, and video searching method and device
CN110784750A (en) Video playing method and device and computer equipment
CN112866730B (en) Streaming media data transmission method, device, system, electronic equipment and storage medium
WO2023005831A1 (en) Resource playing method and apparatus, electronic device, and storage medium
CN111356023B (en) Playing mode determining method and device
CN112562638A (en) Voice preview method and device and electronic equipment
CN114040245B (en) Video playing method and device, computer storage medium and electronic equipment
CN113742518A (en) Method, apparatus and computer program product for storing and providing video
CN113542764A (en) Video quick starting method and device, electronic equipment and computer readable medium
CN113382278B (en) Video pushing method and device, electronic equipment and readable storage medium
CN113873288A (en) Method and device for generating playback in live broadcast process
CN117041652A (en) Video recording method and device based on browser, electronic equipment and storage medium
KR100909669B1 (en) How to Play Flash-based Video Content in Web Browsers of Mobile and Embedded Devices
CN105847990A (en) Media file playing method and apparatus
US7324858B2 (en) Replay apparatus, replay method, recording medium, and computer program
EP3331245B1 (en) Opportunistic frame caching transcoder and pre-viewer.
US8200067B2 (en) Processing of scalable compressed video data formats for nonlinear video editing systems
KR20040006962A (en) Method for editing and apparatus thereof
KR20100029010A (en) Multiprocessor systems for processing multimedia data and methods thereof
CN114979719B (en) Video playing method, device, medium and electronic equipment
JP7247184B2 (en) Information processing device, information processing system, program and information processing method
KR100657818B1 (en) Method for playing multimedia data including codec

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220128

Address after: 100007 room 205-32, floor 2, building 2, No. 1 and No. 3, qinglonghutong a, Dongcheng District, Beijing

Applicant after: Tianyiyun Technology Co.,Ltd.

Address before: No.31, Financial Street, Xicheng District, Beijing, 100033

Applicant before: CHINA TELECOM Corp.,Ltd.

TA01 Transfer of patent application right