CN100596185C - Method for recording file with audio/video frequency alternated format - Google Patents

Method for recording file with audio/video frequency alternated format Download PDF

Info

Publication number
CN100596185C
CN100596185C CN200710151306A CN200710151306A CN100596185C CN 100596185 C CN100596185 C CN 100596185C CN 200710151306 A CN200710151306 A CN 200710151306A CN 200710151306 A CN200710151306 A CN 200710151306A CN 100596185 C CN100596185 C CN 100596185C
Authority
CN
China
Prior art keywords
audio
video
recorded information
file
format file
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
Application number
CN200710151306A
Other languages
Chinese (zh)
Other versions
CN101399949A (en
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.)
Sunplus Technology Co Ltd
Original Assignee
Sunplus Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sunplus Technology Co Ltd filed Critical Sunplus Technology Co Ltd
Priority to CN200710151306A priority Critical patent/CN100596185C/en
Publication of CN101399949A publication Critical patent/CN101399949A/en
Application granted granted Critical
Publication of CN100596185C publication Critical patent/CN100596185C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

The invention discloses a method for recording alternate format file of audio frequency and video frequency. The alternate format file of audio frequency and video frequency comprises file head and content block. The inventive method comprises: writing preset value of multiple recording information in corresponding field in file head and content block; recording information is of audio and video length of alternate format file of audio frequency and video frequency; when receiving multimedia data, writing the multimedia data in content block, recording alternate format file of audio frequencyand video frequency; then correcting field corresponding to recording information of file head and content block according to actual value of recording information. The invention can assure the alternate format file of audio frequency and video frequency has complete and legal structure and can be normally accessed when recording process encounter non-normal interruption.

Description

