CN103067745B - A kind of cutting method of video data and device, online editing method and system - Google Patents
A kind of cutting method of video data and device, online editing method and system Download PDFInfo
- Publication number
- CN103067745B CN103067745B CN201110324920.5A CN201110324920A CN103067745B CN 103067745 B CN103067745 B CN 103067745B CN 201110324920 A CN201110324920 A CN 201110324920A CN 103067745 B CN103067745 B CN 103067745B
- Authority
- CN
- China
- Prior art keywords
- video data
- cutting
- stream packets
- 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
Links
Landscapes
- Television Signal Processing For Recording (AREA)
Abstract
The invention discloses a kind of cutting method of video data, comprise the following steps: analyze TS stream packets, find PAT and PMT, store and constantly update; When arriving default cutting time point, finding I frame, the video data before described I frame is cut into a video file; Video data after current PAT, PMT, I frame and I frame to next cutting time point is cut into next video file.The invention also discloses a kind of online editing method of video data, comprise the following steps: local connects video source, receive and the TS stream packets of store video source transmission; Adopt the video data in said method cutting TS stream packets, until the video data in the complete all TS stream packets of cutting; After being cut into file, sending it to editing device and edit.The invention also discloses the cutting device of video data and the online editing system of video data.
Description
Technical field
The invention belongs to video data editing technical field, be specifically related to a kind of video data cutting method based on H.264 agreement and device, video data online editing method and system.
Background technology
In existing video editing techniques, fairly perfect to the process of video, but owing to being all first complete for video content is stored in major applications, and then transfer to software for editing to edit video file.In the process using this method for processing video frequency, need to wait for that the long period just can carry out video editing, the content ageing to ask for something can produce larger time delay like this.
Below to involved in the present invention to technical term carry out brief description.
TS (transport stream): TS is the one in Moving Picture Experts Group-2 in two kinds of dissimilar code streams, is applicable to the transmission having interchannel noise to produce, and can carry out long-distance transmissions.
PAT (Program Association Table): PAT for describing multi-path program multiplexing information, and be a complete list of all programs in TS bag, PAT provides the initialization information transmitting program in TS bag.The PID always 0x00 of PAT.
PMT (Program Map Table): PMT, for describing single channel programme information, contains the control information relevant with single channel program multiplexing, provides the mapping between program numbers and their source code flow of composition.
I frame (Iframe), be also called Intra pictures (intrapicture), first frame of the normally each GOP of I frame (a kind of video compression technology that MPEG uses), through moderately compressing, as the reference point of random access, image can be treated as.In the process of mpeg encoded, partial video frame sequence is collapsed into I frame, and Partial shrinkage becomes P frame, also has Partial shrinkage to become B frame.I frame method is frame data compression method, and also referred to as " key frame " compression method, it is the compress technique based on discrete cosine transform (DiscreteCosineTransform), this method and JPEG compression method similar.The compression of employing I frame can reach the compression ratio of 1/6 and nothing significantly compresses vestige.
Summary of the invention
For the defect existed in prior art, technical problem to be solved by this invention is to provide and a kind ofly can improves ageing video data cutting method and device, the online editing method and system of video data.
For solving the problems of the technologies described above, the technical solution used in the present invention is as follows:
A cutting method for video data, comprises the following steps:
(1) analyze TS stream packets, find PAT and PMT, store and constantly update;
(2) when arriving default cutting time point, finding I frame, the video data before described I frame is cut into a video file; Video data after current PAT, PMT, I frame and I frame to next cutting time point is cut into next video file.
An online editing method for video data, comprises the following steps:
(1) local connects video source, receives and the TS stream packets of store video source transmission;
(2) video data in said method cutting TS stream packets is adopted, until the video data in the complete all TS stream packets of cutting;
(3), after file is formed, send it to editing device and edit.
A cutting device for video data, comprising for analyzing TS stream packets, finding the analytic unit of PAT and PMT;
For storing PAT and PMT and the memory cell constantly updated;
For when arriving default cutting time point, find I frame, video data before described I frame is cut into a video file, the video data after current PAT, PMT, I frame and I frame to next cutting time point is cut into the cutting unit of next video file.
An online editing system for video data, the local comprising video source, be connected by network with described video source; Described local comprises the receiving system for receiving the TS stream packets sent from video source; For storing the storage device of TS stream packets; Above-mentioned cutting device; For by the document backup after cutting to the conveyer of editing device; For the editing device of editing video file.
The method of the invention, Apparatus and system, by TS stream packets being cut in transmitting procedure the mode of file, achieve while preview, just can edit partial video data, without the need to by the time transferring to software for editing to edit video file again by after video content full storage, substantially increase the ageing of video editing, decrease delay.And the file after cutting contains the full detail needed for decoding, can not obliterated data.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of video data online editing system in embodiment;
Fig. 2 is the structured flowchart of local in embodiment;
Fig. 3 is the structured flowchart of cutting device in embodiment;
Fig. 4 is the flow chart of video data cutting method in embodiment;
Fig. 5 is the flow chart of video data online editing method in embodiment;
Fig. 6 is the structural representation of TS stream packets in embodiment;
Fig. 7 is the structural representation of PAT in embodiment;
Fig. 8 is the dicing process schematic diagram of video data in embodiment.
Embodiment
Describe the present invention below in conjunction with embodiment and accompanying drawing.
Execution mode 1
Present embodiments provide for a kind of cutting device and method of video data.As shown in Figure 3, this cutting device 33 comprises analytic unit 331, memory cell 332 and cutting unit 333.Analytic unit 331, for analyzing TS stream packets, finds PAT and PMT; Memory cell 332 is for storing PAT and PMT and constantly updating; Cutting unit 333 is for when arriving default cutting time point, find I frame, video data before described I frame is cut into a video file, the video data after current PAT, PMT, I frame and I frame to next cutting time point is cut into next video file.
As shown in Figure 4, the method for above-mentioned cutting device 33 cutting video data is adopted to comprise the following steps:
(1) analytic unit 331 analyzes TS stream packets, finds PAT and PMT, and memory cell 332 stores and constantly updates PAT and PMT.
As shown in Figure 6, TS stream packets generally comprises the packet header of 4B (byte), the self adaptation district (optional) of maximum 184B and bag data.Described packet header comprises the sync byte of 1B, the transmission error code designator of 1bit (position), the PU Payload Unit start indicator of 1bit, the transmission preferences of 1bit, the PID (PacketIdentifier, bag mark) of 13bit, the transmission scrambling of 2bit control, the adaptive control of 2bit and the continuous counter of 4bit.Described self adaptation district and bag data comprise the self adaptation head of district of 1B, the mark of 1B, the information (relevant with the mark inserted) of maximum 182B and padding data.Described mark comprises the self adaptation district extension flag of section designator between 1bit, the random storage indicator of 1bit, the elementary stream priority indicator of 1bit, PCR (ProgramClockReference, the timer reference of programs) mark of 1bit, the contact mark of 1bit, the transmission private data flag of 1bit, the original PCR mark of 1bit and 1bit.
The method finding the PAT in TS stream packets is as follows: analyze the pid value in 4 byte packet header of TS stream packets, as shown in Figure 6, if pid value is 0x00, then other data in this TS stream packets except header part are just PAT.
The method finding the PMT in TS stream packets is as follows: first find the TS stream packets comprising PAT; Then skip over packet header and self adaptation district part, analyze PAT thereafter, as shown in Figure 7, " program number " wherein and " ID of PMT " is respectively the PID in program code and the PMT corresponding with this program; Finally compare with the PID in PID and the TS stream packets packet header in PMT, the PMT of respective program can be found.
(2) cutting unit 333 is when arriving default cutting time point, finds I frame, the video data before described I frame is cut into a video file; Video data after current PAT, PMT (namely from PAT and PMT that I frame is nearest), I frame and I frame to next cutting time point is cut into next video file.
Cutting time point can be arranged according to embody rule environment by user, such as, the video data of continuous 10 seconds is cut into a file.
The method finding I frame is as follows: the slice_type information analyzing video ES (elementary stream) in TS stream packets, if be I frame when slice_type equals 2,4,7 or 9.Video ES has according to 3 kinds the different frame data predicted from production Methods each other, and I frame, P frame form image sets GOP from B frame data according to different combinations, adds sequence initial code and sequence first-class data composition elementary stream.
The process of cutting as shown in Figure 8, file content after cutting comprises: comprise PAT in first TS stream packets, comprises PMT in second TS stream packets, and the 3rd TS stream packets is I frame, thereafter be the video data according to receiving sequential storage, until arrive next cutting time point.
PAT defines all programs in TS, and it is the root node of PSI information, and search programme information must from PAT.PMT fully describes a road program and which PES is made up of, their PID be respectively what etc., in order to enable decoder recover each road PES according to PID, need to send PMT to decoder before transmission program.First frame must be I frame, otherwise the video data before I frame can be caused to be correctly decoded and obliterated data.
Execution mode 2
Present embodiments provide for a kind of online editing system and method for the video data based on cutting device described in execution mode 1 and method.As shown in Figure 1, Figure 2 and Figure 3, this system comprises video source 1, several local 3 be connected by network 2 with video source 1.Wherein, local 3 comprises receiving system 31, the storage device 32 be connected with receiving system 31 and pre-viewing device 36, the cutting device 33 be connected with storage device 32, the conveyer 34 be connected with cutting device 33, the editing device 35 be connected with conveyer 34.
Receiving system 31 is for receiving the TS stream packets sent from video source 1, pre-viewing device 36 is for preview TS stream packets, storage device 32 is for storing TS stream packets, cutting device 33 is for being cut into file by TS stream packets, conveyer 34 for by the document backup after cutting to editing device 35, editing device 35 is for editing video file.Cutting device 33 adopts cutting device described in above-mentioned execution mode 1.
As shown in Figure 5, the method adopting said system to realize video data online editing comprises the following steps:
(1) local 3 connects video source 1, the TS stream packets of receiving system 31 receiver, video source transmission, and the TS stream packets of reception is pushed to pre-viewing device 36 is used for preview, and storage device 32 stores each TS stream packets simultaneously.
Preferably, local 3 is connected with video source 1 by TCP mode, namely passes through Internet connection.Employing TCP mode can alleviate offered load when not using online editing system.Certainly, local 3 also can be connected with video source 1 by local area network (LAN).
(2) method described in execution mode 1 is adopted the video data in TS stream packets to be cut into file one by one, until the video data in the complete all TS stream packets of cutting.
(3), in video data dicing process, after file is formed, just can send it to editing device 35 and edit.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technology thereof, then the present invention is also intended to comprise these change and modification.
Claims (10)
1. a cutting method for video data, is characterized in that, comprises the following steps:
(1) analyze TS stream packets, find Program Association Table PAT and Program Map Table PMT, store and constantly update;
(2) when arriving default cutting time point, finding I frame, the video data before described I frame is cut into a video file; Video data after actual program contingency table PAT, Program Map Table PMT, I frame and I frame to next cutting time point is cut into next video file.
2. the cutting method of video data as claimed in claim 1, it is characterized in that, the lookup method of described PAT is as follows:
Analyze the pid value in TS stream packets packet header, if pid value is 0x00, then other data in this TS stream packets except header part are just Program Association Table PAT.
3. the cutting method of video data as claimed in claim 1, it is characterized in that, the lookup method of described PMT is as follows:
First the TS stream packets comprising Program Association Table PAT is found; Then analyze Program Association Table PAT, find the PID in program code and the Program Map Table PMT corresponding with this program; Finally compare with the PID in PID and the TS stream packets packet header in Program Map Table PMT, find the Program Map Table PMT matched with this program.
4. an online editing method for video data, is characterized in that, comprise the following steps:
(1) local connects video source, receives and the TS stream packets of store video source transmission;
(2) video data in method cutting TS stream packets according to any one of claims 1 to 3 is adopted, until the video data in the complete all TS stream packets of cutting;
(3), after being cut into file, sending it to editing device and edit.
5. the online editing method of video data as claimed in claim 4, is characterized in that: in step (1), local connects video source by TCP mode.
6. the video data online editing method as described in claim 4 or 5, is characterized in that: described method also comprises the step TS stream packets received being pushed to pre-viewing device and being used for preview.
7. the cutting device (33) of a video data, is characterized in that: comprise for analyzing TS stream packets, finds the analytic unit (331) of Program Association Table PAT and Program Map Table PMT;
For the memory cell (332) that programs stored contingency table PAT and Program Map Table PMT also constantly updates;
For when arriving default cutting time point, find I frame, video data before described I frame is cut into a video file, the video data after actual program contingency table PAT, Program Map Table PMT, I frame and I frame to next cutting time point is cut into the cutting unit (333) of next video file.
8. the online editing system of a video data, the local (3) comprising video source (1), be connected by network (2) with described video source (1), be is characterized in that: described local (3) comprises the receiving system (31) for receiving the TS stream packets sent from video source (1); For storing the storage device (32) of TS stream packets; Cutting device according to claim 7 (33); For by the document backup after cutting to the conveyer of editing device (35) (34); For the editing device (35) of editing video file.
9. the online editing system of video data as claimed in claim 8, is characterized in that: described system also comprises the pre-viewing device (36) for preview TS stream packets.
10. the online editing system of video data as claimed in claim 8 or 9, is characterized in that: described network (2) is internet.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110324920.5A CN103067745B (en) | 2011-10-24 | 2011-10-24 | A kind of cutting method of video data and device, online editing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110324920.5A CN103067745B (en) | 2011-10-24 | 2011-10-24 | A kind of cutting method of video data and device, online editing method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103067745A CN103067745A (en) | 2013-04-24 |
CN103067745B true CN103067745B (en) | 2016-01-20 |
Family
ID=48110179
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110324920.5A Expired - Fee Related CN103067745B (en) | 2011-10-24 | 2011-10-24 | A kind of cutting method of video data and device, online editing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103067745B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105744297A (en) * | 2014-12-12 | 2016-07-06 | 中兴通讯股份有限公司 | Method and device for code stream transmission |
CN104951511A (en) * | 2015-05-26 | 2015-09-30 | 重庆大学 | Method for carrying out lossless segmentation on video in webpage and supporting online modifying and preview |
WO2017035804A1 (en) * | 2015-09-02 | 2017-03-09 | 深圳好视网络科技有限公司 | Transport stream slicing method and apparatus |
CN105898353A (en) * | 2015-12-01 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Real-time audio and video transmission method and device, transmission stream packaging method and multiplexer |
CN109089174B (en) * | 2018-08-16 | 2020-12-22 | 咪咕视讯科技有限公司 | Multimedia data stream processing method and device and computer storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1601937A (en) * | 2003-09-25 | 2005-03-30 | 三星电子株式会社 | Apparatus and method for servicing both wide area broadcasting and local area broadcasting and terminal for receiving the broadcast |
CN1980375A (en) * | 2005-12-07 | 2007-06-13 | 中国科学院研究生院 | Method for real-time inserting signature and identifying signature indigit TV transmission flow |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7962637B2 (en) * | 2006-11-03 | 2011-06-14 | Apple Computer, Inc. | Dynamic adjustments of video streams |
-
2011
- 2011-10-24 CN CN201110324920.5A patent/CN103067745B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1601937A (en) * | 2003-09-25 | 2005-03-30 | 三星电子株式会社 | Apparatus and method for servicing both wide area broadcasting and local area broadcasting and terminal for receiving the broadcast |
CN1980375A (en) * | 2005-12-07 | 2007-06-13 | 中国科学院研究生院 | Method for real-time inserting signature and identifying signature indigit TV transmission flow |
Also Published As
Publication number | Publication date |
---|---|
CN103067745A (en) | 2013-04-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11196786B2 (en) | Interface apparatus and method for transmitting and receiving media data | |
US11800200B2 (en) | Low latency media ingestion system, devices and methods | |
US9565397B2 (en) | Deterministically skewing transmission of content streams | |
CA2666861C (en) | Reducing channel-change time | |
TWI408964B (en) | Method for channel switching, transmitting device, device for enabling a receiver to optimize channel switching time, and computer-program product for optimizing channel switching time | |
CN103067745B (en) | A kind of cutting method of video data and device, online editing method and system | |
US20170272691A1 (en) | Broadcast signal transmission device, broadcast signal reception device, broadcast signal transmission method, and broadcast signal reception method | |
KR100848273B1 (en) | Device and method for processing file in digital broadcasting receiver | |
JP2017130955A (en) | Apparatus for receiving data on digital broadcasting system | |
US20100218227A1 (en) | Deterministically skewing synchronized events for content streams | |
GB2490659A (en) | Fast channel change using channel packs comprising independently decodable frame segments having differing qualities | |
CN1781295A (en) | Redundant transmission of programmes | |
US8036154B2 (en) | Device and method for saving power in digital broadcasting receiver | |
US20050185676A1 (en) | Multi access unit transport packetization method of MPEG4 sync layer packet and multi access unit transport packet | |
CN103685314A (en) | Method for achieving seamless switching of unicast and multicast of stream media playing | |
EP3360334B1 (en) | Digital media splicing system and method | |
US20220131921A1 (en) | Multicast to unicast conversion | |
CN107017964B (en) | Method and apparatus for detecting packet loss in staggercasting | |
CN110769326A (en) | Method and device for loading video slice file and playing video file | |
KR101226329B1 (en) | Method for channel change in Digital Broadcastings | |
EP2357820A1 (en) | System and method for signaling programs from different Transport Streams | |
US20150109413A1 (en) | Video reception apparatus to provide hybrid service based on transport stream system target decoder model | |
KR101855327B1 (en) | Apparatus and method for delivering multimedia data in hybrid network | |
CN102594775A (en) | Method and system for transmitting streaming media |
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: 20160120 Termination date: 20161024 |
|
CF01 | Termination of patent right due to non-payment of annual fee |