CN101076099B - Method and device for controlling video record and synchronized-controlling unit - Google Patents

Method and device for controlling video record and synchronized-controlling unit Download PDF

Info

Publication number
CN101076099B
CN101076099B CN2007101189186A CN200710118918A CN101076099B CN 101076099 B CN101076099 B CN 101076099B CN 2007101189186 A CN2007101189186 A CN 2007101189186A CN 200710118918 A CN200710118918 A CN 200710118918A CN 101076099 B CN101076099 B CN 101076099B
Authority
CN
China
Prior art keywords
interrupt process
subelement
video file
video
frame
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
CN2007101189186A
Other languages
Chinese (zh)
Other versions
CN101076099A (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.)
Vimicro Corp
Original Assignee
Vimicro Corp
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 Vimicro Corp filed Critical Vimicro Corp
Priority to CN2007101189186A priority Critical patent/CN101076099B/en
Publication of CN101076099A publication Critical patent/CN101076099A/en
Application granted granted Critical
Publication of CN101076099B publication Critical patent/CN101076099B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)

Abstract

The invention is used for solving the issue that is the actual recorded frame rate is lower than the preset frame rate so as to generate asynchronization between audio and video signals, which is caused by dropping down of sensor frame rate or the interrupt processing delay of timer. The method comprise: the total frame amounts of video files and the accumulated recording time are recorded; when making each interrupt process, according to the preset interrupt frequency, the accumulated recording time at time of triggering the interrupt and the total frame amounts of images, determining the frame amounts of images that should be written into the video file; according to the frame amounts of images that should be written into the video file, getting the relevant frame image data and writing it into the video file, and the quitting the interrupt process.

Description

