[go: up one dir, main page]

CN102891996B - The method and system of estimation gif file recording time - Google Patents

The method and system of estimation gif file recording time Download PDF

Info

Publication number
CN102891996B
CN102891996B CN201110203057.8A CN201110203057A CN102891996B CN 102891996 B CN102891996 B CN 102891996B CN 201110203057 A CN201110203057 A CN 201110203057A CN 102891996 B CN102891996 B CN 102891996B
Authority
CN
China
Prior art keywords
time
compression ratio
recording
estimation
gif
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
Application number
CN201110203057.8A
Other languages
Chinese (zh)
Other versions
CN102891996A (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.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp 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 China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN201110203057.8A priority Critical patent/CN102891996B/en
Publication of CN102891996A publication Critical patent/CN102891996A/en
Application granted granted Critical
Publication of CN102891996B publication Critical patent/CN102891996B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention openly estimates the method and system of gif file recording time, the compression ratio of segmentation evaluation time unit, according to the compression ratio estimation residual compression ratio of all time quantums estimated; According to the compression ratio of resolution, recording frame number per second and time quantum, the GIF size of evaluation time unit, the GIF size of the cumulative all time quantums estimated, obtains accumulated value; Judge whether accumulated value is less than maximum limit definite value, if so, maximum limit definite value is deducted accumulated value and obtain remaining size; According to residue size, residual compression ratio, resolution and recording frame number per second, estimation recording time left.The present invention improves the accuracy estimating GIF recording time by size, meets the demand that user records GIF by size.

Description

The method and system of estimation gif file recording time
Technical field
The present invention relates to field of computer multimedia, particularly the method and system of maximum limit definite value dynamic estimation gif file recording time by size.
Background technology
Viewing video becomes the general study of numerous Internet users and entertainment way.In viewing process, many users wish brief fragment to preserve, and are shared with other users by channels such as QQ, forum or social network sites.
The graphics standard that GIF extensively supports as a kind of Web, JICQ and image software etc., supports brief animation with it, the advantage such as little, the rapid decompression of taking up room, and becomes the first-selection of users.GIF (GraphicsInterchangeFormat, GIF(Graphic Interchange format)) be the image file storage format that CompuServe company develops, the gif file format version number of exploitation in 1987 is GIF87a, and within 1989, expand, the version number after expansion is defined as GIF89a.GIF image file carrys out the relevant information of memory image in units of data block.Gif file is made up of the control information block of the data block of presentation graphic/image, data sub-block and display graphics/image, is called GIF data flow.All control information blocks in data flow and data block all must between file header and end of file blocks.Gif file form have employed LZW (Lempel-ZivWalch) compression algorithm and carrys out storing image data, defines and permits a user to transparent (transparency) attribute that image arranges background.In addition, gif file form can deposit several color graphics/images in one file.If deposited several figure in gif file, they can show or demonstrate as animation as lantern slide.
The channels such as current QQ, forum or social network sites have done strict restriction to the gif file size that user uploads, the gif file size be such as published on QQ group can not more than 1M, therefore most of user wishes the time of maximum limit definite value estimation recording gif file by size, thus controls recording time more accurately in the process of displaying video.Although QQ is audio-visual and other multi-media recording instrument provides the function recording GIF animation, user can only be allowed to record according to reproduction time, be difficult to the size controlling gif file, cause the size of the gif file after recording easily to exceed maximum limit definite value.
The feature of GIF itself determines the maximum limit definite value estimation recording time be difficult to by size, and on the one hand, GIF calculates compression ratio frame by frame, and therefore compression ratio is dynamic change, is difficult to just calculate recording time more accurately before recording; On the other hand, the compression time of GIF generally much larger than recording time, so be also not suitable for adopt recording limit, limit compression method.
Summary of the invention
In view of more than, the present invention proposes the method and system estimating gif file recording time.
The present invention proposes the method estimating gif file recording time, comprises the following steps:
Initialization maximum limit definite value, resolution, recording frame number per second and time quantum length;
The compression ratio of segmentation evaluation time unit, according to the compression ratio estimation residual compression ratio of all time quantums estimated;
According to the compression ratio of resolution, recording frame number per second and time quantum, the GIF size of evaluation time unit, the GIF size of the cumulative all time quantums estimated, obtains accumulated value;
Judge whether accumulated value is less than maximum limit definite value, if so, maximum limit definite value is deducted accumulated value and obtain remaining size;
According to residue size, residual compression ratio, resolution and recording frame number per second, estimation recording time left.
The present invention also proposes the system estimating gif file recording time, comprising:
Initialization module, initialization maximum limit definite value, resolution, recording frame number per second and time quantum;
Judge module, judges whether accumulated value is less than limit value;
Estimation block, is coupled in initialization module and judge module, the compression ratio of segmentation evaluation time unit, according to the compression ratio estimation residual compression ratio of all time quantums estimated; According to the compression ratio of resolution, recording frame number per second and time quantum, the GIF size of evaluation time unit, the GIF size of the cumulative all time quantums estimated, obtains accumulated value; When accumulated value is less than limit value, maximum limit definite value is deducted accumulated value and obtain remaining size, according to residue size, residual compression ratio, resolution and recording frame number per second, estimation recording time left.
The present invention records instrument to existing GIF and adopts recording time estimating algorithm more accurately, improves the accuracy estimating GIF recording time by size, meets the demand that user records GIF by size.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet that the present invention estimates gif file recording time.
Fig. 2 is the system configuration schematic diagram that the present invention estimates gif file recording time.
Embodiment
With reference to the accompanying drawings the present invention is described more fully, exemplary embodiment of the present invention is wherein described.
As shown in Figure 1, for the present invention estimates the schematic flow sheet of gif file recording time.The flow process of the present embodiment comprises the following steps:
Each key element such as step 101, initialization maximum limit definite value Qc, resolution Dc, recording frame number Fc per second, time quantum length t;
Wherein:
Maximum limit definite value Qc is constant, is the gif file size maximum that publication channel specifies.
Resolution Dc is constant, and gif file records area size.
Recording frame number Fc per second is constant, the frame number recorded from multimedia video per second.
Time quantum t is constant, chooses the time interval with processed frame sample, the interval of namely sampling.
The compression ratio of step 102, segmentation evaluation time unit;
In an embodiment, from first time quantum, the operation of the compression ratio of evaluation time unit can be, chooses frame sample respectively compress, using the compression ratio Cn of the mean value of two compression ratios as current time unit in t/4 and the 3t/4 moment of the n-th time quantum.Wherein, frame sign before the rear Zheng great little of frame sample compression ratio=compression compresses, the great little of the rear gif file of file compression rate=compression compresses front video file size.
The moment carrying out compressing not necessarily will select t/4 and 3t/4, selects these two moment to be to make the moment of sampling more even.Selecting two sampling instants in a time quantum, is the mean value in order to get two compression ratios, makes the average compression ratio of compression ratio closer to whole time quantum of sampling.Certainly, it will be understood by those skilled in the art that sampling instant is not limited to two, also can be 3,4 or other.The corresponding modify that embodiment of the present invention basis is done and distortion, within the protection range that all should cover this claim.
The compression ratio estimation residual compression of all time quantums that step 103, basis have been estimated compares C;
In an embodiment, after the compression ratio of evaluation time unit, all will calculate residual compression ratio, the operation according to the compression ratio estimation residual compression ratio of all time quantums estimated can be that the mean value of the compression ratio of all time quantums estimated is compared C as residual compression.Certainly, also can be out of shape the formula calculating residual compression ratio on this basis, such as, calculate again after certain compression ratio is weighted.
Step 104, compression ratio Cn according to resolution Dc, recording frame number Fc per second and time quantum, the GIF size of evaluation time unit, the GIF size of the cumulative all time quantums estimated, obtains accumulated value;
In an embodiment, the operation of the GIF size of evaluation time unit can be Qn=Dc × Fc × t × Cn, certainly, also can be out of shape formula on this basis, such as, calculates after being weighted to certain parameter again.
The GIF sizes values of step 105, the cumulative all time quantums estimated, obtains accumulated value Qa;
Step 106, judge whether accumulated value Qa is less than maximum limit definite value Qc, if so, perform step 107, otherwise perform step 110 and step 112, namely terminate estimation process and recording process, end order in no particular order, also can terminate simultaneously;
Step 107, maximum limit definite value Qc deducted accumulated value Qa and obtain remaining size delta Q;
Step 108, according to residue size, residual compression ratio, resolution and recording frame number per second, estimation recording time left.
In an embodiment, the operation of estimation recording time left can be Δ T=Δ Q/ (Dc × Fc × C), certainly, also can be out of shape formula on this basis, such as, calculate after being weighted to certain parameter again.
Perform step 108, completed the operation of estimation recording time left, this method flow process can also comprise the following steps:
Step 109, judge whether recording time left Δ T is greater than t, if so, jumps to step 102, continues the estimation of next time quantum, otherwise, perform step 110 ~ step 112;
Step 110, end estimation process;
Step 111, recording Δ T time;
Step 112, end recording process.
Fig. 2 is the system that the present invention estimates gif file recording time, comprising: initialization module, judge module and estimation block, wherein:
Initialization module, initialization maximum limit definite value, resolution, recording frame number per second and time quantum length;
Judge module, judges whether accumulated value is less than limit value;
Estimation block, is coupled in initialization module and judge module, the compression ratio of segmentation evaluation time unit, according to the compression ratio estimation residual compression ratio of all time quantums estimated; According to the compression ratio of resolution, recording frame number per second and time quantum, the GIF size of evaluation time unit, the GIF size of the cumulative all time quantums estimated, obtains accumulated value; When accumulated value is less than limit value, maximum limit definite value is deducted accumulated value and obtain remaining size, according to residue size, residual compression ratio, resolution and recording frame number per second, estimation recording time left.
In an embodiment, the estimation process of estimation block is: using the mean value of the compression ratio of all time quantums estimated as residual compression ratio; Estimation recording time left=residue size/(resolution × recording frame number per second × residual compression ratio); And/or the GIF size=resolution of time quantum × recording frame number per second × time quantum length × time quantum compression ratio.Certainly, also can carry out being out of shape or revising on the basis of above-mentioned formula, such as calculate again after certain parameter weighting.
In an alternative embodiment of the invention, when judge module judges that accumulated value is more than or equal to maximum limit definite value, notice estimation block terminates estimation process.
In an alternative embodiment of the invention, judge module also judges whether recording time left is greater than time quantum, and if so, notice estimation block continues the estimation of next time quantum, otherwise notice estimation block terminates estimation process.
The present invention proposes the method for maximum limit definite value dynamic estimation GIF recording time by size, in recording process, choose frame sample in real time compress, thus dynamically estimate compression ratio and residual compression ratio, also cumulative according to the GIF size of this compression ratio evaluation time unit, when accumulated value is less than maximum limit definite value, obtain the residue size that can continue to compress, according to parameter estimation recording time left such as residue size, residual compression ratio etc.The present invention improves the accuracy estimating GIF recording time by size, meets the demand that user records GIF by size.Avoid the overlong time or too short recorded, affect the experience of user.
The present invention can be widely used in GIF and record instrument, also the GIF of hommization more can be provided to intercept function, the intercepting function of augmented video for the client software such as instant chat, multimedia player.During user operation, first to determine the GIF size, resolution and the frame per second that limit.
Description of the invention provides in order to example with for the purpose of describing, and is not exhaustively or limit the invention to disclosed form.Many modifications and variations are obvious for the ordinary skill in the art.Selecting and describing embodiment is in order to principle of the present invention and practical application are better described, and enables those of ordinary skill in the art understand the present invention thus design the various embodiments with various amendment being suitable for special-purpose.

Claims (7)

1. estimate the method for gif file recording time, comprise the following steps:
Initialization maximum limit definite value, resolution, recording frame number per second and time quantum length;
The compression ratio of segmentation evaluation time unit, according to the compression ratio estimation residual compression ratio of all time quantums estimated;
According to the compression ratio of resolution, recording frame number per second and time quantum, the GIF size of evaluation time unit, namely, the compression ratio of the GIF size=resolution × recording frame number per second × time quantum length × time quantum of time quantum, the GIF size of the cumulative all time quantums estimated, obtains accumulated value;
Judge whether accumulated value is less than maximum limit definite value, if so, maximum limit definite value is deducted accumulated value and obtain remaining size;
According to residue size, residual compression ratio, resolution and recording frame number per second, estimation recording time left, that is, estimate recording time left=residue size/(resolution × recording frame number per second × residual compression ratio).
2. estimate the method for gif file recording time according to claim 1, estimation recording time left, further comprising the steps of:
Judge whether recording time left is greater than time quantum length, if so, continue the estimation of next time quantum, otherwise terminate estimation process, and after recording recording time left, terminate recording process.
3. according to claim 1 or 2, estimate the method for gif file recording time, judge whether accumulated value is less than maximum limit definite value, further comprising the steps of:
When accumulated value is more than or equal to maximum limit definite value, terminate estimation process and recording process.
4. according to claim 1 or 2, estimate the method for gif file recording time, the compression ratio according to all time quantums estimated estimates being operating as of residual compression ratio:
Using the mean value of the compression ratio of all time quantums estimated as residual compression ratio.
5. estimate the system of gif file recording time, comprising:
Initialization module, initialization maximum limit definite value, resolution, recording frame number per second and time quantum;
Judge module, judges whether accumulated value is less than limit value;
Estimation block, is coupled in initialization module and judge module, the compression ratio of segmentation evaluation time unit, according to the compression ratio estimation residual compression ratio of all time quantums estimated; According to the compression ratio of resolution, recording frame number per second and time quantum, the GIF size of evaluation time unit, the GIF size of the cumulative all time quantums estimated, obtains accumulated value; When accumulated value is less than limit value, maximum limit definite value is deducted accumulated value and obtain remaining size, according to residue size, residual compression ratio, resolution and recording frame number per second, estimation recording time left; Wherein, the estimation process of estimation block is: using the mean value of the compression ratio of all time quantums estimated as residual compression ratio; Estimation recording time left=residue size/(resolution × recording frame number per second × residual compression ratio); And/or the compression ratio of the GIF size=resolution of time quantum × recording frame number per second × time quantum length × time quantum.
6. estimate the system of gif file recording time according to claim 5, wherein:
Judge module also judges whether recording time left is greater than time quantum, and if so, notice estimation block continues the estimation of next time quantum, otherwise notice estimation block terminates estimation process.
7. according to claim 5 or 6, estimate the system of gif file recording time, wherein:
When judge module judges that accumulated value is more than or equal to maximum limit definite value, notice estimation block terminates estimation process.
CN201110203057.8A 2011-07-20 2011-07-20 The method and system of estimation gif file recording time Active CN102891996B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110203057.8A CN102891996B (en) 2011-07-20 2011-07-20 The method and system of estimation gif file recording time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110203057.8A CN102891996B (en) 2011-07-20 2011-07-20 The method and system of estimation gif file recording time

Publications (2)

Publication Number Publication Date
CN102891996A CN102891996A (en) 2013-01-23
CN102891996B true CN102891996B (en) 2016-01-13

Family

ID=47535341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110203057.8A Active CN102891996B (en) 2011-07-20 2011-07-20 The method and system of estimation gif file recording time

Country Status (1)

Country Link
CN (1) CN102891996B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1314045A (en) * 1999-04-15 2001-09-19 索尼公司 Imaging device and signal processing method
US20050047916A1 (en) * 2003-08-29 2005-03-03 Datech Technology Co., Ltd. Modified centrifugal fan wheel

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100586693B1 (en) * 1999-04-22 2006-06-08 에스케이 텔레콤주식회사 Image conversion processing apparatus for reducing the size of image data and method of reducing image data size
JP3653058B2 (en) * 2002-04-15 2005-05-25 埼玉日本電気株式会社 Mobile phone and image display method in mobile phone

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1314045A (en) * 1999-04-15 2001-09-19 索尼公司 Imaging device and signal processing method
US20050047916A1 (en) * 2003-08-29 2005-03-03 Datech Technology Co., Ltd. Modified centrifugal fan wheel

Also Published As

Publication number Publication date
CN102891996A (en) 2013-01-23

Similar Documents

Publication Publication Date Title
CN112291627B (en) Video editing method and device, mobile terminal and storage medium
US8582952B2 (en) Method and apparatus for identifying video transitions
KR101494904B1 (en) Method and apparatus for generating thumbnails for video files
WO2017079056A1 (en) Streaming data associated with cells in spreadsheets
US20080055314A1 (en) Pillarboxing correction
KR20180132946A (en) Multi-view scene segmentation and propagation
KR20070090751A (en) Image display method and video player
EP2958104A1 (en) Image reproduction apparatus and method for simultaneously displaying multiple moving-image thumbnails
CN105025094A (en) Multi-screen interaction method and system
CN114071223A (en) Generation method, storage medium and terminal device for video frame insertion based on optical flow
CN115334335B (en) Video frame inserting method and device
CN106507200A (en) Video-frequency playing content insertion method and system
KR20150012291A (en) Animation playing method, device and apparatus
CN114374872A (en) Video generation method and device, electronic equipment and storage medium
CN102164264A (en) Moving image editing apparatus and method
CN102577364B (en) Moving image playback device and moving image playback method
CN111968200A (en) GIF file generation method based on hand-drawn video
CN102891996B (en) The method and system of estimation gif file recording time
JP4667356B2 (en) Video display device, control method therefor, program, and recording medium
CN109874024A (en) A kind of barrage processing method, system and storage medium based on dynamic video poster
CN118093899A (en) Artificial intelligent personal multimedia storage device and playing system and method thereof
CN115334334B (en) Video frame inserting method and device
US20230141277A1 (en) Immersive learning application framework for video with document overlay control
CA2566787C (en) Method for synthesizing dynamic virtual figures
CN117891971B (en) Video editing system management method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant