CN105451073B - The transfer approach and device of MP4 video sources - Google Patents
The transfer approach and device of MP4 video sources Download PDFInfo
- Publication number
- CN105451073B CN105451073B CN201510782746.7A CN201510782746A CN105451073B CN 105451073 B CN105451073 B CN 105451073B CN 201510782746 A CN201510782746 A CN 201510782746A CN 105451073 B CN105451073 B CN 105451073B
- Authority
- CN
- China
- Prior art keywords
- atoms
- video sources
- mdat
- sample
- moov
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/4405—Processing 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 video stream decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/4408—Processing 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 video stream encryption, e.g. re-encrypting a decrypted video stream for redistribution in a home network
Abstract
The invention discloses a kind of transfer approach of MP4 video sources, including:The MP4 video sources in network transmission stream are obtained, and extract moov atoms and mdat atoms in the MP4 video sources respectively;The mdat atoms are split to obtain multiple from mdat atoms;By the moov atoms respectively with it is each it is described from mdat atoms be combined to obtain it is multiple combine pair, and the multiple combination is obtained into new MP4 video sources to combination;The new MP4 video sources are transmitted.The invention also discloses a kind of transmission devices of MP4 video sources.The present invention improves the transmission efficiency to MP4 video sources, so as to stablize effective transmission MP4 video sources.
Description
Technical field
The present invention relates to field of communication technology more particularly to a kind of transfer approach and device of MP4 video sources.
Background technology
As computer, digital media technology, audio frequency and video technology constantly improve, network audio-video transmission technology is increasingly
It is important.The rise of stream media technology, more and more users' selection obtain video and carry out broadcasting for Internet video Streaming Media from network
It puts.The broadcasting of Internet video Streaming Media is mainly based upon the broadcasting of MP4 Container Formats, by taking MP4 video sources as an example, MP4 video sources
Document encapsulation format defined based on QuickTime Container Formats, it is a kind of very open container, mainly by
Ftyp atoms, moov atoms, mdat atoms composition.Wherein, ftyp atoms as MP4 video source formats mark and include about
Some information of file, moov atoms contain the metadata data informations of media, and mdat atoms contain transmission MP4 files
Data, the composition of the data is made of different sample.
Currently, traditional MP4 video sources broadcasting is to play out the unified combination of these three atoms, i.e., in MP4 videos
Source file first parses ftyp atoms in playing, and then parses moov atoms, finally plays the sample in mdat atoms.And
In the transmit process of MP4 video source files, the size of file is unfixed transmission.If carrying out local broadcasting, due to file
It is stored under local path through downloading, therefore the metadata data informations for including in moov atoms will not be lost and miss one
The information of a little files.But if the broadcasting of MP4 video source files is the broadcasting of Internet video Streaming Media, since the moov of network is former
The metadata data informations for including in son are related with the transmission speed of download of network, and the size of data of transmission of network is not
It is fixed.Therefore, when unstable networks or network, which are downloaded, to break down, it will moov atoms are lost, therewith in mdat atoms
The media data of sample will also lose so that moov atoms and the information of mdat atoms differ in transmit process
It causes, causes mdat atoms that can not parse, playback error.The transmission efficiency to MP4 video sources is greatly reduced, if continuing net
The MP4 video sources of network play, and will occur interim card in broadcasting, cannot smoothness play out.
Invention content
The main purpose of the present invention is to provide a kind of transfer approach and device of MP4 video sources, it is intended to which raising regards MP4
The transmission efficiency of frequency source.
To achieve the above object, the present invention provides a kind of transfer approach of MP4 video sources, including:
The MP4 video sources in network transmission stream are obtained, and extract moov atoms and mdat in the MP4 video sources respectively
Atom;
The mdat atoms are split to obtain multiple from mdat atoms;
By the moov atoms respectively with it is each it is described from mdat atoms be combined to obtain it is multiple combine pair, and will be described
Multiple combinations obtain new MP4 video sources to combination;
The new MP4 video sources are transmitted.
Preferably, it is described the mdat atoms are split to obtain multiple include from mdat atoms:
Obtain the position of all I frames in the mdat atoms;
Using the different location of the I frames as split point, the mdat atoms are split to obtain multiple from mdat originals
Son.
Preferably, the mdat atoms include multiple sample, it is described by the moov atoms respectively with it is each it is described from
Mdat atoms are combined to obtain multiple combinations pair, and the multiple combination is obtained new MP4 video sources to combination and includes:
Obtain split after each from mdat atoms sample number;
On the basis of the position of first I frame in MP4 video sources, by the moov atoms and first I frame with
And the sample of corresponding number is combined between second I frame, is continued on the basis of the position of second I frame, by institute
The sample for stating corresponding number between moov atoms and second I frame and third I frames is combined, until completing institute
State the combination of moov atoms and all sample;
Crucial bit identification is set according to the coding/decoding information of first I frame, using as the MP4 video sources after recombination
Mark.
Preferably, the moov atoms and different sample are combined formula and are expressed as:
Wherein, moov indicates that a moov atom, k indicate that k-th of I frame, T are the number of sample between two I frames,
Sample (k) (t) indicates that the number of the corresponding T sample of k-th of I frame, t are the natural number for being incremented to T from 1, and X indicates to split
The number of the slave mdat atoms obtained afterwards;
X=M/N;
Wherein, M indicates that the sum of the sample in MP4 video sources, N indicate the sum of I frames in MP4 video sources.
Preferably, described be transmitted the new MP4 video sources includes before:
The transmission of MP4 video sources after recombination is dimensioned to the maximum transmission unit size of communication interface.
In addition, to achieve the above object, the present invention also provides a kind of transmission devices of MP4 video sources, including:
Information extraction modules for obtaining the MP4 video sources in network transmission stream, and extract the MP4 video sources respectively
In moov atoms and mdat atoms;
Module is split, it is multiple from mdat atoms for being split to obtain the mdat atoms;
Recombination module, for the moov atoms described to be combined from mdat atoms to obtain multiple groups with each respectively
Conjunction pair, and the multiple combination is obtained into new MP4 video sources to combination;
Delivery module, for the new MP4 video sources to be transmitted.
Preferably, the fractionation module includes:
Position acquisition unit, the position for obtaining all I frames in the mdat atoms;
Split cells, for using the different location of the I frames as split point, being split to obtain to the mdat atoms
It is multiple from mdat atoms.
Preferably, the mdat atoms include multiple sample, and the recombination module includes:
Number acquiring unit, for obtains fractionation after each from mdat atoms sample number;
Assembled unit is used on the basis of the position of first I frame in MP4 video sources, by the moov atoms and institute
The sample for stating corresponding number between first I frame and second I frame is combined, and is continued with the position of second I frame
It is set to benchmark, the sample of corresponding number between the moov atoms and second I frame and third I frames is subjected to group
It closes, until completing the combination of the moov atoms and all sample;
Setting unit is identified, for crucial bit identification to be arranged according to the coding/decoding information of first I frame, using as weight
The mark of MP4 video sources after group.
Preferably, the moov atoms and different sample are combined formula and are expressed as:
Wherein, moov indicates that a moov atom, k indicate that k-th of I frame, T are the number of sample between two I frames,
Sample (k) (t) indicates that the number of the corresponding T sample of k-th of I frame, t are the natural number for being incremented to T from 1, and X indicates to split
The number of the slave mdat atoms obtained afterwards;
X=M/N;
Wherein, M indicates that the sum of the sample in MP4 video sources, N indicate the sum of I frames in MP4 video sources.
Preferably, the transmission device of the MP4 video sources further includes:
Setup module, the maximum transmitted list for the transmission of the MP4 video sources after recombination to be dimensioned to communication interface
First size.
The embodiment of the present invention by analyzing MP4 video source formats, extract moov atoms in MP4 video sources and
The atom informations such as mdat atoms, and mdat atoms are split to obtain multiple from mdat atoms.Then moov atoms are distinguished
It is combined from mdat atoms with each, the new MP4 video sources after being recombinated, then new MP4 video sources is transmitted.It is right
Atomic structure in MP4 video sources, which is reconstructed, to be solved when unstable networks lose the moov atomic time, includes in mdat atoms
Information will also lose, cause the atom information of moov atoms and mdat inconsistent and the problem of mdat atoms can not parse.
The transmission efficiency to MP4 video sources is improved, so as to stablize effective transmission MP4 video sources.
Description of the drawings
Fig. 1 is the flow diagram of the transfer approach first embodiment of MP4 video sources of the present invention;
Fig. 2 is the structure of traditional MP4 video sources;
Fig. 3 is the structure of the MP4 video sources after present invention recombination;
Fig. 4 is to be split to obtain by mdat atoms multiple from mdat atoms in the transfer approach of MP4 video sources of the present invention
Refinement flow diagram;
Fig. 5 be MP4 video sources of the present invention transfer approach in, by the moov atoms respectively with it is each from mdat atoms into
Row combination obtains multiple combinations pair, and multiple combinations are obtained the refinement flow diagram of new MP4 video sources to combination;
Fig. 6 is the structure of the MP4 video sources after being reconstructed again after the present invention splits mdat atoms;
Fig. 7 is the flow diagram of the transfer approach second embodiment of MP4 video sources of the present invention;
Fig. 8 is the high-level schematic functional block diagram of the transmission device first embodiment of MP4 video sources of the present invention;
Fig. 9 be MP4 video sources of the present invention transmission device in fractionation module refinement high-level schematic functional block diagram;
Figure 10 be MP4 video sources of the present invention transmission device in recombination module refinement high-level schematic functional block diagram;
Figure 11 is the high-level schematic functional block diagram of the transmission device second embodiment of MP4 video sources of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific implementation mode
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
As shown in Figure 1, showing a kind of transfer approach first embodiment of MP4 video sources of the present invention.The MP4 of the embodiment
The transfer approach of video source includes:
Step S10, the MP4 video sources in network transmission stream are obtained, and extract the originals of the moov in the MP4 video sources respectively
Son and mdat atoms;
In the present embodiment, MP4 video sources are mainly made of ftyp atoms, moov atoms, mdat atoms etc..Traditional MP4
The structure of video source is as shown in Figure 2.Wherein, mark of the ftyp atoms as MP4 video source formats is contained about MP4 videos
The fileinfo in source;Moov atoms contain the metadata media informations of MP4 video sources;Mdat atoms contain transmission MP4
The file data of video source, this document data are made of different sample, and sample indicates that file stores base unit.
In the transmission of MP4 video sources, the fileinfo of MP4 video sources is obtained first from network transmission stream, it is then right
The moov atoms in MP4 video sources are extracted in the extraction and analysis of the progress atom of the MP4 video sources obtained from network respectively
And the atom informations such as mdat atoms.
Step S20, the mdat atoms are split to obtain multiple from mdat atoms;
In the present embodiment, the mdat atoms that said extracted obtains are split to obtain it is multiple from mdat atoms, due to this
Mdat atoms include sample, and therefore, after being split to mdat atoms, what is obtained each can be included from mdat atoms
Different or same number sample, for follow-up moov atoms with split after each included from mdat atoms
Sample is combined.
Step S30, by the moov atoms respectively with it is each it is described from mdat atoms be combined to obtain it is multiple combine pair,
And the multiple combination is obtained into new MP4 video sources to combination;
The moov atoms obtained according to said extracted, and after being split to mdat atoms it is multiple from
Mdat atoms, putting in order before being split according to mdat atoms, by moov atoms successively with each of obtained after fractionation from mdat
Atom is combined to obtain multiple combinations pair, and then multiple combinations are to recombinating in order as new MP4 video sources.After obtaining recombination
New MP4 video sources structure it is as shown in Figure 3, wherein header is header file, the crucial position as MP4 video sources after recombination
Mark.
Step S40, the new MP4 video sources are transmitted.
After above-mentioned reconstruct obtains new MP4 video sources, the new MP4 video sources after the recombination are carried out to the transmission of Internet video.
By being parsed to the MP4 video sources in netcast, the atom information of MP4 video sources, such phase in reconstructed network transmission
Than in traditional netcast MP4 video sources, improving the fault-tolerance in network transmission, MP4 video sources are not in network transmission
It can fail effectively to carry out the transmission of MP4 streams due to the sample being lost in moov atoms, and loss mdat atoms.Make
It obtains in the transmit process for carrying out video, occurs to stablize unstable or network speed of download reduces even if network effective
Transmit the source file video of MP4.
The embodiment of the present invention by analyzing MP4 video source formats, extract moov atoms in MP4 video sources and
The atom informations such as mdat atoms, and mdat atoms are split to obtain multiple from mdat atoms.Then moov atoms are distinguished
With after fractionation it is each from mdat atoms be combined to obtain it is multiple combine pair, by multiple combinations to being combined to obtain new MP4
Video source, then new MP4 video sources are transmitted.Atomic structure in MP4 video sources is reconstructed solve when network not
Stablize and lose the moov atomic time, the information for including in mdat atoms will also lose, and the atom of moov atoms and mdat is caused to be believed
Cease the problem of inconsistent and mdat atoms can not parse.The transmission efficiency to MP4 video sources is improved, it is effective so as to stablize
Transmission MP4 video sources.
Further, as shown in figure 4, being based on above-described embodiment, in the present embodiment, above-mentioned steps S20 may include:
Step S21, the position of all I frames in the mdat atoms is obtained;
Step S22, using the different location of the I frames as split point, the mdat atoms are split to obtain multiple
From mdat atoms.
MP4 video sources are played when to solve current unstable networks can lose asking for the sample for including in mdat atoms
It inscribes, in the present embodiment, the structure of the MP4 video sources in transmission of network is adjusted.Pass through the format progress to MP4 video sources
Analysis, since the key frame I frames of MP4 video sources are stored in mdat atoms, and I frames do not depend on other frames, are decoded benchmark
Therefore frame can split mdat atoms using the I frames as split point.
The location information of all I frames in mdat atoms is obtained first with key frame of video selection algorithm, and obtains I frames
Total number, the total number of I frames is calculated as to sample number that be N number of, and obtaining MP4 video sources, is counted as M.According to obtaining I
The different location of frame is split to obtain multiple from mdat atoms as split point to mdat atoms.Then first I frame is extracted
Coding/decoding information, which may include the audio and Video parameter information of MP4 video sources.Again by coding/decoding information weight
Combination nova becomes crucial bit identification, i.e. header header files, can set header header files to 0x88, header header files are big
Small is 4byte, it is to be understood that crucial bit identification and its size can be arranged as the case may be and flexibly, not limit this
Invention.
Further, as shown in figure 5, being based on above-described embodiment, in the present embodiment, above-mentioned steps S30 may include:
Step S31, obtain split after each from mdat atoms sample number;
Step S32, on the basis of the position of first I frame in MP4 video sources, by the moov atoms and described first
The sample of corresponding number is combined between a I frames and second I frame, is continued using the position of second I frame as base
The sample of corresponding number between the moov atoms and second I frame and third I frames is combined, directly by standard
To the combination for completing the moov atoms and all sample;
Step S33, crucial bit identification is arranged according to the coding/decoding information of first I frame, using as the MP4 after recombination
The mark of video source.
For fractionation mdat atoms on the basis of the above-mentioned different location according to I frames, and according in obtained MP4 video sources
Sample sum M and I frames total N, the number X of the mdat atoms split into, i.e. X=M/N is calculated.According to
Two interval I frames between location informations obtain split after each from mdat atoms sample number, if for example, first
I framing bits are set to 1, and second I framing bit is set to 6, then the number of first sample included in the mdat atoms is after splitting
6.Then according to the sequence of sample in mdat atoms before fractionation, by moov atoms respectively successively with after fractionation each from mdat originals
The sample of corresponding number is combined in son.It specifically, will on the basis of the position of first I frame in MP4 video sources
The sample of corresponding number is combined between moov atoms and first I frame and second I frame, is continued with second I frame
Position on the basis of, the sample of corresponding number between moov atoms and second I frame and third I frames is combined,
Until completing the combination of moov atoms and all sample.For example, it is assumed that first I framing bit in MP4 video sources is set to 1,
Two I framing bits are set to 6, then the number of the sample between first I frame and second I frame is 6, is set to first I framing bit
Moov atoms and continuous 6 sample are combined by benchmark.If third I framing bits are set to 10, second I frame and
The number of sample between three I frames is 5, on the basis of second I frame position, by moov atoms and 5 continuous
Sample is combined.And so on, until completing the combination of the sample and moov atoms after splitting in all mdat atoms.
Since mdat atoms are made of multiple sample, according to the location information of I frames, by the moov atoms of acquisition with tear open
Each sample for being included from mdat atoms after being divided into is combined, and the expression of the combination can be:
The formula indicates that moov atoms and different sample are combined, wherein moov indicates moov atoms, and k is kth
A I frames, T are the number of sample between two I frames, and sample (k) (t) indicates the number of the corresponding T sample of k-th of I frame
Moov atoms are combined with the sample of corresponding number by mesh successively, t is the natural number for being incremented to T from 1.X indicates to split
The number of the slave mdat atoms obtained afterwards can be calculated according to above-mentioned formula X=M/N, wherein M is indicated in MP4 video sources
The sum of sample, N indicate the sum of I frames in MP4 video sources.
It can to sum up obtain:
Mdat atoms after recombination in MP4 video sources are:
Then it according to the coding/decoding information of first I frame, reconfigures and is regarded as the MP4 after recombination as crucial bit identification
The mark of frequency source recombinates above-mentioned header header files from obtained moov atoms and the combination of different sample,
The size of header header files may be configured as 4bytes.The MP4 being illustrated in figure 6 after being reconstructed again after being split to mdat atoms
The structure of video source, wherein header indicates that the crucial bit identification of MP4 video sources after recombination, chunk are the son in mdat atoms
Atom information, the sub- atoms of chunk are made of multiple sample, and chunk-1 indicates first sub- atom of chunk, and so on,
Chunk-n indicates the sub- atoms of n-th of chunk;Sam (1) indicates first sample, and so on, sam (n) is indicated n-th
Sample, mdat (1) indicate that moov atoms are carried out with sample included in first obtained the mdat atoms after fractionation
It combines and obtains, and so on, mdat (k) indicates that moov atoms are wrapped with k-th obtained after splitting from mdat atoms
The sample contained, which is combined, to be obtained.
Further, as shown in fig. 7, being based on above-described embodiment, it is proposed that the of the transfer approach of MP4 video sources of the present invention
Two embodiments may include before above-mentioned steps S40 in the embodiment:
Step S50, maximum transmission unit that the transmission of MP4 video sources after recombination is dimensioned to communication interface is big
It is small.
In order to solve in the transmit process of traditional MP4 video sources, the file transmission size of MP4 video sources is to be not fixed
Transmission, when unstable networks or network, which are downloaded, to break down, it will data information is lost, so that being led in transmit process
Atom information in cause MP4 video sources can not parse and playback error obtains problem.In the present embodiment, by the MP4 videos after recombination
The transmission in source is dimensioned to the size of maximum transmission unit related with communication interface, and the size of the maximum transmission unit can be set
It is set to 1MTU (Maximum Transmission Unit).It not only can prevent the dry of in transmission process communication interface
It disturbs, and solves Internet video MP4 video sources and the phenomenon that packet loss occur, improve the fault-tolerant of the media file of MP4 video sources
Property, it is more advantageous to the broadcasting for carrying out Internet video.
Accordingly, as shown in figure 8, proposing a kind of transmission device first embodiment of MP4 video sources of the present invention.The embodiment
The transmission devices of MP4 video sources include:
Information extraction modules 100 for obtaining the MP4 video sources in network transmission stream, and extract the MP4 videos respectively
Moov atoms in source and mdat atoms;
In the present embodiment, MP4 video sources are mainly made of ftyp atoms, moov atoms, mdat atoms etc..Traditional MP4
The structure of video source is as shown in Figure 2.Wherein, mark of the ftyp atoms as MP4 video source formats is contained about MP4 videos
The fileinfo in source;Moov atoms contain the metadata media informations of MP4 video sources;Mdat atoms contain transmission MP4
The file data of video source, this document data are made of different sample, and sample indicates that file stores base unit.
In the transmission of MP4 video sources, information extraction modules 100 obtain MP4 video sources from network transmission stream first
Fileinfo, then extraction and analysis of the information extraction modules 100 to the progress atom of the MP4 video sources obtained from network,
The atom informations such as moov atoms and the mdat atoms in MP4 video sources are extracted respectively.
Module 200 is split, it is multiple from mdat atoms for being split to obtain the mdat atoms;
It is when being played to solve MP4 video sources, these three atoms such as ftyp atoms, moov atoms and mdat atoms are unified
Combination play out, i.e., MP4 video sources broadcasting in first parse ftyp atoms, then parse moov atoms, finally play
When data information in mdat atoms, when network is there are unstable, then the data in moov atoms and mdat atoms will be lost
Information, cause to which the information of moov atoms and mdat atoms is inconsistent mdat atoms can not parse and the problem of playback error.
In the present embodiment, by fractionation module 200 to the mdat atoms that said extracted obtains split to obtain it is multiple from
Mdat atoms, since the mdat atoms include sample, after being split to mdat atoms, obtain it is each from
Mdat atoms can obtain the sample comprising different or same number, for follow-up moov atoms with split after it is each from
The sample that mdat atoms are included is combined.
Recombination module 300, for by the moov atoms respectively with it is each it is described from mdat atoms be combined to obtain it is more
A combination pair, and the multiple combination is obtained into new MP4 video sources to combination;
The moov atoms obtained according to said extracted, and after being split to mdat atoms it is multiple from
Mdat atoms, according to mdat atoms split before putting in order, by recombination module 300 by moov atoms successively with after each fractionation
It each of obtains being combined to obtain multiple combinations pair from mdat atoms, then multiple combinations are to recombinating in order as new MP4
Video source.The structure of new MP4 video sources after being recombinated is as shown in Figure 3, wherein header is header file, after recombination
The crucial bit identification of MP4 video sources.
Delivery module 400, for the new MP4 video sources to be transmitted.
After above-mentioned reconstruct obtains new MP4 video sources, the new MP4 video sources after the recombination are carried out network by delivery module 400
The transmission of video.By being parsed to the MP4 video sources in netcast, the atom of MP4 video sources in reconstructed network transmission
Information improves the fault-tolerance in network transmission, in network transmission in this way compared to traditional netcast MP4 video sources
MP4 video sources will not fail effectively to carry out MP4 due to the sample being lost in moov atoms, and loss mdat atoms
The transmission of stream.So that in the transmit process for carrying out video, unstable or network speed of download occur even if network reduces
The source file video of effective transmission MP4 can be stablized.
The embodiment of the present invention by analyzing MP4 video source formats, extract moov atoms in MP4 video sources and
The atom informations such as mdat atoms, and mdat atoms are split to obtain multiple from mdat atoms.Then moov atoms are distinguished
With after fractionation it is each from mdat atoms be combined to obtain it is multiple combine pair, by multiple combinations to being combined to obtain new MP4
Video source, then new MP4 video sources are transmitted.Atomic structure in MP4 video sources is reconstructed solve when network not
Stablize and lose the moov atomic time, the information for including in mdat atoms will also lose, and the atom of moov atoms and mdat is caused to be believed
Cease the problem of inconsistent and mdat atoms can not parse.The transmission efficiency to MP4 video sources is improved, it is effective so as to stablize
Transmission MP4 video sources.
Further, as shown in figure 9, being based on above-described embodiment, in the present embodiment, above-mentioned fractionation module 200 may include:
Position acquisition unit 210, the position for obtaining all I frames in the mdat atoms;
Split cells 220, for using the different location of the I frames as split point, being split to the mdat atoms
It obtains multiple from mdat atoms.
MP4 video sources are played when to solve current unstable networks can lose asking for the sample for including in mdat atoms
It inscribes, in the present embodiment, the structure of the MP4 video sources in transmission of network is adjusted.Pass through the format progress to MP4 video sources
Analysis, since the key frame I frames of MP4 video sources are stored in mdat atoms, and I frames do not depend on other frames, are decoded benchmark
Therefore frame can split mdat atoms using the I frames as split point.
Obtain the position of all I frames in mdat atoms using key frame of video selection algorithm by position acquisition unit 210 first
Confidence ceases, and obtains the total number of I frames, and the total number of I frames is calculated as to sample number that be N number of, and obtaining MP4 video sources,
It is counted as M.Split cells 220, as split point, is split to obtain more according to the different location for obtaining I frames to mdat atoms
It is a from mdat atoms.Then the coding/decoding information of first I frame is extracted, which may include the audio of MP4 video sources
And Video parameter information.Coding/decoding information is reconfigured as crucial bit identification, i.e. header header files again, it can be by header
Header file is set as 0x88, and header header file sizes are 4byte, it is to be understood that crucial bit identification and its size can roots
Flexibly it is arranged according to concrete condition, does not limit the present invention.
Further, as shown in Figure 10, it is based on above-described embodiment, in the present embodiment, above-mentioned recombination module 300 may include:
Number acquiring unit 310, for obtains fractionation after each from mdat atoms sample number;
Assembled unit 320, on the basis of the position of first I frame in MP4 video sources, by the moov atoms with
The sample of corresponding number is combined between first I frame and second I frame, is continued with second I frame
On the basis of position, the sample of corresponding number between the moov atoms and second I frame and third I frames is carried out
Combination, until completing the combination of the moov atoms and all sample;
Setting unit 330 is identified, for crucial bit identification to be arranged according to the coding/decoding information of first I frame, to make
For the mark of the MP4 video sources after recombination.
For fractionation mdat atoms on the basis of the above-mentioned different location according to I frames, and according in obtained MP4 video sources
Sample sum M and I frames total N, the number X of the mdat atoms split into, i.e. X=M/N is calculated.Number
Acquiring unit 310 according to two interval I frames between location information obtain split after each from mdat atoms sample
Number, if for example, first I framing bit is set to 1, second I framing bit is set to 6, then split after first included in mdat atoms
Sample number be 6.Then assembled unit 320 is according to the sequence of sample in mdat atoms before fractionation, by moov atoms
Respectively successively with each the sample of corresponding number is combined from mdat atoms after fractionation.Specifically, assembled unit 320 with
It, will be corresponding between moov atoms and first I frame and second I frame on the basis of the position of first I frame in MP4 video sources
The sample of number is combined, and is continued on the basis of the position of second I frame, by moov atoms and second I frame with
And the sample of corresponding number is combined between third I frames, until completing the combination of moov atoms and all sample.Example
Such as, it is assumed that first I framing bit in MP4 video sources is set to 1, and second I framing bit is set to 6, then first I frame and second I frame
Between sample number be 6, on the basis of first I frame position, moov atoms and continuous 6 sample are subjected to group
It closes.If third I framing bits are set to 10, the number of the sample between second I frame and third I frames is 5, with second I
On the basis of frame position, moov atoms and continuous 5 sample are combined.And so on, until completing to own after splitting
The combination of sample and moov atoms in mdat atoms.
Since mdat atoms are made of multiple sample, according to the location information of I frames, by the moov atoms of acquisition with tear open
Each sample for being included from mdat atoms after being divided into is combined, and the expression of the combination can be:
The formula indicates that moov atoms and different sample are combined, wherein moov indicates moov atoms, and k is kth
A I frames, T are the number of sample between two I frames, and sample (k) (t) indicates the number of the corresponding T sample of k-th of I frame
Moov atoms are combined with the sample of corresponding number by mesh successively, t is the natural number for being incremented to T from 1.X indicates to split
The number of the slave mdat atoms obtained afterwards can be calculated according to above-mentioned formula X=M/N, wherein M is indicated in MP4 video sources
The sum of sample, N indicate the sum of I frames in MP4 video sources.
It can to sum up obtain:
Mdat atoms after recombination in MP4 video sources are:
Then it by mark setting unit 330 according to the coding/decoding information of first I frame, reconfigures as crucial bit identification
As the mark of the MP4 video sources after recombination, i.e., by above-mentioned header header files and obtained moov atoms with it is different
The combination of sample is recombinated, and the size of header header files may be configured as 4bytes.It is illustrated in figure 6 and mdat atoms is torn open
The structure of MP4 video sources after being reconstructed again after point, wherein header indicates the crucial bit identification of MP4 video sources after recombination,
Chunk is the sub- atom information in mdat atoms, and the sub- atoms of chunk are made of multiple sample, and chunk-1 indicates first
The sub- atoms of chunk, and so on, chunk-n indicates the sub- atoms of n-th of chunk;Sam (1) indicates first sample, according to this
Analogize, sam (n) indicates that n-th of sample, mdat (1) indicate moov atoms and first obtained the mdat atoms after fractionation
Included in sample be combined and obtain, and so on, mdat (k) indicate moov atoms and split after the obtained
The k sample included in the mdat atoms, which is combined, to be obtained.
Further, as shown in figure 11, it is based on above-described embodiment, it is proposed that the transmission device of MP4 video sources of the present invention
Second embodiment, the transmission device of above-mentioned MP4 video sources further includes in the embodiment:
Setup module 500, the maximum transmitted for the transmission of the MP4 video sources after recombination to be dimensioned to communication interface
Cell size.
In order to solve in the transmit process of traditional MP4 video sources, the file transmission size of MP4 video sources is to be not fixed
Transmission, when unstable networks or network, which are downloaded, to break down, it will data information is lost, so that being led in transmit process
Atom information in cause MP4 video sources can not parse and playback error obtains problem.In the present embodiment, setup module 500 will recombinate
The transmission of MP4 video sources afterwards is dimensioned to the size of maximum transmission unit related with communication interface, the maximum transmitted list
The size of member may be configured as 1MTU (Maximum Transmission Unit).It not only can prevent in transmission process
The interference of communication interface, and solve Internet video MP4 video sources and the phenomenon that packet loss occur, improve the matchmaker of MP4 video sources
The fault-tolerance of body file is more advantageous to the broadcasting for carrying out Internet video.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (8)
1. a kind of transfer approach of MP4 video sources, which is characterized in that the transfer approach of the MP4 video sources includes the following steps:
The MP4 video sources in network transmission stream are obtained, and extract the moov atoms in the MP4 video sources and mdat originals respectively
Son;
The mdat atoms are split to obtain multiple from mdat atoms;
By the moov atoms respectively with it is each it is described from mdat atoms be combined to obtain it is multiple combine pair, and will be the multiple
Combination obtains new MP4 video sources to combination;Wherein, the mdat atoms include multiple sample, described by the moov atoms
Respectively with it is each it is described from mdat atoms be combined to obtain it is multiple combine pair, and the multiple combination obtains combination new
MP4 video sources include:Obtain split after each from mdat atoms sample number;With first I frame in MP4 video sources
Position on the basis of, by the sample of corresponding number between the moov atoms and first I frame and second I frame into
Row combination, continues on the basis of the position of second I frame, by the moov atoms and second I frame and third
The sample of corresponding number is combined between a I frames, until completing the combination of the moov atoms and all sample;According to
The crucial bit identification of coding/decoding information setting of first I frame, using the mark as the new MP4 video sources;
The new MP4 video sources are transmitted.
2. the transfer approach of MP4 video sources as described in claim 1, which is characterized in that described to carry out the mdat atoms
Fractionation obtains:
Obtain the position of all I frames in the mdat atoms;
Using the different location of the I frames as split point, the mdat atoms are split to obtain multiple from mdat atoms.
3. the transfer approach of MP4 video sources as described in claim 1, which is characterized in that moov atoms and different
Sample is combined formula and is expressed as:
Wherein, moov indicates that a moov atom, k indicate that k-th of I frame, T are the number of sample between two I frames, sample
(k) (t) indicates that the number of the corresponding T sample of k-th of I frame, t are the natural number for being incremented to T from 1, and X indicates to obtain after splitting
Slave mdat atoms number;
X=M/N;
Wherein, M indicates that the sum of the sample in MP4 video sources, N indicate the sum of I frames in MP4 video sources.
4. the transfer approach of MP4 video sources as described in claim 1, which is characterized in that it is described by the new MP4 video sources into
Include before row transmission:
The transmission of the new MP4 video sources is dimensioned to the maximum transmission unit size of communication interface.
5. a kind of transmission device of MP4 video sources, which is characterized in that the transmission device of the MP4 video sources includes:
Information extraction modules for obtaining the MP4 video sources in network transmission stream, and are extracted in the MP4 video sources respectively
Moov atoms and mdat atoms;
Module is split, it is multiple from mdat atoms for being split to obtain the mdat atoms;
Recombination module, for the moov atoms described to be combined from mdat atoms to obtain multiple combinations with each respectively
It is right, and the multiple combination is obtained into new MP4 video sources to combination;Wherein, the mdat atoms include multiple sample, described
Recombination module includes:Number acquiring unit, for obtains fractionation after each from mdat atoms sample number;Combination is single
Member, on the basis of the position of first I frame in MP4 video sources, by the moov atoms and first I frame and
The sample of corresponding number is combined between second I frame, is continued on the basis of the position of second I frame, will be described
The sample of corresponding number is combined between moov atoms and second I frame and third I frames, until described in completing
The combination of moov atoms and all sample;
Setting unit is identified, for crucial bit identification to be arranged according to the coding/decoding information of first I frame, using as after recombination
MP4 video sources mark;
Delivery module, for the new MP4 video sources to be transmitted.
6. the transmission device of MP4 video sources as claimed in claim 5, which is characterized in that the fractionation module includes:
Position acquisition unit, the position for obtaining all I frames in the mdat atoms;
Split cells, for using the different location of the I frames as split point, being split to obtain to the mdat atoms multiple
From mdat atoms.
7. the transmission device of MP4 video sources as claimed in claim 5, which is characterized in that moov atoms and different
Sample is combined formula and is expressed as:
Wherein, moov indicates that a moov atom, k indicate that k-th of I frame, T are the number of sample between two I frames, sample
(k) (t) indicates that the number of the corresponding T sample of k-th of I frame, t are the natural number for being incremented to T from 1, and X indicates to obtain after splitting
Slave mdat atoms number;
X=M/N;
Wherein, M indicates that the sum of the sample in MP4 video sources, N indicate the sum of I frames in MP4 video sources.
8. the transmission device of MP4 video sources as claimed in claim 5, which is characterized in that the transmission device of the MP4 video sources
Further include:
Setup module, the maximum transmission unit for the transmission of the MP4 video sources after recombination to be dimensioned to communication interface are big
It is small.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510782746.7A CN105451073B (en) | 2015-11-16 | 2015-11-16 | The transfer approach and device of MP4 video sources |
PCT/CN2016/084811 WO2017084310A1 (en) | 2015-11-16 | 2016-06-03 | Method and device for transmitting mp4 video source |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510782746.7A CN105451073B (en) | 2015-11-16 | 2015-11-16 | The transfer approach and device of MP4 video sources |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105451073A CN105451073A (en) | 2016-03-30 |
CN105451073B true CN105451073B (en) | 2018-11-02 |
Family
ID=55560788
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510782746.7A Active CN105451073B (en) | 2015-11-16 | 2015-11-16 | The transfer approach and device of MP4 video sources |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105451073B (en) |
WO (1) | WO2017084310A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105451073B (en) * | 2015-11-16 | 2018-11-02 | 深圳Tcl数字技术有限公司 | The transfer approach and device of MP4 video sources |
CN109936715B (en) * | 2017-12-19 | 2021-09-03 | 华为技术有限公司 | MP4 file processing method and related equipment thereof |
CN110740391B (en) * | 2019-10-31 | 2021-10-26 | 四川效率源信息安全技术股份有限公司 | Method for repairing MP4 damaged file |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1515115A (en) * | 2002-06-26 | 2004-07-21 | 松下电器产业株式会社 | Multiplexing device and demultiplexing device |
WO2006079368A1 (en) * | 2005-01-25 | 2006-08-03 | Nero Ag | Method for preparing dvd-video formatted data, method for reconstructing dvd-video data and dvd-video data structure |
CN101427571A (en) * | 2002-12-04 | 2009-05-06 | 国际商业机器公司 | Efficient means for creating mpeg-4 textual representation from mpeg-4 intermedia format |
CN102123281A (en) * | 2011-01-07 | 2011-07-13 | 中兴通讯股份有限公司 | Fast forward and fast backward treatment method and device during video playing and mobile terminal |
CN103069812A (en) * | 2010-06-09 | 2013-04-24 | 三星电子株式会社 | Method for providing fragment-based multimedia streaming service and device for same, and method for receiving fragment-based multimedia streaming service and device for same |
CN103262556A (en) * | 2010-11-02 | 2013-08-21 | Lg电子株式会社 | Method for transreceiving media content and device for transreceiving using same |
WO2015107784A1 (en) * | 2014-01-17 | 2015-07-23 | ソニー株式会社 | Communication apparatus, communication data generation method, and communication data processing method |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4380533B2 (en) * | 2004-12-24 | 2009-12-09 | キヤノン株式会社 | Multimedia data processing apparatus and method |
KR101295377B1 (en) * | 2007-03-07 | 2013-08-08 | 엘지전자 주식회사 | Method for constructing of file format and apparatus and method for processing broadcast signal with file which has file format |
KR20100078700A (en) * | 2008-12-30 | 2010-07-08 | 삼성전자주식회사 | Terminal and method for transmitting file |
US9674027B2 (en) * | 2010-04-19 | 2017-06-06 | Lg Electronics Inc. | Method for transmitting/receiving internet-based content and transmitter/receiver using same |
KR101316579B1 (en) * | 2012-01-17 | 2013-10-18 | (주)피타소프트 | Mp4 file configuring device and restoring device, mp4 file configuring method and restoring method |
CN105451073B (en) * | 2015-11-16 | 2018-11-02 | 深圳Tcl数字技术有限公司 | The transfer approach and device of MP4 video sources |
-
2015
- 2015-11-16 CN CN201510782746.7A patent/CN105451073B/en active Active
-
2016
- 2016-06-03 WO PCT/CN2016/084811 patent/WO2017084310A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1515115A (en) * | 2002-06-26 | 2004-07-21 | 松下电器产业株式会社 | Multiplexing device and demultiplexing device |
CN101427571A (en) * | 2002-12-04 | 2009-05-06 | 国际商业机器公司 | Efficient means for creating mpeg-4 textual representation from mpeg-4 intermedia format |
WO2006079368A1 (en) * | 2005-01-25 | 2006-08-03 | Nero Ag | Method for preparing dvd-video formatted data, method for reconstructing dvd-video data and dvd-video data structure |
CN103069812A (en) * | 2010-06-09 | 2013-04-24 | 三星电子株式会社 | Method for providing fragment-based multimedia streaming service and device for same, and method for receiving fragment-based multimedia streaming service and device for same |
CN103262556A (en) * | 2010-11-02 | 2013-08-21 | Lg电子株式会社 | Method for transreceiving media content and device for transreceiving using same |
CN102123281A (en) * | 2011-01-07 | 2011-07-13 | 中兴通讯股份有限公司 | Fast forward and fast backward treatment method and device during video playing and mobile terminal |
WO2015107784A1 (en) * | 2014-01-17 | 2015-07-23 | ソニー株式会社 | Communication apparatus, communication data generation method, and communication data processing method |
Also Published As
Publication number | Publication date |
---|---|
WO2017084310A1 (en) | 2017-05-26 |
CN105451073A (en) | 2016-03-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11178436B2 (en) | Broadcast signal transmission device, broadcast signal reception device, broadcast signal transmission method, and broadcast signal reception method | |
CN104885473B (en) | Live timing method for the dynamic self-adapting stream transmission (DASH) via HTTP | |
Ameigeiras et al. | Analysis and modelling of YouTube traffic | |
CN106134146B (en) | Handle continuous multicycle content | |
CN104025548B (en) | For the method and apparatus for the flexible caching for being delivered media | |
CN107210828A (en) | Broadcast singal dispensing device, broadcast receiver, broadcast singal sending method and broadcast signal received method | |
CN105191248B (en) | Method and apparatus for sending data and receiving data | |
CN106031181A (en) | Broadcast signal transmitting apparatus, broadcast signal receiving apparatus, broadcast signal transmitting method and broadcast signal receiving method | |
CN106105150A (en) | For sending the equipment of broadcast singal, for receiving the equipment of broadcast singal, the method sending broadcast singal and the method receiving broadcast singal | |
US20110307545A1 (en) | Apparatus and Methods for Describing and Timing Representatives in Streaming Media Files | |
CN105828096B (en) | Method and device for processing media stream file | |
CN105409235B (en) | File creating apparatus and method and content reproduction apparatus and method | |
CN105681827B (en) | Poster generation method, system and the relevant apparatus of direct broadcast band | |
TW200908652A (en) | Apparatus and method for storing and reading a file having a media data container and a metadata container | |
CN107251521A (en) | Method and apparatus for sending and receiving media information in a communications system | |
CN106233692A (en) | Broadcast singal dispensing device, broadcast receiver, broadcast singal sending method and broadcast signal received method | |
CN105934953A (en) | Broadcast signal tranmission device, broadcast signal reception device, broadcast signal tranmission method, and broadcast signal reception method | |
CN105765943B (en) | The device for sending broadcast singal, the device for receiving broadcast singal, the method for sending broadcast singal and the method for receiving broadcast singal | |
CN104602105B (en) | The player method and user equipment of video file | |
CN105451073B (en) | The transfer approach and device of MP4 video sources | |
CN107634930A (en) | The acquisition methods and device of a kind of media data | |
CN105900359A (en) | Broadcast signal transmission apparatus, broadcast signal reception apparatus, broadcast signal transmission method, and broadcast signal reception method | |
CN103648011B (en) | A kind of audio-visual synchronization apparatus and method based on HLS protocol | |
CN103269450A (en) | Multimedia system for Android smart television set | |
CN108141640A (en) | Information processing equipment and information processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |