CN107302715A - Multimedia file playing method, multimedia file packaging method, corresponding device and terminal - Google Patents

Multimedia file playing method, multimedia file packaging method, corresponding device and terminal Download PDF

Info

Publication number
CN107302715A
CN107302715A CN201710680593.4A CN201710680593A CN107302715A CN 107302715 A CN107302715 A CN 107302715A CN 201710680593 A CN201710680593 A CN 201710680593A CN 107302715 A CN107302715 A CN 107302715A
Authority
CN
China
Prior art keywords
video
bag
data
multimedia file
format type
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
CN201710680593.4A
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.)
Yuanxin Technology
Original Assignee
Yuanxin Technology
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 Yuanxin Technology filed Critical Yuanxin Technology
Priority to CN201710680593.4A priority Critical patent/CN107302715A/en
Publication of CN107302715A publication Critical patent/CN107302715A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4342Demultiplexing isochronously with video sync, e.g. according to bit-parallel or bit-serial interface formats, as SDI
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4345Extraction or processing of SI, e.g. extracting service information from an MPEG stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • H04N21/4351Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream involving reassembling additional data, e.g. rebuilding an executable program from recovered modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4398Processing of audio elementary streams involving reformatting operations of audio signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Abstract

The invention provides a playing method and a packaging method of a multimedia file, a corresponding device and a terminal, which comprises the steps of determining the format type of the multimedia file to be a preset multimedia packaging format type by using an information field in a file header packet, namely correspondingly analyzing the information field in a media information packet to obtain audio and video parameter information of the multimedia file, analyzing a video compression data packet and an audio compression data packet which are stored in a media data packet in a crossed manner to obtain video data and audio data, and playing the multimedia file according to the audio and video parameter information, the obtained video data and the obtained audio data. The invention obtains the key audio and video parameter information in the multimedia file by directly analyzing the information field, and obtains the video data and the audio data by analyzing the video compression data packet and the audio compression data packet which are stored in a crossed way, thereby achieving the purposes of reducing the playing complexity of the multimedia file and saving the resources occupied by the memory.

Description