A kind of control method of video record, device and synchronous control unit
Technical field
The present invention relates to the video recording technology in multimedia field, relate in particular to a kind of control method, device and synchronous control unit of video record.
Background technology
In the prior art, on embedded platform, particularly carry out sound video recording on the platform of some bottoms, recording respectively of Voice ﹠ Video carried out, and Voice ﹠ Video must just can be presented to the synchronous audio frequency and video of beholder by the respective synchronization synthetic operation.
Audio video synchronization is called " lip is synchronous " again.Each link all can be introduced in various degree delay to the audio-video signal that passes through in the collection of audio frequency and video, compression, transmission, reception, decompress(ion), broadcast approach, and postpones unequal usually.Whole audio frequency and video step-out is the algebraical sum of each link step-out in this chain.Because the complexity difference of code decode algorithm, vision signal is born the delay bigger than audio signal usually, causes video to lag behind audio frequency, and audio frequency and video are asynchronous.
To adopt existing AV (Audio Video, audio frequency and video) to record the course of work that algorithm carries out video record is example, and video record comprises two steps that start simultaneously:
1, imageing sensor acquisition of image data and with its output;
The collection of video signal frame per second of imageing sensor generally was 15~30 frame/seconds by program setting;
2, timer triggers Interrupt Process according to the interruption frequency the same with setting the video recording frame per second, the frame new image data that each Interrupt Process cut-away view image-position sensor transmits and with its buffer memory, obtain this frame new image data of buffer memory, with its index information that writes video file and revise video file; In above-mentioned recorded video, carry out recording of audio frequency, and it is recorded the result be stored as audio file;
The index information of above-mentioned video file comprises: frame flag indicates video or audio frequency; The offset address of frame indicates position hereof; The length of frame indicates data length;
When an above-mentioned frame new image data to intercepting is carried out buffer memory, a buffer memory one frame image data, a up-to-date frame image data that transmits covers the previous frame view data of buffer memory automatically.
In the process of recorded video, if the frame new image data that each Interrupt Process can both the cut-away view image-position sensor transmits, with the index information that writes video file and revise video file behind this frame new image data buffer memory, then the actual video recording frame per second of video file is identical with setting video recording frame per second.
If imageing sensor is owing to the influence of factors such as ambient light is darker does not have to transmit when the Interrupt Process new view data during underway disconnected handle, Interrupt Process is just waited for always, transmit new view data up to imageing sensor, the frame new image data that the cut-away view image-position sensor transmits and with its buffer memory, obtain this frame new image data of buffer memory, with its index information that writes video file and revise video file, this processing mode can cause this Interrupt Process operation for a long time, promptly prolonged and obtained the required time of a frame image data, even when this Interrupt Process running time during greater than interrupt interval, Interrupt Process is lost, make the view data of obtaining than lacking of expecting, cause the actual video recording frame per second of video file to be lower than setting video recording frame per second.Now describe for example: prior art video record schematic diagram as shown in Figure 1, suppose that the timer per second interrupts 30 times, with the Interrupt Process first time behind the 10s is example, if imageing sensor does not more collect new view data and output because of environment, Interrupt Process is just waited for always, if transmit new view data at a time chart image-position sensor, the frame new image data that transmits of cut-away view image-position sensor and then with its buffer memory, obtain this frame new image data of buffer memory, with its index information that writes video file and revise video file, this operation only causes for the first time that Interrupt Process has got access to the view data that postpones constantly than triggering, and the actual video recording frame per second of video file is lower than sets the video recording frame per second; If but just transmit new view data at b time chart image-position sensor, be that imageing sensor just transmitted new view data after timer triggered the 3rd Interrupt Process, the frame new image data that transmits of cut-away view image-position sensor and then with its buffer memory, obtain this frame new image data of buffer memory, proceed Interrupt Process the 3rd time after it being write video file and revising the index information of video file, this operation makes behind the 10s that timer triggers the 1st time and the 2nd Interrupt Process lost, the view data of obtaining causes the actual video recording frame per second of video file to be lower than setting video recording frame per second than two frames that lacked of expection thus.
In addition, on embedded platform, the processing that the interruptions of timer triggering is sometimes comprehended owing to high priority postpones, promptly when timer triggers this Interrupt Process, if there is the processing of higher priority to need to carry out, then preferentially carry out the processing of higher priority, proceed to obtain the operation of view data then, the Interrupt Process that will cause timer to trigger like this can not take place according to expeced time, got access to the view data that postpones constantly than triggering when being Interrupt Process, even when timer triggers next time Interrupt Process, the processing of higher priority is not also finished or is just finished, will make this Interrupt Process lose, the view data of obtaining is lacked than expection, also can cause the actual video recording frame per second of video file to be lower than setting video recording frame per second thus.
Because video file and audio file synthesize processing according to setting the video recording frame per second, when the actual video recording frame per second of video file is lower than setting video recording frame per second, can cause the asynchronous of audio frequency and video, influence the audio visual effect of recorded file.
Summary of the invention
The embodiment of the invention provides a kind of control method, device and synchronous control unit of video record, in order to solve in the sound video process owing to the imageing sensor frame per second reduces or the timer Interrupt Process postpones to make the actual video recording frame per second of video file to be lower than to set the video recording frame per second, cause the nonsynchronous problem of audio frequency and video.
A kind of control method of video record comprises: the image totalframes of record video recording cumulative time and video file storage, and when carrying out Interrupt Process: at every turn
According to formula
Figure G2007101189186D00031
Determine to write in this Interrupt Process the number of image frames Z of video file, described T Interrupt intervalThe time interval of representing adjacent twice Interrupt Process, described T The video recording cumulative timeThe video recording cumulative time during expression down trigger, the image totalframes of video file storage when X represents down trigger;
Withdraw from this Interrupt Process after obtaining the respective frame view data and write video file according to the described number of image frames that should write video file, the described respective frame view data of obtaining comprises: if imageing sensor transmits new view data when obtaining view data, then intercept a frame new image data, this frame new image data of buffer memory will be obtained behind its buffer memory, if imageing sensor does not transmit new view data when obtaining view data, then obtain the previous frame view data of buffer memory.
A kind of control device of video record comprises imageing sensor, is used to gather vedio data and output, also comprises:
Synchronous control unit is used to write down the image totalframes of video recording cumulative time and video file storage, and when carrying out Interrupt Process at every turn according to formula
Figure G2007101189186D00032
Perhaps formula
Figure G2007101189186D00034
Determine to write in this Interrupt Process the number of image frames Z of video file, described T Interrupt intervalThe time interval of representing adjacent twice Interrupt Process, described T The video recording cumulative timeThe video recording cumulative time during expression down trigger, the image totalframes of video file storage when X represents down trigger; Withdraw from this Interrupt Process after obtaining the respective frame view data that from the data of imageing sensor output, intercepts and write video file according to the described number of image frames that should write video file;
Buffer, described synchronous control unit are when obtaining the respective frame view data, if imageing sensor transmits new view data, the frame new image data that transmits of intercepting is then obtained its buffer memory to the described buffer this frame new image data of buffer memory; Otherwise, from described buffer, obtain the previous frame view data of buffer memory.
A kind of synchronous control unit of video record comprises:
Control sub unit, down trigger subelement, frame number record subelement, the time interocclusal record subelement, Interrupt Process subelement and buffer, wherein:
Described control sub unit is used to set the interruption frequency of down trigger subelement, and when imageing sensor begins acquisition of image data, starts described down trigger subelement, the timely interocclusal record subelement of frame number record subelement is started working;
Described down trigger subelement is used for producing interruption by setting interruption frequency, triggers described Interrupt Process subelement at every turn when interrupting and carries out Interrupt Process;
Described frame number record subelement is used for the image totalframes of recording of video file storage;
The interocclusal record subelement is used for the record video recording cumulative time when described;
Described Interrupt Process subelement is used for when described down trigger subelement triggers it at every turn and carries out Interrupt Process, the image totalframes of video file storage and video recording cumulative time when obtaining down trigger, and according to formula
Figure G2007101189186D00041
Perhaps formula
Figure G2007101189186D00042
Calculate the number of image frames Z that this Interrupt Process should write video file, described T Interrupt intervalThe time interval of representing adjacent twice Interrupt Process, described T The video recording cumulative timeThe video recording cumulative time during expression down trigger, the image totalframes of video file storage when X represents down trigger, obtain the respective frame view data and write video file according to described number of image frames, whenever the record result who writes control frame number scale record subelement behind the frame image data adds 1, withdraws from this Interrupt Process after the view data of respective frame buffer memory is all write video file;
Described buffer is used at described Interrupt Process subelement when obtaining the respective frame view data, if imageing sensor transmits new view data, the frame new image data that transmits of intercepting is then obtained its buffer memory to the described buffer this frame new image data of buffer memory; Otherwise, from described buffer, obtain the previous frame view data of buffer memory.
The embodiment of the invention is when carrying out sound video recording, trigger interruption by adopting by setting interruption frequency, the image totalframes of record video recording cumulative time and video file storage is in conjunction with the synchronous recording mechanism of control, avoided in the sound video process reducing or the timer Interrupt Process postpones to make the actual video recording frame per second of video file to be lower than to set the video recording frame per second owing to the imageing sensor frame per second, further adopt when down trigger and do not transmit the interleave mechanism that new image data then uses the previous frame view data of buffer memory to replace, reduced the asynchronous of Voice ﹠ Video as if imageing sensor.
Description of drawings
Fig. 1 is a prior art video record schematic diagram;
Fig. 2 is an embodiment of the invention synchronous recording schematic diagram of mechanism;
Fig. 3 is the control method flow chart of embodiment of the invention video record;
Fig. 4 determines to write the schematic diagrames of the number of image frames of video file when the embodiment of the invention Interrupt Process according to formula 3;
Fig. 5 determines to write the schematic diagrames of the number of image frames of video file when the embodiment of the invention Interrupt Process according to formula 2;
The schematic diagram of operating several times according to number of image frames when Fig. 6 carries out Interrupt Process for the embodiment of the invention;
The video record control device structural representation that Fig. 7, Fig. 8 provide for the embodiment of the invention;
A kind of concrete structure schematic diagram of the video record control device that Fig. 9 provides for the embodiment of the invention.
Embodiment
In order to solve in the sound video process owing to the imageing sensor frame per second reduces or the timer Interrupt Process postpones to make the actual video recording frame per second of video file to be lower than to set the video recording frame per second, cause the nonsynchronous problem of audio frequency and video, the embodiment of the invention provides synchronous recording mechanism, the actual video recording frame per second that has guaranteed video file equals to set the video recording frame per second, further adopt interleave mechanism, reduced the asynchronous of sound video process sound intermediate frequency and video as far as possible.Respectively synchronous recording mechanism and interleave mechanism are elaborated below:
One, synchronous recording mechanism
According to setting the video recording frame per second, can determine the time interval of adjacent twice Interrupt Process, i.e. interrupt interval T Interrupt interval, the record video recording cumulative time is T The video recording cumulative timeWith the image totalframes actual value X that stores in the video file.Ideally, when Interrupt Process can obtain a frame image data each time, finish the image totalframes ideal value that should store in the rear video file in each Interrupt Process and can determine by formula 1:
Figure G2007101189186D00051
Wherein
Figure G2007101189186D00052
Expression rounds downwards, and promptly M is T The video recording cumulative time/ T Interrupt intervalInteger part.
Under the perfect condition, M-X=1, only need write a frame image data in the Interrupt Process, if before the down trigger Interrupt Process taking place loses, lose influence for eliminating Interrupt Process to the video recording frame per second, except that the frame image data that this Interrupt Process should write, can also polishing before Interrupt Process do not write the number of image frames of video file when losing, then the number of image frames that should write video file in this Interrupt Process is determined by formula 2:
Figure G2007101189186D00061
Formula 2 can also be deformed into formula 3:
Figure G2007101189186D00062
Consult shown in Figure 2, in the formula 3: T Reference timeEqual T Interrupt intervalWith the product of X, Δ T is T The video recording cumulative timeAnd T Reference timeBetween time difference.Δ T/T Interrupt intervalInteger part Z be the number of image frames that this Interrupt Process should write video file; Δ T/T Interrupt intervalFractional part Δ z cause that by timer error ideally, Δ z is zero.
Like this, when each Interrupt Process, determine that this Interrupt Process should write the number of image frames Z of video file, and obtain the Z frame image data continuously and write video file, before then can polishing because of interrupting losing the number of image frames of minimizing, thereby in time eliminated the influence of interrupting losing, guaranteed that actual video recording frame per second equals to set the video recording frame per second the video recording frame per second.
The Synchronization Control mechanism that the embodiment of the invention provides realizes based on above-mentioned principle, record video recording cumulative time T The video recording cumulative timeWith the image totalframes X of video file storage, after down trigger each time, video recording cumulative time T when obtaining down trigger The video recording cumulative timeWith image totalframes X, calculate Z according to formula 2 or formula 3, according to number of image frames Z, carry out once-through operation or continued operation several times, the frame image data that buffer memory is all obtained in each operation writes video file, after the view data that should write video file all writes video file, stop this Interrupt Process, thereby polishing should write the image totalframes of video file.
Adopt above-mentioned synchronous recording mechanism, even owing to the imageing sensor frame per second reduces or the processing of carrying out higher priority postpones Interrupt Process even loses, image totalframes that also can polishing needs in the Interrupt Process of next time carrying out makes the actual video recording frame per second of video file equal to set the video recording frame per second.
Two, interleave mechanism
Divide once-through operation or continued operation several times above-mentioned according to number of image frames, each operation is all obtained in the process that a frame image data writes video file, if imageing sensor does not transmit new view data when obtaining image, then obtain the previous frame view data of buffer memory, once more be written in video file as the current frame image data previous frame view data of buffer memory, like this, video file and audio file are kept synchronously as far as possible, reduced as far as possible because of Interrupt Process and lost the asynchronous of the Voice ﹠ Video that causes.
Consult shown in Figure 3ly, the control method idiographic flow of the video record that the embodiment of the invention provides is as follows:
Step S01, when imageing sensor begins acquisition of image data, trigger Interrupt Process according to the interruption frequency the same, and the image totalframes of opening entry video file storage and video recording cumulative time with setting the video recording frame per second;
When step S02, each Interrupt Process, the video recording cumulative time during according to setting interruption frequency, down trigger and the image totalframes of video file storage determine should write in this Interrupt Process the number of image frames of video file;
Step S03, each Interrupt Process withdraw from this Interrupt Process after obtaining the respective frame view data and write video file according to the described number of image frames that should write video file.
Consult shown in Figure 4ly, when determining should write the number of image frames of video file in these Interrupt Process according to formula 3, described step S02 further may further comprise the steps:
S021, press interruption frequency and trigger Interrupt Process;
S022, when carrying out Interrupt Process, the image totalframes of the video recording cumulative time when obtaining down trigger and video file storage;
Video recording cumulative time note during with down trigger is made T The video recording cumulative time
The image totalframes note of video file storage during with down trigger is made X;
S023, according to above-mentioned formula 3, at first calculate the product of image totalframes of interrupt interval and video file storage;
Promptly calculate T Interrupt interval* X makes T with its value note Reference time, with it as the reference time;
Above-mentioned T Interrupt intervalThe interrupt interval that expression is determined by interruption frequency, the time interval of promptly triggering adjacent twice Interrupt Process according to interruption frequency;
S024, the video recording cumulative time T when judging down trigger The video recording cumulative timeWhether greater than reference time T Reference time
If T The video recording cumulative timeGreater than T Reference time, then continue execution in step s025;
If T The video recording cumulative timeBe less than or equal to T Reference time, as shown in Figure 2, owing to obtain the time T of X frame image data by setting interrupt interval Reference timeShould be limited to video recording cumulative time T The video recording cumulative timeIn and should not exceed T The video recording cumulative time, but in the physical record operation of video recording cumulative time, inevitably timing error can appear, so work as T The video recording cumulative timeBe less than or equal to T Reference timeThe time, illustrate that error appears in the record of record a video this moment cumulative time, withdraw from this Interrupt Process this moment;
S025, calculating T The video recording cumulative timeWith T Reference timeBetween time difference Δ T, and calculate Δ T/T Interrupt interval, get Δ T/T Interrupt intervalThe integer part Z of value be the number of image frames that this Interrupt Process should write video file.
Above-mentioned when determining should to write in these Interrupt Process the number of image frames of video file according to formula 3 also not execution in step s024 to judge T The video recording cumulative timeWhether greater than T Reference timeAnd can calculate the positive and negative of Z value back judgement Z according to formula 3, if Z is a canonical determines that Z is the number of image frames that should write video file in this Interrupt Process, otherwise withdraw from this Interrupt Process.
Consult shown in Figure 5ly, when determining should write the number of image frames of video file in these Interrupt Process according to formula 2, described step S02 further may further comprise the steps:
T021, press interruption frequency and trigger Interrupt Process;
T022, when carrying out Interrupt Process, the image totalframes of the video recording cumulative time when obtaining down trigger and video file storage;
Video recording cumulative time note during with down trigger is made T The video recording cumulative time
The image totalframes note of video file storage during with down trigger is made X;
T023, according to above-mentioned formula 2, at first calculate T The video recording cumulative time/ T Interrupt intervalAnd get the integer part M of this value;
Above-mentioned T Interrupt intervalThe interrupt interval that expression is determined by interruption frequency, the time interval of promptly triggering adjacent twice Interrupt Process according to interruption frequency;
T024, judge that whether M is greater than X;
If M greater than X, then continues execution in step t025;
If M is less than or equal to X, then withdraw from this Interrupt Process;
The difference Z of t025, calculating M and X, this difference Z is the number of image frames that this Interrupt Process should write video file.
Above-mentioned when determining should to write in these Interrupt Process the number of image frames of video file according to formula 2 also not execution in step t024 to judge T The video recording cumulative timeWhether greater than T Reference timeAnd can calculate the positive and negative of Z value back judgement Z according to formula 2, if Z is a canonical determines that Z is the number of image frames that should write video file in this Interrupt Process, otherwise withdraw from this Interrupt Process.
Above-mentioned definite this Interrupt Process should write the method for the number of image frames Z of video file, is not limited to above-mentioned formula (2) and (3), also can improve accordingly or modification formula (2) or (3) according to the embodiment of the invention in the practical operation.
Consult shown in Figure 6ly, described step S03 further may further comprise the steps:
S031, each Interrupt Process are obtained a frame image data earlier, with its index information that writes video file and revise video file;
If imageing sensor has transmitted new view data when obtaining view data, then the frame new image data that transmits of intercepting and with its buffer memory is obtained this frame new image data of buffer memory, with its index information that writes video file and revise video file; At this moment, the record result of the image totalframes of video file storage adds one, and the number of image frames that should write video file in this Interrupt Process subtracts one;
If when obtaining view data, imageing sensor does not transmit new view data, then obtains the previous frame view data of buffer memory, with its index information that writes video file and revise video file; At this moment, the record result of the image totalframes of video file storage adds one, and the number of image frames that should write video file in this Interrupt Process subtracts one;
S032, judge that whether the number of image frames that also should write video file in this Interrupt Process is zero, if then withdraw from this Interrupt Process; Otherwise return step s031;
If Z is greater than 1, the execution in step that then circulates s031 withdraws from this Interrupt Process when the number of image frames that also should write video file in this Interrupt Process is zero.
Consult the control structure schematic diagram of the video record that Figure 7 shows that the embodiment of the invention provides, comprising:
Video record module 1 and stores processor module 2, video record module 1 is connected with stores processor module 2, wherein:
Video record module 1 is used for recorded video and video data is write stores processor module 2;
It is video file that stores processor module 2 is used for stored video data, and video file is handled.
Consult shown in Figure 8ly, video record module 1 may further include:
Imageing sensor 11 and synchronous control unit 12, wherein:
Imageing sensor 11 is used to gather vedio data and output;
Synchronous control unit 12 is used to write down the image totalframes of video recording cumulative time and video file storage, and the image totalframes of the video recording cumulative time when setting interruption frequency, down trigger and video file storage determines should write in this Interrupt Process the number of image frames of video file at every turn when carrying out Interrupt Process; Withdraw from this Interrupt Process after obtaining the respective frame view data that from the data of imageing sensor 11 output, intercepts and write video file according to the described number of image frames that should write video file.
Wherein, synchronous control unit 12 may further include:
Control sub unit 121, down trigger subelement 122, frame number record subelement 123, the time interocclusal record subelement 124, Interrupt Process subelement 125 and buffer 126, wherein:
The interruption frequency that control sub unit 121 is used to set down trigger subelement 122 with set the video recording frame per second and be consistent, and in imageing sensor 11 beginning acquisition of image data, startup down trigger subelement 122, frame number record subelement 123 timely interocclusal record subelements 124 are started working;
Down trigger subelement 122 is used for producing interruption by setting interruption frequency, triggers Interrupt Process subelement 125 at every turn when interrupting and carries out Interrupt Process;
Frame number record subelement 123 is used for writing down the image totalframes of the video file that writes stores processor module 2;
The time interocclusal record subelement 124 be used for the record video recording cumulative time;
Interrupt Process subelement 125 is used in that down trigger subelement 122 is each when triggering it and carrying out Interrupt Process, the image totalframes of video file storage and video recording cumulative time when obtaining down trigger, and according to the image totalframes of video file storage, the video recording cumulative time reaches the interrupt interval of being determined by described setting interruption frequency and calculates the number of image frames that this Interrupt Process should write video file, obtain the respective frame view data and write video file according to described number of image frames, whenever the record result who writes control frame number scale record subelement 123 behind the frame image data adds 1, withdraws from this Interrupt Process after the view data of respective frame buffer memory is all write video file;
Buffer 126, described Interrupt Process subelement 125 is when obtaining the respective frame view data, if imageing sensor 11 transmits new view data, the frame new image data that transmits of intercepting is then obtained its buffer memory to the buffer 126 this frame new image data of buffer memory; Otherwise, from buffer 126, obtain the previous frame view data of buffer memory.
Embodiment one
In conjunction with the video record control device structural representation that Fig. 7, the embodiment of the invention shown in Figure 8 provide, the control method idiographic flow of the video record of present embodiment is as follows:
In the time of step S101, imageing sensor 11 beginning acquisition of image data, the interruption frequency that control sub unit 121 in the synchronous control unit 12 is provided with down trigger subelement 122 is with to set the video recording frame per second the same, and control down trigger subelement 122, frame number record subelement 123 timely interocclusal record subelements 124 are started working;
Step S102, down trigger subelement 122 carry out Interrupt Process by setting interruption frequency triggering Interrupt Process subelement 125;
Step S103, Interrupt Process subelement 125 from the time video recording cumulative time of interocclusal record subelement 124 when obtaining down trigger, the image totalframes of video file storage is D when frame number record subelement 123 obtains down trigger;
Step S104, Interrupt Process subelement 125 are according to image totalframes D, the video recording cumulative time of video file storage and the interrupt interval of being determined by described setting interruption frequency, and the number of image frames of utilizing above-mentioned formula 2 or formula 3 definite these Interrupt Process should write video file is P;
Step S105, Interrupt Process subelement 125 obtain a frame image data, and it is write stores processor module 2, and stores processor module 2 is with its index information that deposits video file in and revise video file;
If when Interrupt Process subelement 125 obtains view data, imageing sensor 11 transmits new view data, then the frame new image data that transmits of Interrupt Process subelement 125 intercepting and with its buffer memory to buffer 126, obtain this frame new image data of buffer memory, it is write stores processor module 2, stores processor module 2 is with its index information that deposits video file in and revise video file, at this moment, the record result of Interrupt Process subelement 125 control frame number scales record subelement 123 adds one, become D+1, the number of image frames that should write video file in this Interrupt Process subtracts one, becomes P-1;
If when Interrupt Process subelement 125 obtains view data, imageing sensor 11 does not transmit new view data, then Interrupt Process subelement 125 obtains the previous frame view data from buffer 126, it is write stores processor module 2, stores processor module 2 is with its index information that deposits video file in and revise video file, at this moment, the record result of Interrupt Process subelement 125 control frame number scales record subelement 123 adds one, become D+1, the number of image frames that should write video file in this Interrupt Process subtracts one, becomes P-1;
Step S106, judge that whether the number of image frames that also should write video file in this Interrupt Process is zero, if then withdraw from this Interrupt Process; Otherwise return step S105;
Step S107, circulation execution in step S102-S106 carry out Interrupt Process next time;
Step S108, control sub unit 121 control of video are recorded module 1 and are stopped video recording.
Embodiment two
The Timer control is called timer again, can be by the certain time interval trigger event, and the most important attribute of timer is the Interval attribute, and it is used to be provided with the time interval between the timer event, and unit is a millisecond.Present embodiment one adopts timer as the down trigger subelement, is used for triggering Interrupt Process by the interruption frequency the same with setting the video recording frame per second.
Figure 9 shows that the control device schematic diagram of the video record of present embodiment, it adopts timer 322 as the down trigger subelement, adopt timer 324 as the time interocclusal record subelement, adopt counter 323 as frame number record subelement, other structure is identical with device shown in Figure 8.The detailed process of video record being controlled in conjunction with above-mentioned control device is the same with the detailed process of embodiment one, repeats no more here.
The embodiment of the invention is when carrying out sound video recording, by adopting synchronous recording mechanism, avoided in the sound video process reducing or the timer Interrupt Process postpones to make the actual video recording frame per second of video file to be lower than to set the video recording frame per second owing to the imageing sensor frame per second, further adopt interleave mechanism, reduced the asynchronous of sound video process sound intermediate frequency and video as far as possible.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (8)

