Summary of the invention
The embodiment of the invention provides a kind of audio/video multimedia file format, player method and device for playing fast, with the online request speed that improves audio-video document and the waste that reduces Internet resources.
On the one hand, the embodiment of the invention provides a kind of audio/video multimedia file format for playing fast, this audio/video multimedia file is comprised of file header, medium stream information, index block and data block from front to back successively, described file header is used for depositing multimedia file base attribute information, described medium stream information is used for depositing Media Stream base attribute information, described index block is used for depositing the index information table of demarcation of location, and described data block is used for depositing multi-medium data.
Preferably, the file header in the embodiment of the invention comprises: signature is used for the identification document Format Type; Length is used for defined file head length; Version is for the version number of defined file form; Code check is for the code check that defines whole file; Time scale is used for the time scale that use in defined file head time correlation territory; Time origin, the hardware clock that the product of described time origin and described time scale and player use is complementary; Playing duration is used for defined file reproduction time length; The media fluxion is used for the number of the medium stream information piece that defined file comprises; The data block skew is used for defining data block skew hereof; Master index record number is used for defining the quantity that master index records.
Preferably, the medium stream information in the embodiment of the invention comprises: signature is used for identification medium stream information piece; Length is used for defining the medium stream information block length; Version is for the version number of defined file form; The stream expression is for the stream of unique expression file; Traffic classification is used for sign stream and is video flowing or audio stream; Code check is for the code check of this stream of definition; Time span is used for defining the time scale that flows timestamp; Playing duration is for the reproduction time length of this stream of definition; Stream type is for the type that defines Media Stream; Video/audio flows peculiar data, is used for defining peculiar data.
Preferably, the index block in the embodiment of the invention comprises indexing head and index record, and wherein, described indexing head comprises: signature is used for the identification index piece; Length is for the length of index of definition piece; Version is for the version number of defined file form; The index record number is used for the index of definition table and records number; Described index record comprises: timestamp is used for timestamp corresponding to record; Fail to be sold at auction and show, be used for record to deserved Media Stream; Sign is used for the definition record sign; Skew is used for document misregistration corresponding to record; Frame count is used for the counting that record points to frame.
Preferably, the data block in the embodiment of the invention comprises data head and Frame, and wherein, described data head comprises: signature is used for identification data block; Length is for the length that defines data block; The frame number is for the total number that defines Frame; Described Frame comprises: size, for the size that defines Frame; Fail to be sold at auction and show, be used for indicating this Frame and belong to which Media Stream; Sign is used for defining the Frame sign; Timestamp is for the timestamp of this data vertical frame dimension of definition; Frame data are used for the media data that this Frame of definition comprises.
On the other hand, the embodiment of the invention also provides a kind of file format synthetic method of quick playing audio-video multimedia file, and the method comprises: the audio/video multimedia data source is separated into voice data and video data; With the audio/video multimedia file that the voice data that separates and video data synthesize quick broadcast, described audio/video multimedia file is comprised of file header, medium stream information, index block and data block from front to back successively.
On the other hand, the embodiment of the invention also provides a kind of method of quick playing audio-video multimedia file format, and the method comprises: the index information table that receives first described audio/video multimedia file before the reception audio/video multimedia file data blocks; Described index information table is stored in the memory cell of User Interface; When receiving user's random access when indication, the Frame information that obtains the needs random access according to user's random access indication and the information in the described index information table; According to described Frame information read data frame and broadcast from the memory module of storage audio/video multimedia file.
Preferably, the Frame information that obtains the needs random access according to the information in the indication of user's random access and the described index information table in the embodiment of the invention comprises: according to the timestamp information of user's look random access indication from progress bar intercepting access time point; Find out the key frame information nearest with described timestamp in the index information table in the described memory cell; Calculate the Frame information of needs random access according to described timestamp information and described key frame information.
Preferably, comprise according to described Frame information read data frame and playing from the memory module of storage audio/video multimedia file in the embodiment of the invention: according to described Frame information read data frame from the memory module of storage audio/video multimedia file; The data separating of described Frame is become voice data and/or video data; Exporting described voice data to the audio frequency played data through audio decoder, after playing up plays; Described video data is exported to the transmit control module of User Interface through video decode, after playing up, present to the user by the broadcast window of User Interface.
On the other hand, the embodiment of the invention also provides a kind of file format synthesizer of quick playing audio-video multimedia file, comprising: separative element is used for the audio/video multimedia data source is separated into voice data and video data; Synthesis unit is used for the audio/video multimedia file that the voice data that will separate and video data synthesize quick broadcast, and described audio/video multimedia file is comprised of file header, medium stream information, index block and data block from front to back successively.
On the other hand, the embodiment of the invention also provides a kind of device of file format of quick playing audio-video multimedia file, comprise: receiving element, for the index information table that before receiving the audio/video multimedia file data blocks, receives first described audio/video multimedia file; Memory cell is used for storing described index information table; The Frame information acquisition unit is used for when receiving the indication of user's random access, according to user's random access indicate and described index information table in information obtain the Frame information of needs random access; Broadcast unit is used for according to memory module read data frame and the broadcast of described Frame information from storage audio/video multimedia file.
Preferably, the Frame information acquisition unit in the embodiment of the invention comprises: the timestamp information acquisition module is used for according to the timestamp information of user's look random access indication from progress bar intercepting access time point; The key frame information acquisition module is for finding out the key frame information nearest with described timestamp in the index information table in described memory cell; Frame information calculations module is used for calculating according to described timestamp information and described key frame information the Frame information of needs random access.
The embodiment of the invention can be before the receive data piece reception hint information table in advance download index information table and reading out data so that no longer need to jump during user's random access in the online request so that online request speed is accelerated, improved user's experience.The file header of audio/video multimedia file only includes necessary file header information in the embodiment of the invention in addition, has reduced the unnecessary transmission of redundant information, has saved Internet resources.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Be illustrated in figure 2 as a kind of structural representation for the quick audio/video multimedia file format of playing that the embodiment of the invention provides, this video file format comprises: file header, medium stream information, index block and data block.As seen from Figure 2, above-mentioned file header, medium stream information, index block and data block set gradually from front to back, and when changing the audio/video multimedia file and play online, it also is according to above-mentioned sequence transmission.In the present embodiment, file header is used for depositing multimedia file base attribute information, and medium stream information is used for depositing Media Stream base attribute information, and index block is used for depositing the index information table of demarcation of location, and data block is used for depositing multi-medium data.
Be illustrated in figure 3 as the structural representation of a kind of file header that the embodiment of the invention provides, this document head comprises: signature is used for the identification document Format Type; Length is used for defined file head length; Version is for the version number of defined file form; Code check is for the code check that defines whole file; Time scale is used for the time scale that use in defined file head time correlation territory; Time origin, the hardware clock that the product of described time origin and described time scale and player use is complementary; Playing duration is used for defined file reproduction time length; The media fluxion is used for the number of the medium stream information piece that defined file comprises; The data block skew is used for defining data block skew hereof; Master index record number is used for defining the quantity that master index records.
Be illustrated in figure 4 as the structural representation of a kind of medium stream information that the embodiment of the invention provides, this medium stream information comprises: signature is used for identification medium stream information piece; Length is used for defining the medium stream information block length; Version is for the version number of defined file form; The stream expression is for the stream of unique expression file; Traffic classification is used for sign stream and is video flowing or audio stream; Code check is for the code check of this stream of definition; Time span is used for defining the time scale that flows timestamp; Playing duration is for the reproduction time length of this stream of definition; Stream type is for the type that defines Media Stream; Video/audio flows peculiar data, is used for defining peculiar data.
Be illustrated in figure 5 as the structural representation of a kind of index block that the embodiment of the invention provides, this index block comprises indexing head and index record, wherein,
Indexing head comprises: signature is used for the identification index piece; Length is for the length of index of definition piece; Version is for the version number of defined file form; The index record number is used for the index of definition table and records number;
Index record comprises: timestamp is used for timestamp corresponding to record; Fail to be sold at auction and show, be used for record to deserved Media Stream; Sign is used for the definition record sign; Skew is used for document misregistration corresponding to record; Frame count is used for the counting that record points to frame.
Be illustrated in figure 6 as the structural representation of a kind of data block that the embodiment of the invention provides, this data block comprises data head and Frame, wherein,
Data head comprises: signature is used for identification data block; Length is for the length that defines data block; The frame number is for the total number that defines Frame;
Frame comprises: size, for the size that defines Frame; Fail to be sold at auction and show, be used for indicating this Frame and belong to which Media Stream; Sign is used for defining the Frame sign; Timestamp is for the timestamp of this data vertical frame dimension of definition; Frame data are used for the media data that this Frame of definition comprises.
The embodiment of the invention can be before the receive data piece reception hint information table in advance download index information table and reading out data so that no longer need to jump during user's random access in the online request so that online request speed is accelerated, improved user's experience.The file header of audio/video multimedia file only includes necessary file header information in the embodiment of the invention in addition, has reduced the unnecessary transmission of redundant information, has saved Internet resources.
Be illustrated in figure 7 as the synthetic method schematic flow sheet of a kind of quick playing audio-video multimedia file format that the embodiment of the invention provides, the method comprises:
S701: the audio/video multimedia data source is separated into voice data and video data.
S702: with the audio/video multimedia file that the voice data that separates and video data synthesize quick broadcast, described audio/video multimedia file is comprised of file header, medium stream information, index block and data block from front to back successively.
Specifically, after obtaining voice data and video data by S701, can decode respectively to this voice data and video data first, and then the rear data of decoding are encoded, being integrated into the audio/video multimedia file finally by crossing S702, the audio/video multimedia file here refers to have above-mentioned Fig. 1-file of the described audio/video multimedia file format of the corresponding embodiment of Fig. 6.
As one embodiment of the present of invention, can adopt the Vorbits compression algorithm to encode to audio data decoder, then can adopt the ON2 compression algorithm to encode to decoded video data.
When the synthetic audio/video multimedia file of the embodiment of the invention is play online, can be before the receive data piece reception hint information table in advance, download index information table and reading out data so that no longer need during user's random access in the online request to jump, so that online request speed is accelerated, improved user's experience.The file header of audio/video multimedia file only includes necessary file header information in the embodiment of the invention in addition, has reduced the unnecessary transmission of redundant information, has saved Internet resources.
Be illustrated in figure 8 as the method flow schematic diagram of a kind of quick playing audio-video multimedia file format that the embodiment of the invention provides, this player method is based on the basis of above-mentioned audio/video multimedia file format, the present embodiment is the description of the present invention being carried out from user's terminal side, and the method comprises:
S801: the index information table that before receiving the audio/video multimedia file data blocks, receives first described audio/video multimedia file.Because before the position of index block in the audio/video multimedia file format was positioned at data block in the present embodiment, therefore in the time of online the broadcast, terminal can receive first the index information table for data block.
S802: described index information table is stored in the memory cell of User Interface.
The memory cell of user interface is a region of memory of computer in the present embodiment.
S803: when receiving user's random access when indication, the Frame information that obtains the needs random access according to user's random access indication and the information in the described index information table.
As one embodiment of the present of invention, as shown in Figure 9, this step may further include following substep:
S8031: according to the timestamp information of user's look random access indication from progress bar intercepting access time point;
S8032: find out the key frame information nearest with above-mentioned timestamp in the index information table in the memory cell;
S8033: the Frame information that calculates the needs random access according to described timestamp information and described key frame information.
S804: according to described Frame information read data frame and broadcast from the memory module of storage audio/video multimedia file.
As one embodiment of the present of invention, as shown in figure 10, this step may further include following substep:
S8041: according to described Frame information read data frame from the memory module of storage audio/video multimedia file;
S8042: the data separating of described Frame is become voice data and/or video data;
S8043: export described voice data to the audio frequency played data through audio decoder, after playing up and play;
S8044: described video data is exported to the transmit control module of User Interface through video decode, after playing up, present to the user by the broadcast window of User Interface.
It is pointed out that the embodiment of the invention do not emphasize the execution sequence between above-mentioned steps S6043 and the step S6044.
The below comes above-mentioned steps is further detailed based on the structural representation of a kind of terminal that the embodiment of the invention provides, the structural representation of a kind of terminal that provides for the embodiment of the invention as shown in figure 11.
As shown in figure 11, all store the multimedia file of above-mentioned audio/video multimedia file format in the acceleration Download Server in the usertracking server in the P2P network, other terminals and the acceleration download network.These terminals provide online order program data source for the terminal of user's side.
User's side terminal is exactly a player software that runs in the computer in actual applications, transmission control end and user's interface among Figure 11 all are under the jurisdiction of this player, wherein transmitting control end is the running background program of player, and the graphical interfaces that User Interface is player and user carries out interactive operation.
In the present embodiment, the transmission control end can provide the functions such as P2P downloading task, management role, transmits simultaneously the startup module of control end or player system, and after player system started, the transmission control end can be finished the initial work of modules.The transmission control module of transmission in the control end can adopt the mode of proprietary protocol or P2P agreement and usertracking server and other nodes with resource data to communicate, and perhaps this transmission control module can adopt http agreement and acceleration Download Server to communicate.
When carrying out online request, file read module in the player can be by data communication interface constantly in the mode of asking/replying from transmission control end Gains resources data, then through separation module this resource data is classified, thereby voice data is sent to the audio decoder module, give the video decode module with video data transmitting, voice data decoding is also play by audio playing apparatus through after playing up, and video data decoding is also play by the broadcast window of User Interface by after playing up.
Perhaps, the embodiment of the invention is when carrying out online request, the transmission control end also can be kept at the resource data of receiving in the memory module, this memory module is a disk position or core position, then will preserve the address and send to data communication interface, then the file read module is constantly with the mode of asking/replying Gains resources data and playing from memory module.
In the present embodiment, User Interface can comprise memory cell, play logic control element, play position setting unit and broadcast window.Here memory cell is a memory headroom, the file read module just be temporarily stored in here than the preferential above-mentioned index information table that receives of data block.When the user in program request during random access, the play position setting unit can be from the timestamp information of progress bar cutting time point, and find out the key frame information nearest with timestamp in the index information table in the memory cell, then play the Frame that Logic control module can calculate according to timestamp information and key frame information the needs random access, this broadcast Logic control module is delivered to playing controller with this Frame information, playing controller schedule file read module read data frame from memory module, then these Frame data are through separation module, present to the user by broadcast window after video decode module and the Video Rendering resume module, be about to video presentation that the user need to watch out.
The embodiment of the invention can be before the receive data piece reception hint information table in advance download index information table and reading out data so that no longer need to jump during user's random access in the online request so that online request speed is accelerated, improved user's experience.The file header of audio/video multimedia file only includes necessary file header information in the embodiment of the invention in addition, has reduced the unnecessary transmission of redundant information, has saved Internet resources.
The synthesizer structural representation of a kind of quick playing audio-video multimedia file format that provides for the embodiment of the invention as shown in figure 12, this device comprises:
Separative element 1201 is used for the audio/video multimedia data source is separated into voice data and video data.
Synthesis unit 1202 is used for the audio/video multimedia file that the voice data that will separate and video data synthesize quick broadcast, and described audio/video multimedia file is comprised of file header, medium stream information, index block and data block from front to back successively.
As one embodiment of the present of invention, this device can also comprise decoding unit and coding unit, after obtaining voice data and video data by separative element 1201, can utilize first decoding unit that this voice data and video data are decoded respectively, and then utilize coding unit that the rear data of decoding are encoded, being integrated into the audio/video multimedia file finally by crossing synthesis unit 1202, the audio/video multimedia file here refers to have above-mentioned Fig. 1-file of the described audio/video multimedia file format of the corresponding embodiment of Fig. 6.Here coding unit can adopt the Vorbits compression algorithm to encode to audio data decoder, then can adopt the ON2 compression algorithm to encode to decoded video data.
When the synthetic audio/video multimedia file of the embodiment of the invention is play online, can be before the receive data piece reception hint information table in advance, download index information table and reading out data so that no longer need during user's random access in the online request to jump, so that online request speed is accelerated, improved user's experience.The file header of audio/video multimedia file only includes necessary file header information in the embodiment of the invention in addition, has reduced the unnecessary transmission of redundant information, has saved Internet resources.
The apparatus structure schematic diagram of a kind of quick playing audio-video multimedia file format that provides for the embodiment of the invention as shown in figure 13, this device can be a playback terminal of user's side, this device comprises: receiving element 110, memory cell 120, Frame information acquisition unit 130 and broadcast unit 140, wherein memory cell 120 links to each other with receiving element 110 and Frame information acquisition unit 130 respectively, and broadcast unit 140 links to each other with Frame information acquisition unit 130.
Receiving element 110 is used for receiving first the index information table of described audio/video multimedia file before receiving the audio/video multimedia file data blocks.Because before the position of index block in the audio/video multimedia file format was positioned at data block in the present embodiment, therefore in the time of online the broadcast, receiving element 110 can receive first the index information table for data block.
Memory cell 120 is used for storing described index information table, and this memory cell 120 can be a core position.
Frame information acquisition unit 130 receives user's random access when indication, the Frame information that obtains the needs random access according to user's random access indication and the information in the described index information table.The indication of this random access is such as being that the user clicks the progress bar of looking audio frequency by mouse and sends.
The structural representation of a kind of Frame information acquisition unit that provides for the embodiment of the invention as shown in figure 14, this Frame information acquisition unit 130 can comprise: timestamp information acquisition module 131, key frame information acquisition module 132 and Frame information calculations module 133.
Timestamp information acquisition module 131 is used for according to the timestamp information of user's look random access indication from progress bar intercepting access time point.
Key frame information acquisition module 132 is for finding out the key frame information nearest with described timestamp in the index information table in described memory cell.
Frame information calculations module 133 is used for calculating according to described timestamp information and described key frame information the Frame information of needs random access.
Frame information read data frame and broadcast from the memory module of storage audio/video multimedia file that broadcast unit 140 obtains according to Frame information acquisition unit 130.Specifically, the Frame that reads becomes independently voice data and video data after separating, and then represents to the user through decoding and after playing up respectively.
The embodiment of the invention can be before the receive data piece reception hint information table in advance download index information table and reading out data so that no longer need to jump during user's random access in the online request so that online request speed is accelerated, improved user's experience.The file header of audio/video multimedia file only includes necessary file header information in the embodiment of the invention in addition, has reduced the unnecessary transmission of redundant information, has saved Internet resources.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in above-described embodiment method, can come the relevant hardware of instruction to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process such as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; the protection range that is not intended to limit the present invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.