CN102143318B - A kind of generation method and device of video file - Google Patents
A kind of generation method and device of video file Download PDFInfo
- Publication number
- CN102143318B CN102143318B CN201110024022.8A CN201110024022A CN102143318B CN 102143318 B CN102143318 B CN 102143318B CN 201110024022 A CN201110024022 A CN 201110024022A CN 102143318 B CN102143318 B CN 102143318B
- Authority
- CN
- China
- Prior art keywords
- caching
- image
- frame image
- video file
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The invention discloses the generation method and device of a kind of video file, in order to, on the basis of using multimedia chip continuously shot images, to extract each two field picture and to generate video file.The generation method of a kind of video file that the present invention provides includes: be saved in being continuously shot the continuous multiple frames image obtained in default caching;According to the mark of each two field picture, determine from the caching preserving continuous multiple frames image and read each frame image data;Utilize the view data read, generate video file.A kind of video file generating means that the present invention provides, including: data write unit, for being saved in being continuously shot the continuous multiple frames image obtained in default caching;Data-reading unit, for the mark according to each two field picture, determines from the caching preserving continuous multiple frames image and reads each frame image data;Signal generating unit, for utilizing the view data read, generates video file.The present invention is used for quickly generating video file.
Description
Technical field
The present invention relates to technical field of image processing, particularly relate to generation method and the dress of a kind of video file
Put.
Background technology
Existing mobile phone, is required for camera chip and can support the video file of recording standard, and permissible
PC is play.But, in camera chip, the frame per second of video recording suffers from chip and takes pictures speed
Restriction, and be unable to reach frame per second requirement.
In order to improve the speed shooting each two field picture, prior art proposes the continuous bat of multimedia chip
Camera shooting function, this function can serialograph.At present, a lot of camera chips is all supported to be continuously shot
Function, obtain the image of continuous multiple frames jpg form, simply the view data of these multiframe jpg forms is
Continuous print rather than each frame image data are all independent view data, i.e. cannot be distinguished by each two field picture.
Therefore, prior art cannot by multimedia chip be continuously shot function, obtain each two field picture also
Generate video file.
Summary of the invention
Embodiments provide the generation method and device of a kind of video file, in order to use multimedia
On the basis of chip continuously shot images, extract each two field picture and generate video file.
The generation method of a kind of video file that the embodiment of the present invention provides includes:
It is saved in being continuously shot the continuous multiple frames image obtained in default caching;
According to the mark of each two field picture, determine from the caching preserving continuous multiple frames image and read each
Frame image data;
Utilize the view data read, generate video file.
The generating means of a kind of video file that the embodiment of the present invention provides includes:
Data write unit, for being saved in default caching by being continuously shot the continuous multiple frames image obtained
In;
Data-reading unit, for the mark according to each two field picture, from preserving the slow of continuous multiple frames image
Determine in depositing and read each frame image data;
Signal generating unit, for utilizing the view data read, generates video file.
The embodiment of the present invention, by being saved in default caching by being continuously shot the continuous multiple frames image obtained
In;According to the mark of each two field picture, determine from the caching preserving continuous multiple frames image and read each
Frame image data;Utilize the view data read, generate video file, thus using multimedia chip
On the basis of continuously shot images, according to the mark of each two field picture, extract each two field picture, and utilization carries
The each two field picture taken can quickly generate video file, it is achieved that is continuously shot merit by multimedia chip
Can, quickly generate the technical scheme of video file.
Accompanying drawing explanation
Fig. 1 generates the overall procedure schematic diagram of method for a kind of video file that the embodiment of the present invention provides;
Fig. 2 generates the idiographic flow schematic diagram of method for a kind of video file that the embodiment of the present invention provides;
The structural representation of a kind of video file generating means that Fig. 3 provides for the embodiment of the present invention.
Detailed description of the invention
Embodiments provide the generation method and device of a kind of video file, in order to use multimedia
On the basis of chip continuously shot images, extract each two field picture and generate video file.
The technical scheme that the embodiment of the present invention provides, can be at the base using multimedia chip continuously shot images
On plinth, by the way of Double buffer (buffer), quickly remove each two field picture, to generate regarding of standard
Frequency file.
The technical scheme provided the embodiment of the present invention below in conjunction with the accompanying drawings illustrates.
Seeing Fig. 1, a kind of video file that the embodiment of the present invention provides generates method and includes step:
S101, it is saved in being continuously shot the continuous multiple frames image obtained in default caching.
S102, mark according to each two field picture, determine from the caching preserving continuous multiple frames image and read
Take each frame image data.
The view data that S103, utilization read, generates video file.
It is saved in being continuously shot the continuous multiple frames image obtained in default caching it is preferred that described, including:
In the caching that will be continuously shot in two cachings that the continuous multiple frames image write obtained is preset, when
This caching is filled with data, and another caching is for time empty, will be continuously shot the continuous multiple frames image write obtained
In another caching described;
Wherein, for writing the caching of view data and for reading the caching of view data, cache for difference.
It is to say, in the embodiment of the present invention, by the way of ping-pong buffer, it is achieved the write of view data
With read operation, after a buffer write, by being continuously shot, the continuous multiple frames image write obtained is another
One buffer, when reading view data, determines from the buffer that write is complete and reads each two field picture number
According to.
In the embodiment of the present invention, the speed of the view data read in buffer can be set, than write buffer
In the speed of view data fast, thus ensure the view data needing to write buffer, buffer will not be covered
In the view data that is not read.It is of course also possible to arrange the speed of the view data read in buffer,
Identical with the speed of the view data in write buffer, but now need first to complete the write of a buffer
After operation, then it is read out the operation of view data, thus it is also ensured that needs to write the image of buffer
Data, will not cover the view data not being read in buffer.
It is preferred that the described mark according to each two field picture, from the caching preserving continuous multiple frames image really
Determine and read each frame image data, including:
Search opening flag and the end mark of each two field picture, according to opening flag and the knot of each two field picture
Bundle flag, reads each frame image data from caching.
It is preferred that the opening flag of each two field picture of described lookup and end mark, including:
When finding the opening flag of current frame image, utilize the length of multiple image before current frame image
Degree, the length of estimation current frame image;
Utilize the length of the current frame image being estimated to, search the end mark of current frame image.
It is preferred that the length of current frame image that described utilization is estimated to, search the end mark of current frame image
Will, including:
The length of the current frame image being estimated to is multiplied by default proportionality coefficient, obtains jump length;
According to the opening flag of current frame image, and jump length, determine the end searching current frame image
The original position of mark, begins look for the end mark of current frame image from this original position.
Concrete explanation is given below.
Multimedia chip shoots VGA picture needs the time of more than 1 second, and recording function need be
System can be the time restriction of the every pictures of shooting at about 100ms, and multimedia chip performance is just proposed by this
One new challenge.In order to improve the formation speed of video file, the embodiment of the present invention needs to use many matchmakers
Body chip be continuously shot function, this function can serialograph, but the data of these photos are even
Continue.Therefore, the embodiment of the present invention needs on the basis of this function, carries out Algorithm Analysis, quickly reads
Video file is write after every image, and compression.Therefore, the embodiment of the present invention is firstly the need of starting many matchmakers
Body chip be continuously shot function, to obtain continuous multiple frames image.
Further, the embodiment of the present invention provides two buffer, such as, for ABuffer and BBuffer.When
After system is continuously shot multiple image, by two buffer, in the way of table tennis, carry out the write of view data
With the operation read.
During wherein it is desired to read data from a buffer, by finding the opening flag (example of an image
As: 0XFF 0XD8), and end mark (such as: 0XFF 0XD9), determine the number of an image
According to length, but, if every image is all from the beginning of first bit (byte), each ratio is specially carried out
Search end mark backward, until find end mark, efficiency can ratio relatively low, therefore, the embodiment of the present invention
In can by smooth manner come saltatory search end mark, i.e. when find current frame image start mark
During will, utilize the length of multiple image before current frame image, the length of estimation current frame image;Utilize
The length of the current frame image being estimated to, searches the end mark of current frame image.Specifically, estimation is utilized
The length of the current frame image arrived, when searching the end mark of current frame image, the present frame figure that will be estimated to
The length of picture is multiplied by default proportionality coefficient, obtains jump length;According to the opening flag of current frame image,
And jump length, determine the original position of the end mark searching current frame image, open from this original position
Begin to search the end mark of current frame image.
Wherein, the concrete formula that the length of estimation current frame image is used, such as:
Length_N=(Length_ (N-3)+Length_ (N-2)+Length_ (N-1))/3
Wherein, Length_N represents the estimation length of nth frame image, and N is more than or equal to 3, i.e. from the 4th
Two field picture begins with the length of this formula estimation image.
Obviously, according to actual needs, it would however also be possible to employ other formula obtain the estimation length of image.
The most such as:
Length_N=(Length_ (N-2)+Length_ (N-1))/2
Wherein, Length_N still represents the estimation length of nth frame image, and now N is more than or equal to 2,
The length of this formula estimation image is i.e. begun with from the 3rd two field picture.
In this manner it is possible to after finding the head position of current frame image so that it is it is moved rearwards by Length_N's
The length byte of certain proportion (such as: 3/4 or 1/2 etc.), starts to search end mark backward from there
0XFF 0XD9, thus, the speed determining each two field picture can be made to be greatly improved, and without bit-by-bit position
Make a look up.
After obtaining the view data of each frame independence, Fast Compression is also deposited to default video file, finally
Generated video file by multiple image data and voice data, such as, generate AVI, MP4 or 3GP
The video file of form.
The illustration of an idiographic flow is given below.
Seeing Fig. 2, a kind of video file that the embodiment of the present invention provides generates method and includes step:
S201, multimedia chip continuously shot images, obtain continuous print view data.
S202, initial time, (time initial, ABuffer is empty, and works as ABuffer can first to use ABuffer
In view data be all read after, ABuffer is empty) receive continuous print view data.
It is of course also possible to first receive continuous print view data with BBuffer.
S203, judge that the memory space of Abuffer is the fullest, if it is, perform step S204, with
And step S210;Otherwise, perform step S202, continue to receive continuous print view data with ABuffer,
Until ABuffer is filled with data.
S204, when BBuffer be that empty (time initial, BBuffer is sky, and when the image in BBuffer
After data are all read, BBuffer is empty) time, BBuffer receives continuous print view data.
S205, judge that the memory space of BBuffer is the fullest, if it is, perform step S206, with
And step S208;Otherwise, perform step S204, continue to receive continuous print view data with BBuffer,
Until BBuffer is filled with data.
S206, from BBuffer, determine and read a two field picture, and be stored in default video literary composition after compressing
Part.
S207, judge the frame number of the image comprised in video file, if reach default video file needs
The amount of images comprised?If it is, terminate, otherwise, step S204 is performed.
S208, when ABuffer be empty (after the view data in ABuffer is all read, ABuffer
For sky) time, ABuffer receives continuous print view data.
S209, judge that the memory space of Abuffer is the fullest, if it is, perform step S204, with
And step S210;Otherwise, perform step S208, continue to receive continuous print view data with Abuffer,
Until BBuffer is filled with data.
S210, from ABuffer, determine and read a two field picture, and be stored in default video literary composition after compressing
Part.
S211, judge the frame number of the image comprised in video file, if reach default video file needs
The amount of images comprised?If it is, terminate, otherwise, step S208 is performed.
See Fig. 3, a kind of video file generating means that the embodiment of the present invention provides, including:
Data write unit 101, for being saved in default delaying by being continuously shot the continuous multiple frames image obtained
In depositing;
Data-reading unit 102, for the mark according to each two field picture, from preserving continuous multiple frames image
Caching in determine and read each frame image data;
Signal generating unit 103, for utilizing the view data read, generates video file.
It is preferred that described data write unit 101, by being continuously shot, the continuous multiple frames image write obtained is pre-
If two cachings in a caching in, when this caching is filled with data, and another caching is for time empty, will
It is continuously shot in the continuous multiple frames image write obtained another caching described;
Wherein, for writing the caching of view data and for reading the caching of view data, cache for difference.
It is preferred that described data-reading unit 102, including:
Tag lookup unit 201, for searching opening flag and the end mark of each two field picture;
Read unit 202, for the opening flag according to each two field picture and end mark, read from caching
Take each frame image data.
It is preferred that described tag lookup unit 201 includes:
Length evaluation unit 301, for when finding the opening flag of current frame image, utilizes present frame
The length of the multiple image before image, the length of estimation current frame image;
End mark searches unit 302, for utilizing the length of the current frame image being estimated to, searches current
The end mark of two field picture.
It is preferred that described end mark searches unit 302, the length of the current frame image being estimated to is multiplied by
The proportionality coefficient preset, obtains jump length;According to the opening flag of current frame image, and jump length,
Determine the original position of the end mark searching current frame image, begin look for present frame figure from this original position
The end mark of picture.
In sum, the embodiment of the present invention, by being saved in pre-by being continuously shot the continuous multiple frames image obtained
If caching in;Determine from caching and read each frame image data;Utilize the view data read,
Generate video file, thus on the basis of using multimedia chip continuously shot images, extract each frame figure
Picture, and utilize each two field picture of extraction can quickly generate video file.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or meter
Calculation machine program product.Therefore, the present invention can use complete hardware embodiment, complete software implementation or knot
The form of the embodiment in terms of conjunction software and hardware.And, the present invention can use and wherein wrap one or more
Computer-usable storage medium containing computer usable program code (include but not limited to disk memory and
Optical memory etc.) form of the upper computer program implemented.
The present invention is with reference to method, equipment (system) and computer program product according to embodiments of the present invention
The flow chart of product and/or block diagram describe.It should be understood that can by computer program instructions flowchart and
/ or block diagram in each flow process and/or flow process in square frame and flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embedding
The processor of formula datatron or other programmable data processing device is to produce a machine so that by calculating
The instruction that the processor of machine or other programmable data processing device performs produces for realizing at flow chart one
The device of the function specified in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or the process of other programmable datas can be guided to set
In the standby computer-readable memory worked in a specific way so that be stored in this computer-readable memory
Instruction produce and include the manufacture of command device, this command device realizes in one flow process or multiple of flow chart
The function specified in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, makes
Sequence of operations step must be performed to produce computer implemented place on computer or other programmable devices
Reason, thus the instruction performed on computer or other programmable devices provides for realizing flow chart one
The step of the function specified in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
Obviously, those skilled in the art can carry out various change and modification without deviating from this to the present invention
Bright spirit and scope.So, if the present invention these amendment and modification belong to the claims in the present invention and
Within the scope of its equivalent technologies, then the present invention is also intended to comprise these change and modification.
Claims (4)
1. a video file generates method, it is characterised in that the method includes:
It is saved in being continuously shot the continuous multiple frames image obtained in default caching;
Search the opening flag of each two field picture, when finding the opening flag of current frame image, utilize and work as
The length of the multiple image before prior image frame, the length of estimation current frame image;
The length of the current frame image being estimated to is multiplied by default proportionality coefficient, obtains jump length;
According to the opening flag of current frame image, and jump length, determine the end searching current frame image
The original position of mark, begins look for the end mark of current frame image from this original position;
Opening flag according to each two field picture and end mark, from the caching preserving continuous multiple frames image
Determine and read each frame image data;
Utilize the view data read, generate video file.
Method the most according to claim 1, it is characterised in that described will be continuously shot the company obtained
Continuous multiple image is saved in default caching, including:
In the caching that will be continuously shot in two cachings that the continuous multiple frames image write obtained is preset, when
This caching is filled with data, and another caching is for time empty, will be continuously shot the continuous multiple frames image write obtained
In another caching described;
Wherein, for writing the caching of view data and for reading the caching of view data, cache for difference.
3. a video file generating means, it is characterised in that this device includes:
Data write unit, for being saved in default caching by being continuously shot the continuous multiple frames image obtained
In;
Data-reading unit, for the mark according to each two field picture, from preserving the slow of continuous multiple frames image
Determine in depositing and read each frame image data;
Signal generating unit, for utilizing the view data read, generates video file;
Wherein, described data-reading unit, including:
Tag lookup unit, for searching opening flag and the end mark of each two field picture;
Read unit, for the opening flag according to each two field picture and end mark, read every from caching
One frame image data;
Described tag lookup unit includes:
Length evaluation unit, for when finding the opening flag of current frame image, utilizes current frame image
The length of multiple image before, the length of estimation current frame image;
End mark searches unit, and the length of the current frame image being estimated to is multiplied by default proportionality coefficient,
Obtain jump length;According to the opening flag of current frame image, and jump length, determine lookup present frame
The original position of the end mark of image, begins look for the end mark of current frame image from this original position.
Device the most according to claim 3, it is characterised in that described data write unit, will be even
In a caching in two cachings that the continuous multiple frames image write that continuous shooting obtains is preset, when this caching is deposited
Full data, and another caching is for time empty, by be continuously shot the continuous multiple frames image write obtained described another
In caching;
Wherein, for writing the caching of view data and for reading the caching of view data, cache for difference.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110024022.8A CN102143318B (en) | 2011-01-21 | 2011-01-21 | A kind of generation method and device of video file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110024022.8A CN102143318B (en) | 2011-01-21 | 2011-01-21 | A kind of generation method and device of video file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102143318A CN102143318A (en) | 2011-08-03 |
CN102143318B true CN102143318B (en) | 2016-08-17 |
Family
ID=44410517
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110024022.8A Active CN102143318B (en) | 2011-01-21 | 2011-01-21 | A kind of generation method and device of video file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102143318B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105446458B (en) * | 2012-08-22 | 2018-09-04 | 宏碁股份有限公司 | Power-supply management system and method for managing power supply |
CN104079835A (en) * | 2014-07-02 | 2014-10-01 | 深圳市中兴移动通信有限公司 | Method and device for shooting nebula videos |
CN104243886B (en) * | 2014-09-28 | 2018-07-20 | 中国电子科技集团公司第二十七研究所 | A kind of high speed image parsing and video generation method based on plug-in part technology |
CN107562860B (en) * | 2017-08-29 | 2019-06-07 | 维沃移动通信有限公司 | A kind of photo choosing method and mobile terminal |
CN115766677B (en) * | 2023-01-09 | 2023-04-25 | 深圳曦华科技有限公司 | Frame rate conversion method and device for video mode |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1655042A (en) * | 2004-02-13 | 2005-08-17 | 上海乐金广电电子有限公司 | Digital slowing shutter control method for monitoring camera |
CN101001375A (en) * | 2007-01-18 | 2007-07-18 | 北京中星微电子有限公司 | Method and device for collecting image |
CN101547360A (en) * | 2009-05-08 | 2009-09-30 | 南京师范大学 | Localizable video file format and method for collecting data of formatted file |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6539055B1 (en) * | 1999-12-03 | 2003-03-25 | Intel Corporation | Scene change detector for video data |
CN101448061A (en) * | 2008-12-26 | 2009-06-03 | 北京中星微电子有限公司 | Image processing device and method |
-
2011
- 2011-01-21 CN CN201110024022.8A patent/CN102143318B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1655042A (en) * | 2004-02-13 | 2005-08-17 | 上海乐金广电电子有限公司 | Digital slowing shutter control method for monitoring camera |
CN101001375A (en) * | 2007-01-18 | 2007-07-18 | 北京中星微电子有限公司 | Method and device for collecting image |
CN101547360A (en) * | 2009-05-08 | 2009-09-30 | 南京师范大学 | Localizable video file format and method for collecting data of formatted file |
Also Published As
Publication number | Publication date |
---|---|
CN102143318A (en) | 2011-08-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102143318B (en) | A kind of generation method and device of video file | |
WO2018149176A1 (en) | Method and apparatus for automatically recording video, and terminal | |
CN103186919B (en) | A kind of word rendering intent and device | |
CN104599692B (en) | The way of recording and device, recording substance searching method and device | |
RU2011124896A (en) | STARTING ANIMATION ACTIONS AND ACTIONS OF MEDIA OBJECTS | |
US20130154956A1 (en) | Stylus Device | |
CN103780973A (en) | Video label adding method and video label adding device | |
US10283168B2 (en) | Audio file re-recording method, device and storage medium | |
CN103136348B (en) | A kind of document display method and device | |
WO2012106969A1 (en) | Log management device and method | |
WO2014206270A1 (en) | Method, apparatus, and device for detecting length of time of use of battery | |
CN105898523A (en) | Video playing method and video playing device | |
CN103716573B (en) | A kind of method and apparatus of video playback | |
EP2105931A3 (en) | Information storage medium including meta data for multi-angle title, and apparatus and method for reproducing the same | |
KR20140078171A (en) | A method for play a contents of augmented reality and a system for excuting the method | |
CN101656814A (en) | Method and device for adding sound file to JPEG file | |
KR20140004240A (en) | Image browsing method, system and computer storage medium | |
KR101523971B1 (en) | Terminal executing function of voice recording and method for processing image thereof | |
TW201537275A (en) | Time-lapse photography method, its computer program product, and electrical device with image-capturing function thereof | |
CN104967770B (en) | Video capture method and device | |
WO2017076027A1 (en) | Wallpaper processing method and apparatus | |
US20070223682A1 (en) | Electronic device for identifying a party | |
CN105528348B (en) | Media file processing method and device | |
US9071735B2 (en) | Name management and group recovery methods and systems for burst shot | |
CN103761227B (en) | A kind of caching method and device based on file |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C41 | Transfer of patent application or patent right or utility model | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20160524 Address after: 519031 Guangdong city of Zhuhai province Hengqin Baohua Road No. 6, room 105 -478 Applicant after: GUANGDONG ZHONGXING ELECTRONICS CO., LTD. Address before: 100083, Haidian District, Xueyuan Road, Beijing No. 35, Nanjing Ning building, 15 Floor Applicant before: Beijing Vimicro Corporation |
|
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |