CN103024394A - Video file editing method and device - Google Patents

Video file editing method and device Download PDF

Info

Publication number
CN103024394A
CN103024394A CN2012105923362A CN201210592336A CN103024394A CN 103024394 A CN103024394 A CN 103024394A CN 2012105923362 A CN2012105923362 A CN 2012105923362A CN 201210592336 A CN201210592336 A CN 201210592336A CN 103024394 A CN103024394 A CN 103024394A
Authority
CN
China
Prior art keywords
frame
predictive
key frame
montage
description document
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.)
Pending
Application number
CN2012105923362A
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
TRANSFER INTERACTION TOGETHER (BEIJING) TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TRANSFER INTERACTION TOGETHER (BEIJING) TECHNOLOGY Co Ltd filed Critical TRANSFER INTERACTION TOGETHER (BEIJING) TECHNOLOGY Co Ltd
Priority to CN2012105923362A priority Critical patent/CN103024394A/en
Publication of CN103024394A publication Critical patent/CN103024394A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The invention discloses video file editing method and device and aims to allow for editing from any frame. According to the technical scheme, the method includes: judging the frame starting to be edited is a key frame or predicted frame; if the frame is the key frame, editing from the key frame; if the frame is the predicted frame; and re-coding all predicted frames between the predicted frame and a next key frame so as to allow for editing from the converted key frame after converting the predicted frame starting to be edited into the key frame and converting other predicted frames into converted key frames.

Description