1. the control method of a video record is characterized in that, comprising: the image totalframes of record video recording cumulative time and video file storage, and when carrying out Interrupt Process: at every turn
According to formula Perhaps
Figure F2007101189186C00012
Determine to write in this Interrupt Process the number of image frames Z of video file, described T Interrupt intervalThe time interval of representing adjacent twice Interrupt Process, described T The video recording cumulative timeThe video recording cumulative time during expression down trigger, the image totalframes of video file storage when X represents down trigger;
Withdraw from this Interrupt Process after obtaining the respective frame view data and write video file according to the described number of image frames that should write video file, the described respective frame view data of obtaining comprises: if imageing sensor transmits new view data when obtaining view data, then intercept a frame new image data, this frame new image data of buffer memory will be obtained behind its buffer memory, if imageing sensor does not transmit new view data when obtaining view data, then obtain the previous frame view data of buffer memory.
2. the method for claim 1 is characterized in that, described method also comprises:
Work as employing
Figure F2007101189186C00013
During calculating, calculating
Figure F2007101189186C00014
After, judge
Figure F2007101189186C00015
Whether,, otherwise withdraw from this Interrupt Process if then further determine Z greater than X.
3. the method for claim 1 is characterized in that, described method also comprises:
Work as employing
Figure F2007101189186C00016
During calculating, calculate T Interrupt interval* behind the X, judge T The video recording cumulative timeWhether greater than T Interrupt interval* X determines Z if then advance one, otherwise withdraws from this Interrupt Process.
4. the method for claim 1 is characterized in that, described method also comprises:
After calculating Z, judge the positive and negative of Z, determine that Z should write the number of image frames of video file in this Interrupt Process if Z is a canonical, otherwise withdraw from this Interrupt Process.
5. the control device of a video record comprises imageing sensor, is used to gather vedio data and output, it is characterized in that, also comprises:
Synchronous control unit is used to write down the image totalframes of video recording cumulative time and video file storage, and when carrying out Interrupt Process at every turn according to formula Perhaps formula
Figure F2007101189186C00022
Figure F2007101189186C00023
Determine to write in this Interrupt Process the number of image frames Z of video file, described T Interrupt intervalThe time interval of representing adjacent twice Interrupt Process, described T The video recording cumulative timeThe video recording cumulative time during expression down trigger, the image totalframes of video file storage when X represents down trigger; Withdraw from this Interrupt Process after obtaining the respective frame view data that from the data of imageing sensor output, intercepts and write video file according to the described number of image frames that should write video file;
Buffer, described synchronous control unit are when obtaining the respective frame view data, if imageing sensor transmits new view data, the frame new image data that transmits of intercepting is then obtained its buffer memory to the described buffer this frame new image data of buffer memory; Otherwise, from described buffer, obtain the previous frame view data of buffer memory.
6. device as claimed in claim 5 is characterized in that, described synchronous control unit further comprise control sub unit, down trigger subelement, frame number record subelement, the time interocclusal record subelement and Interrupt Process subelement, wherein:
Described control sub unit is used to set the interruption frequency of down trigger subelement, and when described imageing sensor begins acquisition of image data, starts described down trigger subelement, the timely interocclusal record subelement of frame number record subelement is started working;
Described down trigger subelement is used for producing interruption by setting interruption frequency, triggers described Interrupt Process subelement at every turn when interrupting and carries out Interrupt Process;
Described frame number record subelement is used for the image totalframes of recording of video file storage;
The interocclusal record subelement is used for the record video recording cumulative time when described;
Described Interrupt Process subelement is used for when described down trigger subelement triggers it at every turn and carries out Interrupt Process, the image totalframes of video file storage and video recording cumulative time when obtaining down trigger, and according to the image totalframes of video file storage, video recording cumulative time and described setting interruption frequency calculate the number of image frames that this Interrupt Process should write video file, obtain the respective frame view data and write video file according to described number of image frames, whenever the record result who writes control frame number scale record subelement behind the frame image data adds 1, withdraws from this Interrupt Process after the view data of respective frame buffer memory is all write video file.
7. device as claimed in claim 6 is characterized in that, described down trigger subelement is that timer, described frame number record subelement is a counter, the interocclusal record subelement is a timer when described.
8. the synchronous control unit of a video record is characterized in that, comprising:
Control sub unit, down trigger subelement, frame number record subelement, the time interocclusal record subelement, Interrupt Process subelement and buffer, wherein:
Described control sub unit is used to set the interruption frequency of down trigger subelement, and when imageing sensor begins acquisition of image data, starts described down trigger subelement, the timely interocclusal record subelement of frame number record subelement is started working;
Described down trigger subelement is used for producing interruption by setting interruption frequency, triggers described Interrupt Process subelement at every turn when interrupting and carries out Interrupt Process;
Described frame number record subelement is used for the image totalframes of recording of video file storage;
The interocclusal record subelement is used for the record video recording cumulative time when described;
Described Interrupt Process subelement is used for when described down trigger subelement triggers it at every turn and carries out Interrupt Process, the image totalframes of video file storage and video recording cumulative time when obtaining down trigger, and according to formula Perhaps formula
Figure F2007101189186C00032
Calculate the number of image frames Z that this Interrupt Process should write video file, described T Interrupt intervalThe time interval of representing adjacent twice Interrupt Process, described T The video recording cumulative timeThe video recording cumulative time during expression down trigger, the image totalframes of video file storage when X represents down trigger, obtain the respective frame view data and write video file according to described number of image frames, whenever the record result who writes control frame number scale record subelement behind the frame image data adds 1, withdraws from this Interrupt Process after the view data of respective frame buffer memory is all write video file;
Described buffer is used at described Interrupt Process subelement when obtaining the respective frame view data, if imageing sensor transmits new view data, the frame new image data that transmits of intercepting is then obtained its buffer memory to the described buffer this frame new image data of buffer memory; Otherwise, from described buffer, obtain the previous frame view data of buffer memory.
CN2007101189186A 2007-06-14 2007-06-14 Method and device for controlling video record and synchronized-controlling unit Expired - Fee Related CN101076099B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101189186A CN101076099B (en) 2007-06-14 2007-06-14 Method and device for controlling video record and synchronized-controlling unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101189186A CN101076099B (en) 2007-06-14 2007-06-14 Method and device for controlling video record and synchronized-controlling unit