The player method of multimedia file, method for packing and corresponding device, terminal
Technical field
The present invention relates to multimedia technology field, in particular to a kind of player method of multimedia file, encapsulation side Method and corresponding device, terminal.
Background technology
The encapsulation of multimedia technology, especially multimedia file and play-back technology, turn in multimedia from analog to digitalization Flourished during change.With people to the definition of the content of multimedia such as video, audio, fluency, simplify The requirement of degree is more and more harsher, has become a very powerful and exceedingly arrogant technology.New application and product almost can all go out daily Now, the advantage of the checking of passage time and market practice, major applications and product gradually shows, and shortcoming is also exposed therewith. People promote the encapsulation of new multimedia file and play-back technology to be born for high performance continuous pursuit.
At present, multimedia file encapsulation of the MP4 Document encapsulations format standard as in the market main flow, one of broadcast format, It is considered as more comprehensive Container Format.In MP4 files, the quantity of bag is very more, and parcel is deposited in big bag, and one-level is nested One-level deposits media information, it is therefore desirable to parses layer by layer, then integrates reduction media information, wherein can also including those The bag that may also be taken less than can be used.
It can be seen that, this complicated parsing, broadcasting and packaged type so that multimedia file content redundancy, it is necessary to take compared with Many system memory space write-in standards must and the information not necessarily used, higher, the code complexity of mobile phone EMS memory occupancy It is high.
The content of the invention
To overcome above-mentioned technical problem or solving above-mentioned technical problem at least in part, spy proposes following technical scheme:
Embodiments of the invention propose a kind of player method of multimedia file, and the multimedia file is by file header Bag, media information bag, media data packet are constituted successively, and the player method includes:
Parse the information field in the file header bag, and the information field in file header bag determines the multimedia The Format Type of file;
When the Format Type determined is predetermined multimedia encapsulation format type, the letter in the media information bag is parsed Field is ceased to obtain the parameter information of the Voice & Video of the multimedia file;
The video compression data bag and audio compression data bag for intersecting preservation in the media data packet are parsed, to get Video data and voice data;
According to the parameter information of the Voice & Video, and the video data and voice data got, carry out many matchmakers Body file is played.
Specifically, the information field in the bag according to file header determines the step of the Format Type of the multimedia file Suddenly, including:
Judge whether is information field character string corresponding with predetermined multimedia encapsulation format type in the file header bag Matching;
If matching, it is determined that the Format Type of the multimedia file is predetermined multimedia encapsulation format type.
When actual use, the parameter information of the Voice & Video is including at least one of following:Video encoder title, regard Frequency height, video width, video frame rate, video bitrate, audio coder title, audio sample rate, audio bit rate, many matchmakers Body file bit rate.
Further, the video compression data bag and audio compression number of preservation are intersected in the parsing media data packet According to bag, the step of to get video data and voice data, including:
The information field in the video compression data bag is read, when obtaining byte number, the video of video compression data bag Between stamp table, length of the video time and specific video data;
The information field in the audio compression data bag is read, when obtaining byte number, the audio of audio compression data bag Between stamp table, audio time length and specific voice data.
On the other hand, the embodiment of the present invention additionally provides a kind of method for packing of multimedia file, including:
Video data and voice data are packaged into the video compression data bag and audio compression data bag for intersecting and preserving, obtained To media data packet;
According to the video data and voice data, the parameter information of Voice & Video is determined, and by Voice & Video Parameter information is write in the way of information field in media information bag;
File header bag, the media information bag and the media data packet of predetermined multimedia encapsulation format type will be identified Encapsulate in order, obtain the multimedia file.
Wherein, in addition to:The corresponding character string of predetermined multimedia encapsulation format type is write in the way of information field In file header bag, for identifying the Format Type of the multimedia file for predetermined multimedia encapsulation format type.
The embodiments of the invention provide a kind of playing device of multimedia file, the multimedia file by file header bag, Media information bag, media data packet is constituted successively, and the playing device includes:
Format Type determining module, for parsing the information field in the file header bag, and according in file header bag Information field determines the Format Type of the multimedia file;
Parameter information acquisition module, for when the Format Type determined is predetermined multimedia encapsulation format type, solving The information field in the media information bag is analysed to obtain the parameter information of the Voice & Video of the multimedia file;
Data acquisition module, the video compression data bag and audio pressure of preservation are intersected for parsing in the media data packet Contracting packet, to get video data and voice data;
Playing module, for the parameter information according to the Voice & Video, and the video data and audio got Data, carry out multimedia file broadcasting.
The embodiment of the present invention additionally provides a kind of packaging system of multimedia file, including:
Data package module, for by video data and voice data be packaged into intersect preserve video compression data bag and Audio compression data bag, obtains media data packet;
Parameter information package module, for according to the video data and voice data, determining the parameter of Voice & Video Information, and the parameter information of Voice & Video is write in the way of information field in media information bag;
Document encapsulation module, for file header bag, the media information by predetermined multimedia encapsulation format type is identified Bag and the media data packet are encapsulated in order, obtain the multimedia file.
Further, in addition to:Format Type package module, for by the corresponding word of predetermined multimedia encapsulation format type Symbol string is write in the way of information field in file header bag, many to make a reservation for for identifying the Format Type of the multimedia file Media encapsulation format type.
The embodiment of the present invention additionally provides a kind of terminal, including:Memory, processor and store on a memory and can be The program run on processor, realizes the method described in any of the above during the computing device described program.
The player method of multimedia file provided in an embodiment of the present invention, method for packing and corresponding device, terminal, lead to Cross and the Format Type of multimedia file is determined with the information field in file header bag for predetermined multimedia encapsulation format type, i.e., The information field in media information bag can be parsed accordingly with the parameter information for the Voice & Video for obtaining multimedia file, and Intersect the video compression data bag and audio compression data bag of preservation to get video data and sound in parsing media data packet Frequency evidence, according to the parameter information of Voice & Video, and the video data and voice data got, carry out multimedia file Play.All it is nested in different bags from the multimedia file sound intermediate frequency of prior art and the parameter information of video, to multimedia Need to be parsed respectively during file decoding, and the video data included in multimedia file and voice data position are not fixed Parse difficulty caused by compare greatly, the present invention obtains most crucial, most in multimedia file by directly parsing information field The parameter information of crucial Voice & Video, and carried out to intersecting the video compression data bag preserved and audio compression data bag Parsing obtains the mode of video data and voice data, reaches complexity that reduction multimedia file plays and saves internal memory and accounts for With the purpose of resource.
The additional aspect of the present invention and advantage will be set forth in part in the description, and these will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be attached to what is used required in embodiment Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, therefore is not construed as pair The restriction of scope, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to this A little accompanying drawings obtain other related accompanying drawings.
Fig. 1 is the example of the data structure of multimedia file provided in an embodiment of the present invention;
Fig. 2 is the schematic flow sheet of the player method of multimedia file provided in an embodiment of the present invention;
Fig. 3 is the schematic flow sheet of the method for packing of multimedia file provided in an embodiment of the present invention;
Fig. 4 is the block schematic illustration of the playing device of multimedia file provided in an embodiment of the present invention;
Fig. 5 is the block schematic illustration of the packaging system of multimedia file provided in an embodiment of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention Middle accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only It is a part of embodiment of the invention, rather than whole embodiments.The present invention being generally described and illustrated herein in the accompanying drawings is real Applying the component of example can be arranged and be designed with a variety of configurations.Therefore, it is of the invention to what is provided in the accompanying drawings below The detailed description of embodiment is not intended to limit the scope of claimed invention, but is merely representative of the selected reality of the present invention Apply example.Based on embodiments of the invention, the institute that those skilled in the art are obtained on the premise of creative work is not made There is other embodiment, belong to the scope of protection of the invention.
In view of complicated multimedia parsing, play and packaged type so that multimedia file content redundancy is, it is necessary to take More system memory space write-in standard must and the information not necessarily used, higher, the code complexity of mobile phone EMS memory occupancy Also it is high.Based on this, the embodiments of the invention provide a kind of player method of multimedia file, method for packing and corresponding dress Put, terminal, be described below by embodiment.
The embodiments of the invention provide a kind of player method of multimedia file, as shown in figure 1, wherein multimedia file by File header bag (File Header Package, hereinafter referred to as FHP), media information bag (Media Information Package, hereinafter referred to as MIP), media data packet (Media Data Package, hereinafter referred to as MDP) is constituted successively. As shown in Fig. 2 player method specifically includes following steps:
S201:Parse the information field in the file header bag, and described in the information field in file header bag determines The Format Type of multimedia file;
In embodiments of the present invention, FHP can indicate this multimedia file as first bag in multimedia file Format Type, to take correct analysis mode, this is effective first step for playing multimedia file, is also necessary step Suddenly.
For example, according to character string has been sequentially written in, " fhp syber format " take altogether the letter of 16 bytes in FHP Cease field.When player goes parsing, first have to judge that the information field in FHP is corresponding with predetermined multimedia encapsulation format type Character string whether match, in the predetermined bite by parsing this multimedia file, i.e., in preceding 16 bytes, that is, FHP Information field whether be the corresponding character string of predetermined multimedia encapsulation format type " fhp syber format ".If matching, The Format Type that multimedia file can then be determined is predetermined multimedia encapsulation format type, you can to take the embodiment of the present invention The player method of offer parses and played this multimedia file.
When actual use, the corresponding indicating mode of predetermined multimedia encapsulation format type does not have strict limitation, may be used yet To be performed using other information field even other forms.
The embodiment of the present invention takes parsing FHP to obtain the mode of Format Type, can both specify the special of the Format Type Property, the information in other bags can also be protected when it fails to match;Form can be just obtained by the way of parsing information field Type, safe and reliable purpose has been reached with relatively low parsing complexity.
S202:When the Format Type determined is predetermined multimedia encapsulation format type, the media information bag is parsed In information field to obtain the parameter information of the Voice & Video of the multimedia file;
The condition for performing this step has been specify that in S201.
In the embodiment of the present invention, MIP (Media Information Package, media information bag) is used as multimedia text Second bag in part, can indicate that the relevant parameter information for the Voice & Video being encapsulated in this multimedia file.
The parameter information of the Voice & Video encapsulated different from the multimedia such as MP4 form is all by being nested in big bag Parcel is preserved respectively by different parameters classification, the characteristics of parsing more complicated, and the embodiment of the present invention is by parsing the information word in MIP Section, it is possible to obtain whole parameter informations of Voice & Video.Write that is, the parameter information of Voice & Video is all concentrated Into a bag, i.e. in MIP, this mode is easy to the no write de-lay of encoder and the fast resolving of player, reduces system The complexity of code.
The parameter information of the Voice & Video provided in the embodiment of the present invention includes at least one of following:Video encoder name Claim (video codec), video height (video height), video width (video width), video frame rate (video Frame rates), video bitrate (video bitrates), audio coder title (audio codec), audio sample Rate (audio sample rates), audio bit rate (audio bitrates), multimedia file bit rate (total bitrates)。
It is preferred that the parameter information of above Voice & Video all occupies the information field in MIP, example with fixed order Such as, according to the above-mentioned order enumerated, the corresponding information field of parameter information of each Voice & Video occupies 4 bytes respectively Number, has further speeded up analyzing efficiency, while being also convenient for developer's positioning and Commissioning Analysis.
S203:The video compression data bag and audio compression data bag for intersecting preservation in the media data packet are parsed, with Get video data and voice data;
In embodiments of the present invention, MDP (Media Data Package, media data packet) is as in multimedia file 3rd bag, contains specific voice data and specific video data.It is specifically as follows, as shown in figure 1, by video one by one Compressed data packets (Video Chunk Package, hereinafter referred to as VCP) and one by one audio compression data bag (Audio Chunk Package, hereinafter referred to as ACP) intersect preservation form, by parsing each VCP and ACP in MDP, it is possible to obtain Get video data and voice data.
Two of which bag internal structure is identical, and analysis mode is also identical, illustrates bag inner structure by taking VCP as an example below And analysis mode.
To reach in normal play complete video, and the purpose with audio sync, VCP except the specific video that is stored with Outside data, should also include some parameter informations is used to play out after parsing, and can include:VCP byte number (Size), regard Frequency timestamp table (Timestamp table), length of the video time (Duration) and specific video data (Stream data)。
Can there are more redundancy and useless data, such as index value, creation time after being parsed different from MP4 multimedia files Etc., it is not of practical significance for playing multimedia file, in addition it is also necessary to take unnecessary system memory space, present invention institute is real The player method for applying example offer has pertained only to most crucial, maximally effective audio frequency and video parameter information in resolving, reaches reduction Installed System Memory takes the purpose of resource.
Wherein, parsing obtains VCP byte number, the byte length that the VCP takes just is can know that, with reference to ACP word Length is saved, it is possible to know next VCP or ACP position, similarly, by cumulative it is known that each VCP or ACP position Put, easy-to-look-up and reading.
Parsing obtains video time stamp table, the timestamp information of each frame of video in each VCP is indicated, during for playing It is synchronous with audio frame holding.
Parsing obtains length of the video time, indicates the time span of all frame of video in each VCP.Add up each VCP bags Length of the video time, it is possible to obtain the length of the video time of this whole multimedia file.
Parsing obtains the video of specific video data, as broadcasting.
Similar to MIP analysis mode, above parameter information can also be occupied the information word in VCP by fixed order Section, such as according to the above-mentioned order enumerated.Wherein, the VCP corresponding information field of byte number and length of the video time can be write To occupy 4 byte numbers or other storage modes, and video time stamp table and specific video data can be according to specific videos The distribution mode of frame is stored.
Wrapped or preferably, VCP not only can contemplate be to be write as single frame of video one when frame of video reaches During to a standard, the VCP write as.It is envisioned that the quantity for the VCP that a complete video is split is fewer, to a certain degree On can save the I/O read-writes of system, and VCP quantity is very few, then can increase server bandwidth pressure and play selectivity Difference, influences Consumer's Experience.The specific standards for the frame of video that the VCP to be parsed is included are not limited in the embodiment of the present invention, as Illustratively, it is proposed that parsing VCP can obtain the video data of 100 frame of video.
ACP bag inner structure and analysis mode is identical with VCP, will not be repeated here.What deserves to be explained is, each VCP bags Corresponding ACP bags are preferably maintained in identical frame length.
If last frame of video and audio frame does not reach VCP and ACP standard, by residue frame be packaged into a VCP or Person ACP, ensures the integrality of video data and voice data after parsing.
Therefore, by reading the information field in VCP, the byte number, video time stamp table, video time for obtaining VCP are long Degree and specific video data, read the information field in ACP, and the byte number, audio time stamp table, audio time for obtaining ACP are long After degree and specific voice data, it is possible to perform S204 steps.
S204:According to the parameter information of the Voice & Video, and the video data and voice data got, carry out Multimedia file is played.
The player method of multimedia file provided in an embodiment of the present invention, is determined by the information field read in FHP The Format Type of multimedia file is predetermined multimedia encapsulation format type, you can information field in corresponding parsing MIP with Obtain and intersect the VCP and ACP of preservation to get in the parameter information of the Voice & Video of multimedia file, and parsing MDP Video data and voice data, according to the parameter information of Voice & Video, and the video data and voice data got, enter Row multimedia file is played.Different bags are all nested in from the multimedia file sound intermediate frequency of prior art and the parameter information of video In, need to parse respectively when decoding multimedia file, and the video data and audio number included in multimedia file Do not fix the parsing difficulty caused by according to position to compare greatly, the embodiment of the present invention obtains many matchmakers by directly parsing information field The parameter information of most crucial, most critical Voice & Video in body file, and parsed to intersecting the VCP preserved and ACP The mode of video data and voice data is obtained, the complexity of reduction multimedia file broadcasting is reached and saves EMS memory occupation money The purpose in source.
The embodiment of the present invention additionally provides a kind of method for packing of multimedia file, as shown in figure 3, specifically including following step Suddenly:
S301:Video data and voice data are packaged into the video compression data bag and audio compression data for intersecting and preserving Bag, obtains media data packet (i.e. MDP).
In embodiments of the present invention, video data and voice data are split into multiple regard by certain standard frame number respectively Frequency compressed data packets (i.e. VCP) and audio compression data bag (i.e. ACP).ACP intersects what is preserved by VCP one by one and one by one Mode is packaged, and forms MDP.
Because VCP and ACP have identical bag internal structure and packaged type, illustrated below by taking VCP as an example.
Preferably, VCP not only can contemplate a bag for being packaged into single frame of video, frame of video can also be worked as and reached During one standard, a VCP is packaged into.It is envisioned that the quantity for the VCP that a complete video is split is fewer, to a certain extent The I/O read-writes of system can be saved, and VCP quantity is very few, then can increase server bandwidth pressure and play poor selectivity, Influence Consumer's Experience.The specific standards of the frame of video intercepted when not limiting packaging V CP in the embodiment of the present invention, as illustratively, It is recommended that being, when reaching 100 frame of video, to be just packaged into a VCP write-ins MDP.
ACP bag inner structure and analysis mode is identical with VCP, will not be repeated here.What deserves to be explained is, it is that ACP bags are cut The frame number of audio frame is taken, preferably keeps identical with the frame of video frame number of corresponding VCP bags.
If last frame of video and audio frame does not reach VCP and ACP frame number standard, residue frame is packaged into one VCP or ACP, it is ensured that the integrality of video data and voice data.
To reach in normal play complete video, and the purpose with audio sync, VCP except the specific video that is stored with Outside data, should also be encapsulated into some parameter informations be used for parse after play out, can include:VCP byte number (Size), Video time stamp table (Timestamp table), length of the video time (Duration) and specific video data (Stream data)。
Can there are more redundancy and useless data, such as index value, creation time after being parsed different from MP4 multimedia files Etc., it is not of practical significance for playing multimedia file, in addition it is also necessary to take unnecessary system memory space, the present invention is implemented The method for packing that example is provided only remains most crucial, maximally effective audio frequency and video parameter information, has reached that reduction Installed System Memory takes Purpose.
Wherein, add VCP byte number, be in order to indicate the VCP take byte length, with reference to ACP byte length, It is known that next VCP or ACP position, similarly, by cumulative it is known that each VCP or ACP position, is conveniently looked into Look for and read.
Video time stamp table is added, is in order to indicate the timestamp information of each frame of video in each VCP, for playing When it is synchronous with audio frame holding.
Length of the video time is added, is to indicate the time span of all frame of video in each VCP.Add up each VCP The length of the video time of bag, it is possible to obtain the length of the video time of this whole multimedia file.
Above parameter information can also occupy the information field in VCP by fixed order, for example, enumerated according to above-mentioned Sequentially.Wherein, the VCP corresponding information field of byte number and length of the video time can be written as occupying 4 byte numbers or its His storage mode, and video time stamp table and specific video data can be packaged according to the distribution mode of specific frame of video.
The video compression data and audio compression data position to be parsed compared to the multimedia form such as MP4 are random Do not fix, the characteristics of being not easy to search, the embodiment of the present invention saves as even number bag with VCP, and ACP is saved as exemplified by odd number bag, this The data structure of sample can simply and easily accomplish thread synchronization very much, as long as writing video thread work, then write audio thread block; Otherwise audio thread work is write, then writes video thread block, the complexity of system thread work is reduced.
S302:According to the video data and voice data, the parameter information of Voice & Video is determined, and by audio and regard The parameter information of frequency is write in the way of information field in media information bag (i.e. MIP);
The parameter information of the Voice & Video encapsulated different from the multimedia such as MP4 form is all by being nested in big bag Parcel is preserved respectively by different parameters classification, the characteristics of parsing more complicated, and the embodiment of the present invention is directly by the ginseng of Voice & Video Number information writes MIP in the way of information field.That is, the parameter information of Voice & Video, which is all concentrated, writes a bag In, i.e. in MIP, this mode is easy to the no write de-lay of encoder and the fast resolving of player, reduces answering for system code Miscellaneous degree.
Unnecessary system memory space can be taken in view of excessive redundancy and useless data, for playing multimedia file Also without practical significance, the parameter information of most crucial, most critical Voice & Video is provided in the embodiment of the present invention, including:Depending on Frequency encoder title (video codec), video height (video height), video width (video width), frame of video Rate (video frame rates), video bitrate (video bitrates), audio coder title (audio codec), Audio sample rate (audio sample rates), audio bit rate (audio bitrates), multimedia file bit rate (total bitrates)。
It is preferred that the parameter information of above Voice & Video all occupies the information field in MIP, example with fixed order Such as, according to the above-mentioned order enumerated, the corresponding information field of parameter information of each Voice & Video occupies 4 bytes respectively Number, has further speeded up analyzing efficiency, while being also convenient for developer's positioning and Commissioning Analysis.
S303:File header bag, the media information bag and the media of predetermined multimedia encapsulation format type will be identified Packet is encapsulated in order, obtains the multimedia file.
Before this step, in addition to by the corresponding character string of predetermined multimedia encapsulation format type with the side of information field It is predetermined multimedia encapsulation format class for the Format Type of identification of multimedia file in formula write-in file header bag (i.e. FHP) Type.
For example, write in FHP in the way of information field according to order character string " fhp syber format ", altogether Take 16 bytes.When player goes parsing, it is necessary in the predetermined bite for first parsing this multimedia file, i.e., preceding 16 Whether the information field in byte, that is, FHP is " fhp syber format ".If so, can then take implementation of the present invention The above-mentioned player method that example is provided parses and played this multimedia file.
When actual use, the corresponding indicating mode of predetermined multimedia encapsulation format type does not have strict limitation, may be used yet To be performed using other information field even other forms.
The embodiment of the present invention takes parsing FHP to obtain the mode of Format Type, can both specify the special of the Format Type Property, the information in other bags can also be protected when it fails to match;Form can be just obtained by the way of parsing information field Type, safe and reliable purpose has been reached with relatively low parsing complexity.
The multimedia file that FHP, MIP, MDP are packaged into order, just possesses answering for reduction multimedia file broadcasting Miscellaneous degree, and save the advantage in EMS memory occupation space.
As shown in figure 4, the embodiment of the present invention additionally provides a kind of playing device of multimedia file, including:Format Type Determining module 401, parameter information acquisition module 402, data acquisition module 403 and playing module 404.
Wherein, Format Type determining module 401 is used to parse the information field in FHP, and the information field in FHP Determine the Format Type of multimedia file;
Parameter information acquisition module 402 is used for when the Format Type determined is predetermined multimedia encapsulation format type, The information field in MIP is parsed to obtain the parameter information of the Voice & Video of multimedia file;
Data acquisition module 403 is used to parse the video compression data bag and audio compression data bag for intersecting preservation in MDP, To get video data and voice data;
Playing module 404 is used for the parameter information according to Voice & Video, and the video data and audio number got According to progress multimedia file broadcasting.
Specifically, Format Type determining module 401 includes information field judging unit and Format Type determining unit.
Information field judging unit is used to judge that the information field in FHP is corresponding with predetermined multimedia encapsulation format type Whether character string matches;
Format Type determining unit is used to work as the information field word corresponding with predetermined multimedia encapsulation format type in FHP When according with String matching, it is determined that the Format Type of the multimedia file is predetermined multimedia encapsulation format type.
Data acquisition module 403 includes video reading unit and audio reading unit.
Video reading unit is used to read the information field in the video compression data bag, obtains video compression data bag Byte number, video time stamp table, length of the video time and specific video data;
Audio reading unit is used to read the information field in the audio compression data bag, obtains audio compression data bag Byte number, audio time stamp table, audio time length and specific voice data.
The embodiment of the present invention additionally provides a kind of packaging system of multimedia file, as shown in figure 5, including:Data are encapsulated Module 501, parameter information package module 502, Document encapsulation module 503.
Wherein, data package module 501 is used to being packaged into video data and voice data into the video compress intersected and preserved Packet and audio compression data bag, obtain MDP;
Parameter information package module 502 is used for the parameter letter that Voice & Video is determined according to video data and voice data Breath, and the parameter information of Voice & Video is write in the way of information field in media information bag;
Document encapsulation module 503 is used in order seal FHP, MIP and MDP for identifying predetermined multimedia encapsulation format type Dress, obtains multimedia file.
As shown in figure 5, the packaging system of the multimedia file also includes Format Type package module 504.
Format Type package module 504 is used for the corresponding character string of predetermined multimedia encapsulation format type with information field Mode write in file header bag, for identification of multimedia file Format Type be predetermined multimedia encapsulation format type.
The embodiment of the present invention also provides a kind of terminal, including:Memory, processor and store on a memory and can locate The program run on reason device, realizes the method described in any of the above during the computing device described program.
All it is nested in different bags from the multimedia file sound intermediate frequency of prior art and the parameter information of video, to many matchmakers Need to be parsed respectively during body file decoding, and the video data included in multimedia file and voice data position be not solid The fixed difficulty that parsed caused by is compared greatly, and the playing device and packaging system of multimedia file provided in an embodiment of the present invention can Directly to parse the parameter information that information field obtains most crucial, most critical Voice & Video in multimedia file, and it is right Intersect the video compression data bag preserved and audio compression data bag carry out the mode that parsing obtains video data and voice data, Reach the complexity of reduction multimedia file broadcasting and save the purpose of EMS memory occupation resource.
The playing device and packaging system for the multimedia file that the embodiment of the present invention is provided can be specific in equipment Hardware or the software or firmware that are installed in equipment etc..The device that the embodiment of the present invention is provided, its realization principle and generation Technique effect it is identical with preceding method embodiment, for briefly describe, device embodiment part do not refer to part, refer to foregoing Corresponding contents in embodiment of the method.It is apparent to those skilled in the art that, it is for convenience and simplicity of description, preceding The specific work process of system, device and the unit of description is stated, the corresponding process in above method embodiment is may be referred to, This is repeated no more.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singulative " one " used herein, " one It is individual ", " described " and "the" may also comprise plural form.It is to be further understood that what is used in the specification of the present invention arranges Diction " comprising " refer to there is the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member When part is "connected" to another element, it can be directly connected to other elements, or can also have intermediary element.In addition, " connection " used herein can include wireless connection or wireless coupling.Wording "and/or" used herein is including one or more Multiple associated wholes or any cell for listing item and all combination.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art Language and scientific terminology), with the general understanding identical meaning with the those of ordinary skill in art of the present invention.Should also Understand, those terms defined in such as general dictionary, it should be understood that with the context with prior art The consistent meaning of meaning, and unless by specific definitions as here, otherwise will not use idealization or excessively formal implication To explain.
Those skilled in the art of the present technique are appreciated that the present invention includes being related to for performing in operation described herein One or more of equipment.These equipment can be for needed for purpose and specially design and manufacture, or can also include general Known device in computer.These equipment have the computer program being stored in it, and these computer programs are optionally Activation is reconstructed.Such computer program can be stored in equipment (for example, computer) computer-readable recording medium or be stored in E-command and it is coupled to respectively in any kind of medium of bus suitable for storage, the computer-readable medium is included but not Be limited to any kind of disk (including floppy disk, hard disk, CD, CD-ROM and magneto-optic disk), ROM (Read-Only Memory, only Read memory), RAM (Random Access Memory, immediately memory), EPROM (Erasable Programmable Read-Only Memory, Erarable Programmable Read only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory, EEPROM), flash memory, magnetic card or light card Piece.It is, computer-readable recording medium includes storing or transmitting any Jie of information in the form of it can read by equipment (for example, computer) Matter.
Those skilled in the art of the present technique be appreciated that can be realized with computer program instructions these structure charts and/or The combination of each frame and these structure charts and/or the frame in block diagram and/or flow graph in block diagram and/or flow graph.This technology is led Field technique personnel be appreciated that these computer program instructions can be supplied to all-purpose computer, special purpose computer or other The processor of programmable data processing method is realized, so as to pass through the processing of computer or other programmable data processing methods The scheme that device is specified in the frame or multiple frames to perform structure chart disclosed by the invention and/or block diagram and/or flow graph.
Those skilled in the art of the present technique are appreciated that in the various operations discussed in the present invention, method, flow Step, measure, scheme can be replaced, changed, combined or deleted.Further, it is each with what is discussed in the present invention Kind operation, method, other steps in flow, measure, scheme can also be replaced, changed, reset, decomposed, combined or deleted. Further, it is of the prior art to have and the step in the various operations disclosed in the present invention, method, flow, measure, scheme It can also be replaced, changed, reset, decomposed, combined or deleted.
Described above is only some embodiments of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (10)