Video file clipping method and device
Technical field
The present invention relates to a kind of file montage technology, relate in particular to a kind of clipping method for video file and device.
Background technology
Video file record finish after, generally all can pass through montage, the processing such as splicing.For example one grade of news program may be trimmed into a plurality of video segments according to each event.There are a variety of video clipping softwares that the function of video editing is provided in the prior art.
Video file is alternately to be made of key frame (I frame) and predictive frame (P frame and B frame), and wherein I frame is own absolute coding, does not rely on other frame data; P frame relies on I frame data; Bframe relies on I frame, P frame or other B frame data; Predictive frame is used for predicting the variation of key frame, and its encoding and decoding depend on key frame.
In the prior art, the montage of video is if begin from predictive frame, and then montage file out has no idea to play, because the decoding of predictive frame will rely on key frame.Therefore can only from the key frame montage, have no idea to realize from the arbitrary frame montage in the prior art.
Summary of the invention
The object of the invention is to address the above problem, a kind of video file clipping method and device are provided, can realize beginning montage from arbitrary frame.
Technical scheme of the present invention is: the present invention has disclosed a kind of video file clipping method, and video file is alternately to be made of key frame and predictive frame, and described method comprises:
In key frame or the predictive frame which frame that the judgement montage begins be;
If key frame, then directly from this key frame montage, if predictive frame, then begin to re-start coding to all predictive frames between the rear key frame from this predictive frame, so that after this predictive frame that montage begins converts the predictive frame that key frame and remaining predictive frame converts the key frame after this conversion to, the key frame montage after this conversion.
According to an embodiment of video file clipping method of the present invention, this video file is the file that adopts the flv form of h264 coded system formation.
According to an embodiment of video file clipping method of the present invention, be the situation of predictive frame for montage place, the recompile process of predictive frame comprises:
Read the description document of this predictive frame and the description document of the key frame that this predictive frame relies on from file header;
According to the description document that reads, this predictive frame that reads is decoded into the yuv video sequence;
This predictive frame recompile is become new key frame and generates new description document, feed back to file header;
For each frame in remaining predictive frame, the description document of the key frame that reads the description document of all the other each predictive frames and rely on, according to the description document that reads all the other each predictive frames are decoded into the yuv video sequence, and recompile forms the predictive frame of described new key frame, feeds back to file header.
The present invention has also disclosed a kind of video file montage device, and video file is alternately to be made of key frame and predictive frame, and described device comprises:
In key frame or the predictive frame which frame of video determined property module, the frame that the judgement montage begins are;
Key frame montage module, if key frame, then directly from this key frame montage;
Predictive frame montage module, if predictive frame, then begin to re-start coding to all predictive frames between the rear key frame from this predictive frame, so that after this predictive frame that montage begins converts the predictive frame that key frame and remaining predictive frame converts the key frame after this conversion to, the key frame montage after this conversion.
According to an embodiment of video file montage device of the present invention, this video file is the file that adopts the flv form of h264 coded system formation.
Embodiment according to video file montage device of the present invention, this predictive frame montage module further comprises key frame modular converter and predictive frame recodification module, wherein the key frame modular converter comprises description document reading unit, decoding unit and recodification unit, wherein:
Described description document reading unit reads the description document of this predictive frame and the description document of the key frame that this predictive frame relies on from file header;
Described decoding unit according to the description document that reads, is decoded into the yuv video sequence with this predictive frame that reads;
Described recodification unit becomes this predictive frame recompile new key frame and generates new description document, feeds back to file header;
Described predictive frame recodification module, for each frame in remaining predictive frame, the description document of the key frame that reads the description document of all the other each predictive frames and rely on, according to the description document that reads all the other each predictive frames are decoded into the yuv video sequence, and recompile forms the predictive frame of described new key frame, feeds back to file header.
The present invention contrasts prior art following beneficial effect: the solution of the present invention is to judge whether key frame of frame that montage begins, if then directly montage of key frame, if predictive frame begins montage after then converting thereof into key frame.The contrast prior art, the present invention not only can begin montage from key frame, can also begin montage from predictive frame, has realized the montage to the video file arbitrary frame.
Description of drawings
Fig. 1 shows the flow chart of the preferred embodiment of video file clipping method of the present invention.
Fig. 2 shows the schematic diagram of the preferred embodiment of video file montage device of the present invention.
Embodiment
The invention will be further described below in conjunction with drawings and Examples.
Fig. 1 shows the flow process of the preferred embodiment of video file clipping method of the present invention.See also Fig. 1, the below is the detailed description to each implementation step of the video file clipping method of the present embodiment.In the present embodiment, video file can adopt the file of the flv form of h264 coded system formation.
Step 10: which in key frame or the predictive frame frame that the judgement montage begins be, if key frame then enters step S11, if predictive frame then enters step S12.
Step S11: directly from the key frame montage, flow process finishes.
Step S12: the predictive frame that begins from montage is carried out recompile, convert thereof into new key frame.
For this step, the specific implementation process is as follows.
Adopt the predictive code of the flv file of h264 coded system formation for example to be:
Figure BDA00002687605300031
Read the description document of predictive frame (what suppose the beginning montage is the 3rd frame) and the description document of the key frame (i.e. the 1st frame) that predictive frame relies on from file header.Then according to the description document that reads, the predictive frame that reads is decoded into the yuv video sequence.At last the predictive frame recompile is become new key frame and generate new description document, feed back to file header.
Step S13: the predictive frame that begins from montage is begun to re-start coding to all the other all predictive frames between the rear key frame, convert the predictive frame that depends on new key frame to.
Processing procedure to predictive frame (for example being the 3rd frame) among the cataloged procedure of remaining predictive frame and the step S12 is similar, comprise: read the description document of all the other each predictive frames and the description document of the key frame that relies on, according to the description document that reads all the other each predictive frames are decoded into the yuv video sequence, and recompile forms the predictive frame depend on new key frame, feeds back to file header.
Step S14: the key frame after conversion begins montage.
Fig. 2 shows the principle of the embodiment of video file montage device of the present invention.See also Fig. 2, the device of the present embodiment comprises: frame of video determined property module 10, key frame montage module 12, predictive frame montage module 14.In the present embodiment, video file is the file that adopts the flv form of h264 coded system formation.
In key frame or the predictive frame which frame that the 10 judgement montages of frame of video determined property module begin be.Key frame montage module 12 is to be the processing of key frame for the frame that montage begins, directly from the key frame montage.Predictive frame montage module 14 is to be the processing of predictive frame for the frame that montage begins, begin to re-start coding to all predictive frames between the rear key frame from predictive frame, so that the predictive frame that montage begins converts key frame and remaining predictive frame to convert the predictive frame that depends on the key frame after the conversion to after, the key frame montage after the conversion.
Predictive frame montage module 14 further comprises key frame modular converter 140 and predictive frame recodification module 142, and wherein key frame modular converter 140 comprises description document reading unit 1400, decoding unit 1402 and recodification unit 1404.
Description document reading unit 1400 reads the description document of predictive frame and the description document of the key frame that predictive frame relies on from file header.
Decoding unit 1402 is decoded into the yuv video sequence according to the description document that reads with the predictive frame that reads.
Recodification unit 1404 becomes the predictive frame recompile new key frame and generates new description document, feeds back to file header.
Predictive frame recodification module 1404 is for each frame in remaining predictive frame, the description document of the key frame that reads the description document of all the other each predictive frames and rely on, according to the description document that reads all the other each predictive frames are decoded into the yuv video sequence, and recompile forms the predictive frame depend on new key frame, feeds back to file header.
Above-described embodiment provides to those of ordinary skills and realizes and use of the present invention; those of ordinary skills can be in the situation that do not break away from invention thought of the present invention; above-described embodiment is made various modifications or variation; thereby protection scope of the present invention do not limit by above-described embodiment, and should be the maximum magnitude that meets the inventive features that claims mention.