Publications (2)

Publication Number Publication Date
CN101076099A CN101076099A (en) 2007-11-21
CN101076099B true CN101076099B (en) 2010-06-09

Family

ID=38976894

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101189186A Expired - Fee Related CN101076099B (en) 2007-06-14 2007-06-14 Method and device for controlling video record and synchronized-controlling unit

Country Status (1)

Country Link
CN (1) CN101076099B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101931775A (en) * 2010-09-01 2010-12-29 中兴通讯股份有限公司 Video recording method and device
CN102387409A (en) * 2011-12-07 2012-03-21 江苏远为科技有限公司 Method for video playing and based on stream media system
KR20160036104A (en) 2011-12-07 2016-04-01 퀄컴 인코포레이티드 Low power integrated circuit to analyze a digitized audio stream
CN103596033B (en) * 2013-11-11 2017-01-11 北京佳讯飞鸿电气股份有限公司 Method for solving problem of audio and video non-synchronization in multimedia system terminal playback
CN105657459B (en) * 2016-03-14 2018-07-10 北京学而思教育科技有限公司 A kind of audio and video data processing method and device
CN111356003B (en) * 2020-03-11 2022-03-29 安徽文香科技有限公司 Data writing method, system and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5508816A (en) * 1992-10-07 1996-04-16 Nec Corporation Synchronous compression and reconstruction system
CN1144438A (en) * 1990-12-15 1997-03-05 三星电子株式会社 Display apparatus informing of programmed recording
JP2005041032A (en) * 2003-07-24 2005-02-17 Canon Inc Image forming method and device
CN1642249A (en) * 2004-01-14 2005-07-20 卡西欧计算机株式会社 Moving image recording apparatus, digital camera device and moving image recording method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1144438A (en) * 1990-12-15 1997-03-05 三星电子株式会社 Display apparatus informing of programmed recording
US5508816A (en) * 1992-10-07 1996-04-16 Nec Corporation Synchronous compression and reconstruction system
JP2005041032A (en) * 2003-07-24 2005-02-17 Canon Inc Image forming method and device
CN1642249A (en) * 2004-01-14 2005-07-20 卡西欧计算机株式会社 Moving image recording apparatus, digital camera device and moving image recording method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
莫黎, 方骅.多媒体技术在视频领域中的应用.计算机与数字工程30 5.2002,30(5),65-68.
莫黎, 方骅.多媒体技术在视频领域中的应用.计算机与数字工程30 5.2002,30(5),65-68. *