1. a kind of player method of multimedia file, it is characterised in that the multimedia file is by file header bag, media information Bag, media data packet is constituted successively, and the player method includes:
Parse the information field in the file header bag, and the information field in file header bag determines the multimedia file Format Type;
When the Format Type determined is predetermined multimedia encapsulation format type, the information word in the media information bag is parsed Section is with the parameter information for the Voice & Video for obtaining the multimedia file;
The video compression data bag and audio compression data bag for intersecting preservation in the media data packet are parsed, to get video Data and voice data;
According to the parameter information of the Voice & Video, and the video data and voice data got, carry out multimedia text Part is played.
2. player method according to claim 1, it is characterised in that the information field in the bag according to file header is determined The step of Format Type of the multimedia file, including:
Judge whether the character string corresponding with predetermined multimedia encapsulation format type of the information field in the file header bag matches;
If matching, it is determined that the Format Type of the multimedia file is predetermined multimedia encapsulation format type.
3. player method according to claim 1, it is characterised in that the parameter information of the Voice & Video includes following At least one of:Video encoder title, video height, video width, video frame rate, video bitrate, audio coder title, Audio sample rate, audio bit rate, multimedia file bit rate.
4. player method according to claim 1, it is characterised in that intersect in the parsing media data packet and preserve Video compression data bag and audio compression data bag, the step of to get video data and voice data, including:
The information field in the video compression data bag is read, byte number, the video time stamp of video compression data bag is obtained Table, length of the video time and specific video data;
The information field in the audio compression data bag is read, byte number, the audio time stamp of audio compression data bag is obtained Table, audio time length and specific voice data.
5. a kind of method for packing of multimedia file, it is characterised in that including:
Video data and voice data are packaged into the video compression data bag and audio compression data bag for intersecting and preserving, matchmaker is obtained Volume data bag;
According to the video data and voice data, the parameter information of Voice & Video is determined, and by the parameter of Voice & Video Information is write in the way of information field in media information bag;
File header bag, the media information bag and the media data packet of predetermined multimedia encapsulation format type will be identified by suitable Sequence is encapsulated, and obtains the multimedia file.
6. method for packing according to claim 5, it is characterised in that also include:
The corresponding character string of predetermined multimedia encapsulation format type is write in the way of information field in file header bag, for The Format Type for identifying the multimedia file is predetermined multimedia encapsulation format type.
7. a kind of playing device of multimedia file, it is characterised in that the multimedia file is by file header bag, media information Bag, media data packet is constituted successively, and the playing device includes:
Format Type determining module, for parsing the information field in the file header bag, and the information in file header bag Field determines the Format Type of the multimedia file;
Parameter information acquisition module, for when the Format Type determined is predetermined multimedia encapsulation format type, parsing institute The information field in media information bag is stated with the parameter information for the Voice & Video for obtaining the multimedia file;
Data acquisition module, the video compression data bag and audio compression number of preservation are intersected for parsing in the media data packet According to bag, to get video data and voice data;
Playing module, for the parameter information according to the Voice & Video, and the video data and voice data got, Carry out multimedia file broadcasting.
8. a kind of packaging system of multimedia file, it is characterised in that including:
Data package module, intersects the video compression data bag preserved and audio for video data and voice data to be packaged into Compressed data packets, obtain media data packet;
Parameter information package module, for according to the video data and voice data, determining the parameter information of Voice & Video, And write the parameter information of Voice & Video in media information bag in the way of information field;
Document encapsulation module, for will identify the file header bag of predetermined multimedia encapsulation format type, the media information bag and The media data packet is encapsulated in order, obtains the multimedia file.
9. packaging system according to claim 8, it is characterised in that also include:
Format Type package module, for by the corresponding character string of predetermined multimedia encapsulation format type in the way of information field Write in file header bag, for identifying the Format Type of the multimedia file for predetermined multimedia encapsulation format type.
10. a kind of terminal, including:Memory, processor and storage on a memory and the program that can run on a processor, its It is characterised by, the method any one of the claims 1-6 is realized during the computing device described program.
CN201710680593.4A 2017-08-10 2017-08-10 Multimedia file playing method, multimedia file packaging method, corresponding device and terminal Pending CN107302715A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710680593.4A CN107302715A (en) 2017-08-10 2017-08-10 Multimedia file playing method, multimedia file packaging method, corresponding device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710680593.4A CN107302715A (en) 2017-08-10 2017-08-10 Multimedia file playing method, multimedia file packaging method, corresponding device and terminal