Claims (6)

1. video file clipping method, video file is alternately to be made of key frame and predictive frame, described method comprises:
In key frame or the predictive frame which frame that the judgement montage begins be;
If key frame, then directly from this key frame montage, if predictive frame, then begin to re-start coding to all predictive frames between the rear key frame from this predictive frame, so that after this predictive frame that montage begins converts the predictive frame that key frame and remaining predictive frame converts the key frame after this conversion to, the key frame montage after this conversion.
2. video file clipping method according to claim 1 is characterized in that, this video file is the file that adopts the flv form of h264 coded system formation.
3. video file clipping method according to claim 2 is characterized in that, is the situation of predictive frame for montage place, and the recompile process of predictive frame comprises:
Read the description document of this predictive frame and the description document of the key frame that this predictive frame relies on from file header;
According to the description document that reads, this predictive frame that reads is decoded into the yuv video sequence;
This predictive frame recompile is become new key frame and generates new description document, feed back to file header;
For each frame in remaining predictive frame, the description document of the key frame that reads the description document of all the other each predictive frames and rely on, according to the description document that reads all the other each predictive frames are decoded into the yuv video sequence, and recompile forms the predictive frame of described new key frame, feeds back to file header.
4. video file montage device, video file is alternately to be made of key frame and predictive frame, described device comprises:
In key frame or the predictive frame which frame of video determined property module, the frame that the judgement montage begins are;
Key frame montage module, if key frame, then directly from this key frame montage;
Predictive frame montage module, if predictive frame, then begin to re-start coding to all predictive frames between the rear key frame from this predictive frame, so that after this predictive frame that montage begins converts the predictive frame that key frame and remaining predictive frame converts the key frame after this conversion to, the key frame montage after this conversion.
5. video file montage device according to claim 4 is characterized in that, this video file is the file that adopts the flv form of h264 coded system formation.
6. video file montage device according to claim 5, it is characterized in that, this predictive frame montage module further comprises key frame modular converter and predictive frame recodification module, and wherein the key frame modular converter comprises description document reading unit, decoding unit and recodification unit, wherein:
Described description document reading unit reads the description document of this predictive frame and the description document of the key frame that this predictive frame relies on from file header;
Described decoding unit according to the description document that reads, is decoded into the yuv video sequence with this predictive frame that reads;
Described recodification unit becomes this predictive frame recompile new key frame and generates new description document, feeds back to file header;
Described predictive frame recodification module, for each frame in remaining predictive frame, the description document of the key frame that reads the description document of all the other each predictive frames and rely on, according to the description document that reads all the other each predictive frames are decoded into the yuv video sequence, and recompile forms the predictive frame of described new key frame, feeds back to file header.
CN2012105923362A 2012-12-31 2012-12-31 Video file editing method and device Pending CN103024394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012105923362A CN103024394A (en) 2012-12-31 2012-12-31 Video file editing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012105923362A CN103024394A (en) 2012-12-31 2012-12-31 Video file editing method and device

Publications (1)

Publication Number Publication Date
CN103024394A true CN103024394A (en) 2013-04-03

Family

ID=47972466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012105923362A Pending CN103024394A (en) 2012-12-31 2012-12-31 Video file editing method and device

Country Status (1)