Also Published As

Publication number Publication date
CN101076099A (en) 2007-11-21

Similar Documents

Publication Publication Date Title
CN101076099B (en) Method and device for controlling video record and synchronized-controlling unit
EP0668700B1 (en) Audio/video decoding system and method
US6516005B1 (en) Apparatus and method for data decoding
EP0649259B1 (en) Data reproducing devices
US7054546B2 (en) Data multiplexing method, data recorded medium, data recording apparatus and data recording program
CN110248204A (en) A kind of processing method, device, equipment and the storage medium of live streaming caching
US6792001B1 (en) Method and device for transmitting data packets
CA2141672A1 (en) Rational input buffer arrangements for auxiliary information in video and audio signal processing systems
CN104410807A (en) Method and device for synchronously replaying multi-channel video
DE4335271A1 (en) Data demultiplexer for decoding video data - generates signals to control decoding operations with control circuit supplied by video synchronising signal generator
US9137502B2 (en) Method and system for fast digital channel change utilizing time-stamp management
CN106331835B (en) A kind of dynamic adjusting data receives the method and video decoding apparatus of caching
JPH04504040A (en) High Definition TV Encoder/Decoder
EP1133180A2 (en) Method and apparatus for indexing and locating key frames in streaming and variable-frame-length data
DE602004008647T2 (en) EVENT TIME STAMPING
CN110505494B (en) Method and device for removing network jitter
EP0372458A2 (en) Synchronous multiplex transmission apparatus
CN113507617B (en) SEI frame playback data synchronization method, system, device and medium based on live video stream
CN107392983B (en) Method and system for recording animation
CN100380959C (en) Information processing device and method, program, and recording medium
JP3556381B2 (en) Information multiplexing device
EP0267577B1 (en) Decoding device capable of producing a decoded video signal with a reduced delay
US8667320B2 (en) Deriving accurate media position information
CN107040784A (en) A kind of video buffer processing method, system and device
JP4706593B2 (en) Packet signal receiver

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: 20100609

Termination date: 20170614

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