Publications (1)

Publication Number Publication Date
CN107302715A true CN107302715A (en) 2017-10-27

Family

ID=60133554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710680593.4A Pending CN107302715A (en) 2017-08-10 2017-08-10 Multimedia file playing method, multimedia file packaging method, corresponding device and terminal

Country Status (1)

Country Link
CN (1) CN107302715A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110858919A (en) * 2018-08-24 2020-03-03 北京字节跳动网络技术有限公司 Data processing method and device in media file playing process and storage medium
CN112287127A (en) * 2019-07-23 2021-01-29 上海哔哩哔哩科技有限公司 Multimedia file storage and reading method
CN112823529A (en) * 2018-11-29 2021-05-18 深圳市欢太科技有限公司 Video decoding method, video decoding device, electronic equipment and computer readable storage medium
CN112969043A (en) * 2021-04-28 2021-06-15 北京优幕科技有限责任公司 Media file generation and playing method and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179735A (en) * 2006-11-08 2008-05-14 中兴通讯股份有限公司 Packaging method of multimedia broadcasting system media data flow
CN101656099A (en) * 2008-08-18 2010-02-24 安凯(广州)软件技术有限公司 Audio and video production and play method used for MP3 player
CN102917276A (en) * 2012-11-12 2013-02-06 武汉市烽视威科技有限公司 Audio and video interleaved packaging method applied to streaming media services
CN103002353A (en) * 2011-09-16 2013-03-27 杭州海康威视数字技术股份有限公司 Method and device for packaging multimedia documents
US20130138835A1 (en) * 2011-11-30 2013-05-30 Elwha LLC, a limited liability corporation of the State of Delaware Masking of deceptive indicia in a communication interaction
CN104575547A (en) * 2013-10-17 2015-04-29 深圳市云帆世纪科技有限公司 Multi-media file making method, as well as multi-media file playing method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179735A (en) * 2006-11-08 2008-05-14 中兴通讯股份有限公司 Packaging method of multimedia broadcasting system media data flow
CN101656099A (en) * 2008-08-18 2010-02-24 安凯(广州)软件技术有限公司 Audio and video production and play method used for MP3 player
CN103002353A (en) * 2011-09-16 2013-03-27 杭州海康威视数字技术股份有限公司 Method and device for packaging multimedia documents
US20130138835A1 (en) * 2011-11-30 2013-05-30 Elwha LLC, a limited liability corporation of the State of Delaware Masking of deceptive indicia in a communication interaction
CN102917276A (en) * 2012-11-12 2013-02-06 武汉市烽视威科技有限公司 Audio and video interleaved packaging method applied to streaming media services
CN104575547A (en) * 2013-10-17 2015-04-29 深圳市云帆世纪科技有限公司 Multi-media file making method, as well as multi-media file playing method and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110858919A (en) * 2018-08-24 2020-03-03 北京字节跳动网络技术有限公司 Data processing method and device in media file playing process and storage medium
CN112823529A (en) * 2018-11-29 2021-05-18 深圳市欢太科技有限公司 Video decoding method, video decoding device, electronic equipment and computer readable storage medium
CN112287127A (en) * 2019-07-23 2021-01-29 上海哔哩哔哩科技有限公司 Multimedia file storage and reading method
CN112287127B (en) * 2019-07-23 2022-10-14 上海哔哩哔哩科技有限公司 Multimedia file storage and reading method
CN112969043A (en) * 2021-04-28 2021-06-15 北京优幕科技有限责任公司 Media file generation and playing method and equipment
CN112969043B (en) * 2021-04-28 2021-08-24 北京优幕科技有限责任公司 Media file generation and playing method and equipment