Country Link
CN (1) CN103024394A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104980808A (en) * 2015-07-06 2015-10-14 无锡天脉聚源传媒科技有限公司 Method and device for accurately dotting video resources
CN106803992A (en) * 2017-02-14 2017-06-06 北京时间股份有限公司 Video clipping method and device
CN110740344A (en) * 2019-09-17 2020-01-31 浙江大华技术股份有限公司 Video extraction method and related device
CN111182304A (en) * 2018-11-13 2020-05-19 杭州海康威视数字技术股份有限公司 Video data processing method and device
CN111918121A (en) * 2020-06-23 2020-11-10 南斗六星系统集成有限公司 Method and device for accurately editing streaming media file

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1344106A (en) * 2000-09-15 2002-04-10 北京算通数字技术研究中心有限公司 Edition method for non-linear edition system based on MPEG-2 code stream
US20030206596A1 (en) * 2002-05-03 2003-11-06 David Carver Multimedia content assembly
CN101044757A (en) * 2004-04-30 2007-09-26 微软公司 Frame-accurate editing methods and systems
CN101859585A (en) * 2010-07-01 2010-10-13 福建省三奥信息科技有限公司 System and method for frame-accuracy cutting of video material
CN102497554A (en) * 2011-12-16 2012-06-13 杭州士兰微电子股份有限公司 Dividing method of chapters accurate to frames

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1344106A (en) * 2000-09-15 2002-04-10 北京算通数字技术研究中心有限公司 Edition method for non-linear edition system based on MPEG-2 code stream
US20030206596A1 (en) * 2002-05-03 2003-11-06 David Carver Multimedia content assembly
CN101044757A (en) * 2004-04-30 2007-09-26 微软公司 Frame-accurate editing methods and systems
CN101859585A (en) * 2010-07-01 2010-10-13 福建省三奥信息科技有限公司 System and method for frame-accuracy cutting of video material
CN102497554A (en) * 2011-12-16 2012-06-13 杭州士兰微电子股份有限公司 Dividing method of chapters accurate to frames

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104980808A (en) * 2015-07-06 2015-10-14 无锡天脉聚源传媒科技有限公司 Method and device for accurately dotting video resources
CN106803992A (en) * 2017-02-14 2017-06-06 北京时间股份有限公司 Video clipping method and device
CN106803992B (en) * 2017-02-14 2020-05-22 北京时间股份有限公司 Video editing method and device
CN111182304A (en) * 2018-11-13 2020-05-19 杭州海康威视数字技术股份有限公司 Video data processing method and device
CN110740344A (en) * 2019-09-17 2020-01-31 浙江大华技术股份有限公司 Video extraction method and related device
CN111918121A (en) * 2020-06-23 2020-11-10 南斗六星系统集成有限公司 Method and device for accurately editing streaming media file

Similar Documents

Publication Publication Date Title
CN103024394A (en) Video file editing method and device
WO2008047303A3 (en) System and method for implementing efficient decoded buffer management in multi-view video coding
WO2008067318A3 (en) System and method for allocation of resources for processing video
RU2013158832A (en) REDUCED DELAY IN VIDEO CODING AND DECODING
CN102447906A (en) Low-latency video decoding
CN1145154A (en) Buffer management in variable Bit-rate compression systems
RU2014123342A (en) METHOD FOR CODING AND DECODING IMAGES, DEVICE FOR CODING AND DECODING, AND RELATED COMPUTER PROGRAMS
EP3090569A1 (en) Content-adaptive chunking for distributed transcoding
CN111147926A (en) Data transcoding method and device
CN101009836B (en) Embedded video playing device based on the dual processor
EP3324633B1 (en) Decoding a video quantization parameter
CN103929637B (en) A kind of video comparison means and comparative approach thereof
CN110868610A (en) Streaming media transmission method and device and server
EP3264766A1 (en) Decoding method and decoder for quantization parameter decoding for video decoding
WO2008031039A3 (en) Audio/video recording and encoding
CN111083416B (en) Data processing method and device, electronic equipment and readable storage medium
CN103313048A (en) Method for self-adaptively controlling BIN quantity by arithmetic coding context coding mode
CN101707484B (en) Fast exp-Golomb decoding method suitable to be implemented by hardware
CN105163120B (en) The the outputting and inputting of input code flow buffering area in a kind of hypothesis decoder/obtain the method and device of data, the method for transmitting video code flow from buffering area
CN105446685A (en) Document playing method and system
CN111050179A (en) Video transcoding method and device
CN105592316A (en) Digital video signal decoder
US20100202468A1 (en) Bridge, data compressing method thereof and computer system applying the same
CN111225210B (en) Video coding method, video coding device and terminal equipment
CN103248894B (en) A kind of multi-channel code method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: BEIJING QIYI CENTURY TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: CHUANJU INTERACTIVE (BEIJING) TECHNOLOGY CO., LTD.

Effective date: 20130829

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 100026 CHAOYANG, BEIJING TO: 100080 HAIDIAN, BEIJING

TA01 Transfer of patent application right

Effective date of registration: 20130829

Address after: A city of Beijing Haidian District Haidian North Street 100080 No. 2 building 11 layer Goldtron expansion

Applicant after: Beijing Qiyi Century Technology Co., Ltd.

Address before: 100026 Beijing city Chaoyang District West Road No. 3 Building No. 3 hospital 3002

Applicant before: Transfer Interaction Together (Beijing) Technology Co., Ltd.

C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130403