A kind of method of recording audio and video staggering format file
Technical field
The present invention relates to a kind of document recording method, particularly a kind of method of recording audio and video staggering format file.
Background technology
Along with Development of Multimedia Technology, supervisory control system can be followed the trail of image by making video recording in real time, for example: be applied to safe supervisory control system.And the content that suchlike supervisory control system is recorded has the importance of height, and requires high for the continuity of recorded content.
Audio and video staggering format file (AVI file, audio and video interleaved file) is one of the file format of the most normal use of making video recording in real time.Audio frequency and video are cut into multidata piece (datachunk), and the file format of staggered (interleave) transmission of audio and block of video data, in the present invention, the staggered data block transmitted of general term is multi-medium data (multiplexed media data).And audio and video staggering format file adopts the storing mode of data interaction file format, promptly adopts a kind of File Format (meta-format) that data block is stored in the block (tagged chunks) that is labeled.
Generally speaking, complete audio and video staggering format file must possess the file header (header) that meets AVI standard institute standard, is used for playing for multimedia player.Therefore, if when improper interruption takes place in recording process, for example: power breakdown, then the very possible multimedia player that makes because there not being the file header of legal description scheme of the file format of being recorded can't reappear the video-audio data of being recorded before the power breakdown.
Fig. 1 is the schematic flow sheet of recording audio and video staggering format file in the prior art.Please refer to Fig. 1, generally speaking, in the initial information of recording (step S101) that begins the first setting audio video staggering format file of meeting, for example: the sampling frequency of recorded speech.And when recording, write video-audio data (step S102) seriatim, and judge to record whether finish (step S103).Do not finish then to write constantly video-audio data (step S102) if record.If record end, the index of just organizing video-audio data and being comprised, and write file header (step S104) according to complete video-audio data.
Yet, above-mentioned method for recording be record finish after, write file header according to complete video-audio data, that is to say, be to learn the correct file header that should write at last in recording process.If cause in recording process meeting with power breakdown like this or when losing efficacy,, and can't reappear the video-audio data of being recorded before interrupting just the audio and video staggering format file of recording can be because of not existing legal and the complete file head.
Therefore, in the prior art, realize reappearing the purpose of the video-audio data of being recorded before interrupting by transaction file head usually.
Fig. 2 is another schematic flow sheet of recording audio and video staggering format file in the prior art.Please refer to Fig. 2, different with Fig. 1 is after writing video-audio data (step S202), to come transaction file head (step S203) according to the video-audio data of being recorded among Fig. 2 at every turn.After recording end (step S204), again according to complete video-audio data correction file header (step S205).
The video-audio data that said method is recorded before can realizing resetting and interrupting, but owing to file header changes with recorded content regularly, and cause the task performance of recording system to reduce significantly.
Summary of the invention
The invention provides a kind of method of recording audio and video staggering format file, be used for when recording process meets with improper interruption, guarantee the audio and video staggering format file of being recorded before the normal access of recording system energy is interrupted.
The method of a kind of recording audio and video staggering format file provided by the invention, wherein, audio and video staggering format file include file head and content piece.This method writes the field corresponding with recorded information in file header and the content piece respectively with the preset value of a plurality of recorded informations, and recorded information is the audio-visual length of audio and video staggering format file.When receiving multi-medium data, then multi-medium data is written into content piece, recording audio and video staggering format file.When having recorded described audio and video staggering format file,, revise field corresponding in described file header and the described content piece respectively according to the actual value of described recorded information.
The present invention also provides a kind of method of recording audio and video staggering format file, wherein, and audio and video staggering format file include file head and content piece.This method writes the field corresponding with recorded information in file header and the content piece respectively with the preset value of a plurality of recorded informations, and recorded information is the audio-visual length of audio and video staggering format file.When receiving multi-medium data, then multi-medium data is written into content piece, recording audio and video staggering format file.Every Preset Time, then use the field of each recorded information correspondence in a threshold value transaction file head and the content piece, wherein, this threshold value is the value of each recorded information of converting more than or equal to required time before next update.When having recorded described audio and video staggering format file,, revise field corresponding in described file header and the described content piece respectively according to the actual value of described recorded information.
The method of above-mentioned a kind of recording audio and video staggering format file comprises the execution initialization process, is used for the initial information of setting audio video staggering format file.
The method of above-mentioned a kind of recording audio and video staggering format file, audio and video staggering format file further comprise index block, the block type of a plurality of sub-pieces that the content piece is comprised, and the side-play amount of playing each sub-piece is written into index block.
As seen from the above technical solution, the method for a kind of recording audio and video staggering format file of the present invention when recording, writes the preset value about the recorded information of audio and video staggering format file in advance.Therefore, even meet with improper interruption in the recording process, also can be because of the structure of the audio and video staggering format file compliant of recording, and the audio and video staggering format file of being recorded before can access interrupting.
Description of drawings
Fig. 1 is the schematic flow sheet of recording audio and video staggering format file in the prior art.
Fig. 2 is another schematic flow sheet of recording audio and video staggering format file in the prior art.
Fig. 3 is the structural representation of audio and video staggering format file of the present invention.
Fig. 4 is the schematic flow sheet of the embodiment of the invention one recording audio and video staggering format file.
Fig. 5 is the schematic flow sheet of another embodiment of the present invention recording audio and video staggering format file.
Label declaration in the accompanying drawing
301: data interchange file fmt chunk 301a: file header
301b: content piece 301c: index block
302a, 302b: sub-piece
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in further detail.
It is a kind of when meeting with improper interruptions in recording process that embodiments of the invention provide, still the method for the video-audio data that can be recorded before the access interruption on the medium of recording.
Fig. 3 is the structural representation of audio and video staggering format file of the present invention.Please refer to Fig. 3, each audio and video staggering format file is formed by a data interchange file fmt chunk (RIFF chunk) construction, and the data interchange file fmt chunk can comprise a plurality of sub-pieces (sub-chunk).Wherein, data interchange file formatter piece can be directory block (LIST chunk), also can be regular sub-piece (regular sub-chunk), and for example, directory block is file header 301a, content piece 301b, and regular sub-piece is index block 301c.The structure of directory block is identical with the structure of data interchange file fmt chunk, can comprise sub-piece of catalogue or regular sub-piece, but regular sub-piece can not comprise any sub-piece again.
A complete data interchange file fmt chunk 301 includes file header 301a, content piece 301b and optional index block 301c.File header 301a is used for the recorded information of record audio video staggering format file, for example: the relevant field of the length (video length) (being the frame number of video data) of the frame number (avih#frames) of the size of data interchange file fmt chunk (RIFF size), video-audio data, video data, length (audio length) the relevant video-audio data length such as (being the sample number of voice data) of voice data.Content piece 301b then is used for writing down the size (movi size) of its video-audio data that comprises and the video-audio data of recording.
Because video-audio data is divided into a plurality of data blocks, for example: each block of video data is a frame, and these data blocks are recorded in respectively among sub-piece 302a, the 302b that content piece 301b comprised, in the present embodiment, for convenience of description, describe with 2 sub-pieces, in the practical application, the content piece also can comprise a plurality of sub-pieces.Index block 301c is used for the side-play amount (offset) of these data blocks of recording played and the content size (size) of data block, is used for resetting (playback), changeing soon or can seek the data block that institute's desire is play apace during the revolution video-audio data.In addition, index block 301c also can be used to the block type of recording data blocks, and for example: whether the block type of block of video data is I (intra) frame.
Fig. 4 is the schematic flow sheet of the embodiment of the invention one recording audio and video staggering format file.Please refer to Fig. 3 and Fig. 4, can carry out initialization process (step S401) earlier recording at the beginning, be used for the initial information of setting audio video staggering format file, for example: audio sample frequency or video compression format etc.Then, the preset value of recorded information is write field (step S402) corresponding with recorded information in file header 301a and the content piece 301b, wherein recorded information is relevant with the audio-visual length of audio and video staggering format file, for example: video data frame number, video-audio data size or audio data sample number etc.Recorded information is write and the relevant field of the audio-visual length of audio and video staggering format file, and this is the common practise of this area, does not repeat them here.
In the present embodiment, the preset value of the recorded information that in file header 301a, writes, it can be the preset value of a plurality of information of recording, preset value can be size (size that is equivalent to video-audio data), video data frame number, the audio data sample number of RIFF block, and the preset value of the recorded information that writes in content piece 301b can be the size of video-audio data.Because in the recording system of reality, the audio and video staggering format file field of standard, for these recorded informations certain restriction is arranged all, so in the present embodiment, the preset value of preferable recorded information is the maximum of the recorded information of conformance with standard institute standard, more preferably by meet recording system the maximum of recorded information of energy imprinting, perhaps be actual value more than or equal to the recorded information of recording system institute imprinting.
For instance, the video frame rate of NTSC (national television standards committee is hereinafter to be referred as NTSC) institute's standard was approximately for 30 frame/seconds (frames/second).If desire to record the video-audio data of NTSC form, but and the audio-visual length of recording system imprinting, it for example is 3 hours, then will write the maximum video data frame number that recording system can allow imprinting in the field of video data length (video length) and audio/video file frame number (avih#frames) in the file header 301a, i.e. 3 hours * 60 minutes/hour * 60 seconds/minute * 30 frames/second=324000 frame.And in the field of voice data length, also will insert the maximal audio data sample number that recording system can allow imprinting.In like manner, correspondingly in other fields write the maximum that recording system can allow imprinting.The technological means of using always according to those skilled in the art, (phase alternating line, PAL) during the video-audio data of form, but the greatest frame rate of establishing criteria standard is done respective settings if desire to record European countries' television standard.
Then, multi-medium data is written into content piece 301b, carries out recording audio and video staggering format file (step S403), and judge to record whether finish (step S404).If record imperfect tense, then continue multi-medium data is write content piece 301b (step S403).If record and finish, then according to the field (step S405) of recorded information correspondence in the actual value correction file header 301a of recorded information and the content piece 301b.Generally speaking, when multi-medium data being write content piece 301b, the also sub-piece that content piece 301b can be comprised () block type for example: 302a, 302b, and the side-play amount of playing each sub-piece is recorded among the index block 301c.Record finish after, organize the information that is write down in the index block 301c.
Can learn from the schematic flow sheet of Fig. 4, even in recording process, suffer from improper interruption, though can not predict and record the recorded information of finishing at last, because the audio and video staggering format file of being recorded before interrupting is because of having compliant and complete structure, and can normally access of quilt.Therefore, and finish the back and compare recording in the prior art, when the embodiment of the invention meets with improper interruption in recording process, can reappear the video-audio data of being recorded before the interruption according to the method (as shown in Figure 1) that actual recorded information writes file header.And the method (as shown in Figure 2) of present embodiment perseverance transaction file head with respect in the prior art time has higher operating efficiency.
Fig. 5 is the schematic flow sheet of another embodiment of the present invention recording audio and video staggering format file.In the present embodiment, by setting preset time T 1, be updated periodically the recorded information that is write down in file header 301a and the content piece 301b.Please refer to Fig. 3 and Fig. 5, carry out initialization process at the beginning recording, be used for the initial information (step S501) of setting audio video staggering format file.Then, the preset value of the recorded information that preset time T 1 is converted writes field (step S502) corresponding with recorded information in file header 301a and the content piece 301b, and write multi-medium data in content piece 301b, carry out recording audio and video staggering format file (step S503).The preset value of the recorded information that writes for the first time is the record value of the recorded information that is converted into of T1 time at least.
Then, judge to record whether finish (step S504), finish, can revise the field (step S505) of recorded information correspondence in file header 301a and the content piece 301b according to the actual value of recorded information if record.If record and do not finish, judge then whether recording time reaches above-mentioned preset time T 1 (step S506).If also do not reach this preset time T 1, then continue to write multi-medium data (step S503).When recording time reaches this preset time T 1, carrying out the 1st time upgrades, with field (step S502) corresponding in a threshold value transaction file head 301a and the content piece 301b with recorded information, wherein, this threshold value is the value more than or equal to the recorded information that converts by the next update required time.
For instance, suppose that recorded information is the video frame number, and initialization system upgraded once every 30 minutes, then when the initialization process of recording, the value of the video frame number that the 30 minutes length (that is, more than or equal to the actual time span of recording before renewal) that is at least the preset value that writes for the first time the video frame number is converted.When recording through after a while, for example 18 minutes, when running into improper interruption, because writing down the video frame number of at least 30 minutes length in the file header of audio and video staggering format file, so recording system still can be play the video-audio data of being recorded before the improper interruption.
If normally record through 30 minutes, then system carries out the 1st renewal, this moment with at least 60 minutes length (that is, before next update the total time length of process) the video frame number that converted writes in its corresponding field (being the field of video data length in the file header 301a), in the time of so can guaranteeing in recording process, to run into improper interruption, still can play the video-audio data of being recorded before the 60th minute.
From the above, in the present embodiment, when carrying out upgrading for the N time, the threshold value that is write is at least the value of the recorded information that the time of T1 * (1+N) converts, and wherein N is zero or positive integer.Therefore,, make when in recording process, running into improper interruption, still can guarantee the video-audio data that system can play before interruption to be recorded by periodic renewal recorded information.
In the practical application, present embodiment does not limit to the preset value (step S502) that writes recorded information, and the order that writes multi-medium data (step S503).The value of the recorded information that the preset value of the recorded information that writes (step S502) is converted into for preset time T 1, also can be as the explanation of Fig. 4, employing meets the maximum of recorded information of the standard institute standard of audio and video staggering format file, but or be greater than or equal to the actual value of the recorded information of recording system imprinting, perhaps recording system can imprinting the maximum of recorded information as the preset value of the recorded information that writes.
In sum, present embodiment is when recording, and the field of recorded information correspondence writes the preset value of recorded information in file header 301a and content piece 301b, and writes multi-medium data, carries out recording audio and video staggering format file.Therefore, even in recording process, suffer from improper interruption, though can not obtain to record finish after correct recorded information, the audio and video staggering format file of being recorded before interrupting is because of having conformance with standard and complete structure, and can normally access of quilt.
In the recording process of present embodiment, periodically with more than or equal to (for example by the next update required time, T1 * (1+N), wherein T1 is default update time, and N is a update times) value (being threshold value) of the recorded information that converts comes the field corresponding with recorded information in transaction file head and the content piece, can be played to guarantee the recorded information before the improper interruption.
The foregoing description record finish after, optionally according to the actual value of recorded information, revise the field corresponding in file header 301a and the content piece 301b with recorded information.
Though the present invention discloses as above with preferred embodiment, so be not in order to limit the present invention, those of ordinary skill in the technical field under any, without departing from the spirit and scope of the present invention, can do a little change and retouching, therefore the interest field that the present invention advocated should be as the criterion so that the patent application scope is described, but not only limits to the foregoing description.

Claims (15)

1. the method for a recording audio and video staggering format file, wherein, described audio and video staggering format file comprises a file header and a content piece, it is characterized in that this method comprises:
The preset value of a plurality of recorded informations is write the field corresponding with described recorded information in described file header and the described content piece respectively, and described recorded information is the audio-visual length of described audio and video staggering format file; And
One multi-medium data is write described content piece, record described audio and video staggering format file;
When having recorded described audio and video staggering format file,, revise field corresponding in described file header and the described content piece respectively according to the actual value of described recorded information.
2. the method for claim 1 is characterized in that, the preset value of described recorded information is the maximum of the described recorded information of described audio and video staggering format file standard institute standard.
3. the method for claim 1 is characterized in that, but the preset value of described recorded information is the actual value more than or equal to the described recorded information of a recording system imprinting.
4. the method for claim 1 is characterized in that, the preset value of described recorded information by a recording system the maximum of described recorded information of energy imprinting.
5. the method for claim 1 is characterized in that, this method further comprises:
Carry out an initialization process, be used to set a plurality of initial informations of described audio and video staggering format file.
6. the method for claim 1 is characterized in that, described audio and video staggering format file further comprises an index block, and this method further comprises:
The block type of a plurality of sub-pieces that described content piece is comprised, and the side-play amount of playing each described sub-piece writes described index block.
7. the method for claim 1, it is characterized in that described recorded information comprises one of the following or its combination in any of described audio and video staggering format file: a video data frame number, an audio data sample number, a totalframes, a data interaction file format block size, content block size.
8. the method for a recording audio and video staggering format file, wherein, described audio and video staggering format file comprises a file header and a content piece, it is characterized in that this method comprises:
The preset value of a plurality of recorded informations is write the field corresponding with described recorded information in described file header and the described content piece respectively, and described recorded information is the audio-visual length of described audio and video staggering format file;
One multi-medium data is write described content piece, record described audio and video staggering format file;
Every a Preset Time, upgrade field corresponding in described file header and the described content piece with a threshold value, described threshold value is the value more than or equal to the described recorded information that converts by the next update required time; And
When having recorded described audio and video staggering format file,, revise field corresponding in described file header and the described content piece respectively according to the actual value of described recorded information.
9. method as claimed in claim 8 is characterized in that, the preset value of described recorded information is the maximum of the described recorded information of described audio and video staggering format file standard institute standard.
10. method as claimed in claim 8 is characterized in that, the preset value of described recorded information is the actual value more than or equal to the described recorded information of recording system institute imprinting.
11. method as claimed in claim 8 is characterized in that, the preset value of described recorded information by a recording system the maximum of described recorded information of energy imprinting.
12. method as claimed in claim 8 is characterized in that, the preset value of described recorded information is the value of the described recorded information that converts according to described Preset Time.
13. method as claimed in claim 8 is characterized in that, this method further comprises:
Carry out an initialization process, be used to set a plurality of initial informations of an audio and video staggering format file.
14. method as claimed in claim 8 is characterized in that, described audio and video staggering format file further comprises an index block, and this method further comprises:
The block type of a plurality of sub-pieces that described content piece is comprised, and the side-play amount of playing each described sub-piece writes described index block.
15. method as claimed in claim 8, it is characterized in that described recorded information comprises one of the following or its combination in any of described audio and video staggering format file: a video data frame number, an audio data sample number, a totalframes, a data interaction file format block size, content block size.
CN200710151306A 2007-09-24 2007-09-24 Method for recording file with audio/video frequency alternated format Expired - Fee Related CN100596185C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710151306A CN100596185C (en) 2007-09-24 2007-09-24 Method for recording file with audio/video frequency alternated format

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710151306A CN100596185C (en) 2007-09-24 2007-09-24 Method for recording file with audio/video frequency alternated format

Publications (2)

Publication Number Publication Date
CN101399949A CN101399949A (en) 2009-04-01
CN100596185C true CN100596185C (en) 2010-03-24

Family

ID=40518163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710151306A Expired - Fee Related CN100596185C (en) 2007-09-24 2007-09-24 Method for recording file with audio/video frequency alternated format

Country Status (1)

Country Link
CN (1) CN100596185C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5917123B2 (en) * 2011-12-14 2016-05-11 キヤノン株式会社 Recording device
TWI486913B (en) * 2013-06-14 2015-06-01 Vivotek Inc Security monitoring device with network and record function and failure detecting and repairing mehtod for storage device thereof

Also Published As

Publication number Publication date
CN101399949A (en) 2009-04-01

Similar Documents

Publication Publication Date Title
CN1713709B (en) Information processor
JP4970688B2 (en) Method and apparatus for creating and playing back digital video recordings, and digital video recordings created using this method
CN101035302B (en) Apparatus for reproduction of information
CN102413358A (en) Storage and playing method, device and system of streaming media file
US20090103897A1 (en) Method for synchronzing audio and video data in avi file
JPH10269706A (en) Information reproducing apparatus and information reproducing method
CN101861730B (en) Method for generating video data for trick play
CN100596185C (en) Method for recording file with audio/video frequency alternated format
CN102170453A (en) Audio and video coding method and playing method for shortening waiting time before on demand playing
CN103731625A (en) Method for simultaneously and synchronously playing multiple paths of audios and videos
US20090046994A1 (en) Digital television broadcast recording and reproduction apparatus and reproduction method thereof
KR20070080982A (en) Apparatus and method for tricking playing of a digital broadcasting stream
US20090067817A1 (en) Error recovery method for recording audio-video interleaved file
CN1848939B (en) Information management system, information management apparatus and information management method
US8204616B2 (en) Data output apparatus and data output method
JP2007124639A (en) Method and system for storing data packets
JP2006245744A (en) Video signal recording device, information recording medium, and video signal reproducing device
CN101833972A (en) Multimedia file broadcasting control method and device
US20050025453A1 (en) Program, data processing method, and system of same
CN103426448A (en) System and method for adjusting timestamps
US20070146803A1 (en) Information recording apparatus and recorded information management method
JP2008199077A (en) Video recording/reproducing method and device
CN105357463A (en) Video surveillance data storage method
JP4048809B2 (en) Data processing apparatus and method, recording medium, and program
JP3004096U (en) Compressed signal creation and playback device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100324

Termination date: 20170924

CF01 Termination of patent right due to non-payment of annual fee