Similar Documents

Publication Publication Date Title
CN107302715A (en) Multimedia file playing method, multimedia file packaging method, corresponding device and terminal
CN103905841B (en) The more player video broadcasting methods of multi-protocols and system of network bandwidth adaptive
US6108584A (en) Multichannel digital audio decoding method and apparatus
CA2462159A1 (en) Video and digital multimedia aggregator content coding and formatting
US10469914B2 (en) Apparatus and method for delivering and receiving multimedia data in hybrid network
EP2477189A1 (en) Method and apparatus for processing/transmitting bit-stream, and method and apparatus for receiving/processing bit-stream
US10978109B2 (en) Synchronously playing method and device of media file, and storage medium
US10446188B2 (en) Method and apparatus for low latency non-linear media editing using file-based inserts into finalized digital multimedia files
BRPI0412889B1 (en) conversion, combination and decoding methods, conversion and decoding apparatus, and computer readable media
US20080288263A1 (en) Method and Apparatus for Encoding/Decoding
EP2131590A1 (en) Method and apparatus for generating or cutting or changing a frame based bit stream format file including at least one header section, and a corresponding data structure
CN101828351A (en) Apparatus and method for storing and reading a file having a media data container and a metadata container
KR20110101104A (en) Apparatus and method for transmitting/receiving contents cosisting of a pluarlity of streams
CN105898211A (en) Multimedia information processing method and device
TWI258101B (en) Method of searching for sync word in MPEG compressed audio bitstream, and related decoder circuit and computer program storage medium
CN106375778B (en) Method for transmitting three-dimensional audio program code stream conforming to digital movie specification
CN112929686B (en) Method and device for playing back recorded video in real time on line
KR101051063B1 (en) Video recording and playback device, video recording method, video playback method and video recording playback method
CN113747063B (en) Video transmission method and device, electronic equipment and readable storage medium
KR102046903B1 (en) Apparatus and Method for MMT Payload Header Structure
Luck et al. An integrated approach to recovering deleted files from NAND flash data
CN106961626A (en) The method and apparatus that a kind of video metamessage auto-complete is arranged
CN104380718B (en) Reproduce the method and apparatus of video data
US20200236424A1 (en) Audio tuning presets selection
JP5421273B2 (en) Method and apparatus for encoding media content and metadata

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171027