CN102682016B - A kind of directory system and method for supporting MOV/3GP/MP4 files - Google Patents
A kind of directory system and method for supporting MOV/3GP/MP4 files Download PDFInfo
- Publication number
- CN102682016B CN102682016B CN201110061524.8A CN201110061524A CN102682016B CN 102682016 B CN102682016 B CN 102682016B CN 201110061524 A CN201110061524 A CN 201110061524A CN 102682016 B CN102682016 B CN 102682016B
- Authority
- CN
- China
- Prior art keywords
- video
- audio
- index
- information
- sample
- 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.)
- Expired - Fee Related
Links
Abstract
The invention discloses a kind of directory systems and method for supporting MOV/3GP/MP4 files.The system of the index is by index file head module, level-one index module and secondary index module composition.Index file head module, the file header essential information for recording video and audio file, the complete video/audio stream information made carbon copies after constituent instruments information and the index file foundation of all data flows specially prewrite;Level-one index module, the level-one for storing video and audio file index, specially the traffic flow information of the completely default write-back of video and audio secondary index;Secondary index module, the information of each sample sample records of the secondary index for storing video and audio file, specially video and audio.The efficiency for reading inquiry can be greatly improved through the invention, decrease the memory space of Installed System Memory.
Description
Technical field
The present invention relates to programme production technique field more particularly to a kind of directory systems for supporting MOV/3GP/MP4 files
And method.
Background technology
Streaming media service is the characteristic service of video field, to efficiently recording a video and realizing that accurate and flexible plays to Video content
It is a urgent demand in streaming media service.
The accurate and flexible of broadcasting depends on the storage strategy and broadcast strategy of multiparty data.In streaming media service, stream
Media file is mostly stored with MOV/3GP/MP4 formats.
MOV formatted files are organized in the form of track (track).It can be in one MOV formatted file structure
Including many tracks.Track number limitation have some empirical values, these values can because computer ability it is stronger and stronger and
It changes, however there is no predefined number of tracks to limit for MOV formatted files itself.
3GP is a kind of video code model of 3G Streaming Medias, allows users to send a large amount of data to mobile telephone network
Network, to clearly transmit mass file, such as audio, the mobile phone of video and data network.
MP4 formats are a outstanding stream media formats, are now widely used for various online Media fields.MP4 files
All Files there are in the container that one is known as movie, simply from the point of view of two header files, including MP4 files are housed in movie containers
Header file (index) and MP4 files data file (data).Data file data is pure media article data, but
These data cannot directly be played software and identify and play, and header file index is free of media data, but that specify every
A frame, the size of each aggregate of data are decoded in the position of data and using what mode.
Inventor has found that above-mentioned three kinds of special format files in video broadcasts editing process, have the following problems:
1) play quality is poor, and frame number is low;
2) when playing above-mentioned formatted file online, complete file need to be parsed, needs the waiting grown very much;
3) it is accurate to be extremely difficult to quick frame for traditional editor orientation method.
Invention content
In order to solve the disadvantage that the above-mentioned prior art, the main object of the present invention are to provide a kind of support MOV/3GP/MP4
The directory system and method for file, solution edit big file and need to occupy very big memory and when inquiry needs very long in the prior art
Between the problem of, reach efficient frame-editing.
In order to achieve the above objectives, an aspect of of the present present invention provides a kind of directory system for supporting MOV/3GP/MP4 files,
It specifically includes:
Index file head module, the file header essential information for recording video and audio file, all numbers specially prewrite
The complete video/audio stream information made carbon copies after being established according to the constituent instruments information and index file of stream;
Level-one index module, the level-one for storing video and audio file index, and specially video and audio secondary index is completely default
The traffic flow information of write-back;
Secondary index module, the secondary index for storing video and audio file, specially each video and audio frame sample notes
The information of record.
Another aspect of the present invention additionally provides a kind of method for supporting MOV/3GP/MP4 files, specifically includes following steps:
A video and audio frame sample is obtained to start and the duration and record sample serial numbers;
It searches the sample serial numbers and judges video and audio frame type;
The size of the sample is obtained according to the sample serial numbers;
The positions of sample hereof are accurately positioned.
The embodiment of the present invention by the level indexing structure system established to MOV/3GP/MP4 video and audio media stream files,
And when starting and continue according to the video and audio sample of the video/audio data flow in files in stream media in the directory system
Between record sample serial numbers, judge video and audio frame type and sample sizes according to the serial number, accurate positionin sample exists
Position in file substantially increases reading inquiry to obtain the position of entire MOV/3GP/MP4 video and audios media stream file
Efficiency, decrease the excessive dependence to Installed System Memory.
Description of the drawings
For the clearer technical solution for illustrating the embodiment of the present invention, required use in being described below to embodiment
Attached drawing be briefly described, it is clear that, drawings in the following description are only some embodiments of the invention, for this
For the those of ordinary skill of field, without creative efforts, others are can also be obtained according to these attached drawings
Attached drawing.
Fig. 1 is a kind of directory system for supporting MOV/3GP/MP4 of the embodiment of the present invention.
Fig. 2, which is that the embodiment of the present invention is a kind of, supports the index file of MP4 files to generate schematic diagram;
Fig. 3 is one MP4 file index structural schematic diagram of the embodiment of the present invention;
Fig. 4 is the method schematic diagram that the embodiment of the present invention obtains MOV/3GP/MP4;
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Whole description, it is clear that the described embodiments are merely a part of the embodiments of the present invention, the embodiment being not all of, and is based on this hair
Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained under the premise of not making the creative labor
Example, shall fall within the protection scope of the present invention.
The embodiment of the present invention one supporting the directory system of MOV/3GP/MP4 as shown in Figure 1, being specially to be a kind of:
Index file head module 10, the file header essential information for recording video and audio file, what is specially prewrite is all
The complete video/audio stream information that the constituent instruments information and index file of data flow are made carbon copies after establishing;
Level-one index module 20, the level-one for storing video and audio file index, and specially video and audio secondary index is full pre-
If the traffic flow information of write-back;
Secondary index module 30, the secondary index for storing video and audio file, specially each video and audio frame sample
The information of record.
The embodiment of the present invention two is more detailed for supporting the indexing means of MP4 files to illustrate that present system generates
Technical solution, do not regard it as certainly and be limited.It is illustrated in figure 2 the index file life that MP4 files are supported in the embodiment of the present invention
At flow diagram, specially:
Step S1:MP4 files are read from inlet, and moov box are analyzed according to international standard and respectively obtain audio
Track (audio track) structures and video track (track of video) structure.
Step S2:According to the audio track structures and video track structures extract respectively audio format information with
Video format information obtains video stbl structures and stbl structures in audio.
Step S3:After obtaining video stbl structures with stbl structures in audio, video and all data flows of audio are prewrite
Essential information to index file head, and reserved space is so as to follow-up storage level-one index file.
Step S4:Obtaining each sample since stts structures and the duration, and really start to analyze data flow
Information.
Step S5:When obtaining the video and audio sample times by analyzing traffic flow information, and judging audio time with video
Between size, when audio time be less than video time when, analyze audio chunk, when video time be less than or equal to audio time when,
Analyze video chunk.
Step S6:If audio-frequency information, then audio chunk is analyzed, two level sound is recorded for each sample information
Frequency indexes, and audio chunk is equally then analyzed if video information, two level video rope is recorded for each sample information
Draw.
Step S7:When analysis has recorded current video and audio chunk, it is directed toward next chunk of current track, obtains this
The time of first sample continues to analyze in a chunk, to carry out step S5.
Step S8:When the sample information of record reaches preset value, write-back video and audio secondary index to reserved level-one
Index space.
Step S9:After stbl structural analyses, complete video-voice frequency flow information is made carbon copies to file header.
The embodiment of the present invention according to international standard by reading and parsing comprising MOV/3GP/MP4 video and audios Media Stream text
Part prewrites the constituent instruments information of target index file according to the stbl structures of the video/audio data flow in files in stream media, point
Not Ji Lufenxi video/audio chunk information generate video and audio secondary index, according to time of occurrence sequencing will record
Under secondary index be grouped to be formed level-one index;Complete video-voice frequency flow information is finally made carbon copies, substantially increases and reads inquiry
Efficiency decreases the excessive dependence to Installed System Memory.
The embodiment of the present invention three is a MP4 file index structural schematic diagram, as shown in figure 3, wherein stbl is two level rope
Guiding structure, content are specially:The time that video and audio frame time stts (Time To Sample Box) stores sample is long
Duration is spent, describes the mapping method of sample sequential, we can find the sample of any time by it.Depending on sound
Frequency frame size stsz (Sample Size Box) defines the size of each sample.Video/audio block stsc (Sample
To Chunk Box) in the mapping relations of sample and chunk are described with a table, checking that this table can be found includes
The chunk of specified sample, to find this sample.Organize sample that can facilitate optimization data acquisition with chunk, one
A chunk includes one or more sample.Video and audio key frame stss (Sync Sample Box) determines the pass in media
Key frame." stss " can be closely label media in random access point, it includes a sample serial number table, in table
Each single item is arranged in strict accordance with the serial number of sample, illustrates which of media sample is key frame.If this table is not
In the presence of illustrating that each sample is a key frame, be a random access point.Data block location stco (Chunk
Offset Box) define positions of each chunk in Media Stream.There are two types of storage formats for position, 32 and 64,
The latter is very useful to very big film.A kind of possibility is only had in a table, this position be in entire file, and
It is not by doing so it will directly finding media data hereof, and not have to explain box in any box.
The embodiment of the present invention by the level indexing structure system established to MOV/3GP/MP4 video and audio media stream files,
And when starting and continue according to the video and audio sample of the video/audio data flow in files in stream media in the directory system
Between record sample serial numbers, judge video and audio frame type and sample sizes according to the serial number, accurate positionin sample exists
Position in file substantially increases reading inquiry to obtain the position of entire MOV/3GP/MP4 video and audios media stream file
Efficiency, decrease the excessive dependence to Installed System Memory.
For MOV 3GP index files generate mode it is similar with MP4 document generating methods, details are not described herein.
The embodiment of the present invention four provides a kind of method obtaining MOV/3GP/MP4, as shown in figure 4, being specially:
S1:It is obtained by stts:Sample initial times and duration, and record the serial number of this sample
SampleNum。
S2:SampleNum records have been searched whether in stss, if there is this record, show that this frame is key frame,
Otherwise it is non-key frame.
S3:According to serial number SampleNum, the size of this sample is obtained from stsz.
S4:According to SampleNum, analysis stsc obtains the chunk serial number ChunkNum belonging to this current frame video, and calculates
Go out serial number SampleNumInChunks of this sample in current chunk.
S5:According to ChunkNum, the position ChunkOffset of current chunk hereof are obtained from stco.
S6:The size of SampleNumInChunk-1 video frame before SampleNum is added, is then added
ChunkOffset obtains the position FrameOffset of current video frame hereof.
The embodiment of the present invention by the level indexing structure system established to MOV/3GP/MP4 video and audio media stream files,
It is read and is parsed comprising MOV/3GP/MP4 video and audio media stream files according to international standard, sound is regarded according in files in stream media
The stbl structures of frequency data stream prewrite the constituent instruments information of target index file, record and analyze video/audio chunk respectively
Information generates video and audio secondary index, is grouped the secondary index recorded to form level-one rope according to the sequencing of time of occurrence
Draw;Complete video-voice frequency flow information is finally made carbon copies, and according to the video and audio number in files in stream media in the directory system
According to the video and audio sample of stream start with the duration record sample serial numbers, according to the serial number judge video and audio frame type with
And sample sizes, the positions of sample hereof are accurately positioned, to obtain entire MOV/3GP/MP4 video and audios Media Stream
The position of file substantially increases the efficiency for reading inquiry, decreases the excessive dependence to Installed System Memory.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can lead to
Software realization is crossed, the mode of necessary general hardware platform can also be added to realize by software.Based on this understanding, this hair
Bright technical solution can be expressed in the form of software products, which can be stored in a non-volatile memories
In medium (can be CD-ROM, USB flash disk, mobile hard disk etc.), including some instructions are used so that a computer equipment (can be
Personal computer, server or network equipment etc.) execute method described in each embodiment of the present invention.
The above, only a best specific embodiment of the invention, but the feature of the present invention is not limited thereto, and is appointed
What is familiar with the people of this technology in the field of the present invention, and the changes or modifications that can be readily occurred in should all cover in following present invention
Claim in.
Claims (6)
1. a kind of directory system for supporting MOV/3GP/MP4 files, which is characterized in that including:
Index file head module, the file header essential information for recording video and audio file, all data flows specially prewrite
Constituent instruments information and index file establish after the complete video/audio stream information made carbon copies;
Level-one index module, the level-one for storing video and audio file index, specially the completely default write-back of video and audio secondary index
Traffic flow information;
Secondary index module, the secondary index for storing video and audio file, specially each video and audio frame sample records
Information;
The secondary index module further includes:
Video and audio frame time stts, the time span duration for storing sample, describes the mapping of sample sequential
Method;
Video and audio frame size stsz, the size for defining each sample;
Video/audio block stsc, the mapping relations for describing sample and chunk;
Video and audio key frame stss, for determining the key frame in media;
Data block location stco, for defining positions of each chunk in Media Stream;
The stss also includes a sample serial number table, and each single item in table is arranged in strict accordance with the serial number of sample, explanation
Which of media sample is key frame, if the sample serial numbers table is not present, illustrates each sample
It is a key frame.
2. a kind of generation method for the directory system for supporting MOV/3GP/MP4 files, which is characterized in that including:
It reads and parses the traffic flow information for including MOV/3GP/MP4 files in stream media;
The constituent instruments information of target index file is prewrite according to the stbl structures of the video/audio data flow in files in stream media;
Video/audio chunk information is recorded and analyzed respectively and generates video and audio secondary index, according to the sequencing of time of occurrence
The secondary index recorded is grouped to form level-one index;
Finally make carbon copies complete video-voice frequency flow information.
3. a kind of generation method of directory system for supporting MOV/3GP/MP4 files as claimed in claim 2, feature exist
In reading and parse the traffic flow information comprising MOV/3GP/MP4 files in stream media and specifically include:
Files in stream media, which is analyzed, according to international standard respectively obtains audio track audio track structures and track of video video
Track structures;
Audio format information is extracted respectively according to the audio track structures and video track structures with video format to believe
Breath obtains video stbl structures and stbl structures in audio.
4. a kind of generation method of directory system for supporting MOV/3GP/MP4 files as claimed in claim 2, feature exist
In prewriting the same of the constituent instruments information of target index file according to the stbl structures of the video/audio data flow in files in stream media
When reserved level-one index space.
5. a kind of generation method of directory system for supporting MOV/3GP/MP4 files as claimed in claim 2, feature exist
In recording and analyzing video/audio chunk information generation video and audio secondary index respectively further includes:
Video and audio audio chunk is analyzed, two level video and audio audio index is recorded for each sample information.
6. a kind of generation method of directory system for supporting MOV/3GP/MP4 files as claimed in claim 2, feature exist
In, video/audio chunk information is recorded and analyzed respectively generates video and audio secondary index, it will according to the sequencing of time of occurrence
The secondary index recorded is grouped to form level-one and index:
When the sample information of record reaches preset value, write-back video and audio secondary index to reserved level-one index space.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110061524.8A CN102682016B (en) | 2011-03-15 | 2011-03-15 | A kind of directory system and method for supporting MOV/3GP/MP4 files |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110061524.8A CN102682016B (en) | 2011-03-15 | 2011-03-15 | A kind of directory system and method for supporting MOV/3GP/MP4 files |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102682016A CN102682016A (en) | 2012-09-19 |
CN102682016B true CN102682016B (en) | 2018-10-02 |
Family
ID=46813962
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110061524.8A Expired - Fee Related CN102682016B (en) | 2011-03-15 | 2011-03-15 | A kind of directory system and method for supporting MOV/3GP/MP4 files |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102682016B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103309930B (en) * | 2013-03-13 | 2016-05-11 | 四川天翼网络服务有限公司 | Based on historical video frequency searching and the method for down loading of index service |
CN104506966B (en) * | 2014-12-10 | 2018-01-30 | 曙光信息产业(北京)有限公司 | The coding/decoding method and device of audio, video data |
CN106202558A (en) * | 2016-07-29 | 2016-12-07 | 成都神州数码索贝科技有限公司 | A kind of efficient security protection industry audio, video data storage format and querying method thereof |
CN106777111B (en) * | 2016-12-15 | 2020-08-11 | 华南师范大学 | Time sequence retrieval index system and method for super-large scale data |
CN107729566B (en) * | 2017-11-14 | 2021-02-23 | 郑州天迈科技股份有限公司 | Index reconstruction method for bus-mounted hard disk audio/video data access |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1349351A (en) * | 2000-10-13 | 2002-05-15 | 北京算通数字技术研究中心有限公司 | Method of generating data stream index file and using said file accessing frame and shearing lens |
CN1361989A (en) * | 1999-08-13 | 2002-07-31 | 纳格拉影像股份有限公司 | Method and device for filtering information |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8261312B2 (en) * | 2008-06-27 | 2012-09-04 | Cisco Technology, Inc. | Linear hint video streaming |
-
2011
- 2011-03-15 CN CN201110061524.8A patent/CN102682016B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1361989A (en) * | 1999-08-13 | 2002-07-31 | 纳格拉影像股份有限公司 | Method and device for filtering information |
CN1349351A (en) * | 2000-10-13 | 2002-05-15 | 北京算通数字技术研究中心有限公司 | Method of generating data stream index file and using said file accessing frame and shearing lens |
Also Published As
Publication number | Publication date |
---|---|
CN102682016A (en) | 2012-09-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103414949B (en) | A kind of multimedia edit system based on intelligent television and method | |
CN1965577B (en) | Data recording device, method, and data reproduction device and method | |
CN101682718B (en) | Based on storage/playback method and the equipment of the mpeg 2 transport stream of ISO base media file form | |
CN102682016B (en) | A kind of directory system and method for supporting MOV/3GP/MP4 files | |
JP2007012112A (en) | Data recording device and method thereof, program, and recording medium | |
CN103165151B (en) | Method for broadcasting multimedia file and device | |
CN102231827B (en) | Indexing method capable of supporting direct and accurate positioning of frame of program stream (PS) media file | |
CN105592356B (en) | A kind of audio and video virtual clipping method and system online | |
CN102231826B (en) | Indexing method and system supporting frame accurate positioning of transport stream media file | |
US20120059950A1 (en) | Method and Apparatus for Carrying Transport Stream | |
KR101447606B1 (en) | Method and device for storing audio data | |
JP2013528823A5 (en) | ||
CN101802803B (en) | Method and apparatus for generating and reproducing media object-based metadata | |
CN102340705B (en) | System and method for obtaining key frame | |
CN101803378B (en) | Method and apparatus for generating and accessing metadata in media file format | |
KR101051063B1 (en) | Video recording and playback device, video recording method, video playback method and video recording playback method | |
CN102724488A (en) | Indexing method for supporting direct frame precise positioning of FLV file | |
CN102231847B (en) | Direct and accurate frame positioning method supporting stream media files | |
CN101669359A (en) | Method for constructing a file format and apparatus for processing a broadcasting signal including a file having the file format and method thereof | |
CN102333242A (en) | Device and method for matching streaming media language information | |
CN102982817A (en) | Information processing device, information processing method, and program | |
Ahn et al. | A comparative analysis of metadata structures and attributes of Samsung smartphone voice recording files for forensic use | |
RU2006123260A (en) | RECORDING MEDIA, PLAYBACK DEVICE, PROGRAM AND PLAYBACK METHOD | |
CN105185397B (en) | Video marker method and apparatus | |
KR101995270B1 (en) | Method and apparatus for playing video data |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20181002 |