CN102104795A - Method for multiplexing program stream (PS) paths into transport stream (TS) path based on moving picture experts group (MPEG)-2 - Google Patents

Method for multiplexing program stream (PS) paths into transport stream (TS) path based on moving picture experts group (MPEG)-2 Download PDF

Info

Publication number
CN102104795A
CN102104795A CN 201110078706 CN201110078706A CN102104795A CN 102104795 A CN102104795 A CN 102104795A CN 201110078706 CN201110078706 CN 201110078706 CN 201110078706 A CN201110078706 A CN 201110078706A CN 102104795 A CN102104795 A CN 102104795A
Authority
CN
China
Prior art keywords
stream
bag
road
field
data block
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
CN 201110078706
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.)
Chongqing University
Original Assignee
Chongqing University
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 Chongqing University filed Critical Chongqing University
Priority to CN 201110078706 priority Critical patent/CN102104795A/en
Publication of CN102104795A publication Critical patent/CN102104795A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Time-Division Multiplex Systems (AREA)

Abstract

The invention provides a method for multiplexing a plurality of paths of program streams (PS) into a path of transport steam (TS) based on moving picture experts group (MPEG)-2, which comprises the four main steps of: A) copying packetized elementary streams (PES) from a path of PS read from a digital video disk (DVD); B) converting the copied PESs into TS packets; C) copying the PESs from the plurality of PSs read from I DVDs as digital television program sources respectively, and converting the PESs into TS packet by the steps A) and B); and D) performing multiplexing processing to form the path of TS. By the method for multiplexing the plurality of paths of program streams (PS) into the path of transport steam (TS) based on the (MPEG)-2, the conversion and the multiplexing from the PSs to the TS are realized in an MPEG-2-standard system layer, audio and video data stored in the DVD in form of PS can be converted into the TS for producing digital television programs, and a novel convenient approach is provided for the production of the digital television programs.

Description

Be multiplexed with the method for one road TS stream based on the multichannel PS circulation of MPEG-2
Technical field
The present invention relates to technical field of communication processing, relate in particular to the method that a kind of multichannel PS stream based on MPEG-2 is multiplexed with one road TS stream.
Background technology
Digital television broadcasting system is the digital image information communication system that is most widely used at present.Digital television broadcasting system adopts DVB standard (Digital Video Broadcasting, digital video-frequency broadcast standard) as digital television program Channel Transmission standard, the selected Moving Picture Experts Group-2 of DVB standard is as the encoding compression mode of audio frequency and video, with one tunnel source encoding is ES stream (Elementary Stream, elementary stream) the back packing forms PES bag (Packetised Elementary Streams, the elementary stream bag), again after conversion process is converted to the TS bag with the PES bag, each road is multiplexed with one road TS stream (Transport Stream as the TS of the ES stream translation of TV programme information source bag, transport stream), via satellite at last, different media transmission modes such as cable TV are transmitted.In order to produce digital television program faster, many times can not only rely on to record voluntarily and obtain information source, can also will both get sound, video data as information source.The capacity of DVD CD is big, sound image quality amount is good, is the good selection that had both got sound, video data source.But the sound in the DVD CD, video data are to store with the form of PS stream (Program Stream, program stream) after adopting the Moving Picture Experts Group-2 encoding compression, can't be directly used in the digital television program Channel Transmission.
Summary of the invention
At above shortcomings in the prior art, the object of the present invention is to provide a kind of multichannel PS stream to be multiplexed with the method for one road TS stream based on MPEG-2, realize that in the system layer of Moving Picture Experts Group-2 PS flow to the conversion of TS stream and multiplexing, and then solve problem with the sound of storing in the DVD CD, video data making digital television program.
For achieving the above object, the present invention has adopted following technological means:
Multichannel PS stream based on MPEG-2 is multiplexed with the method that one road TS flows, and may further comprise the steps:
A) from one road PS stream, copy out the PES bag, be specially:
A1) read the PS flow data, know the byte number of PS bag, and then extract each PS bag in the PS stream by the byte number that calculates between adjacent two PS bag initial code;
A2) resolve system's head part of the PS bag extracted respectively, know the number and the type of the PES bag that is comprised in each PS bag; Resolve the header part of each PES bag more respectively, know the byte number of each PES bag; And then copy out N the PES that is comprised in the PS stream respectively and wrap;
B) the PES bag that will copy out from one road PS stream is converted to the TS bag, is specially:
B1) for n PES bag in N the PES bag that from one road PS stream, copies out, n ∈ 1,2 ..., N} wraps n PES the data block d that is divided into M 184 bytes by byte order N, mWith 1 data block d that is less than or equal to 184 bytes N, eWherein m ∈ 1,2 ..., M}, M= Int(D PESn/ 184), D PESnThe byte number of representing n PES bag, Int(D PESn/ 184) expression is less than or equal to (D PESn/ 184) maximum integer;
B2) according to the TS packet format, each data block that n PES bag cut apart gained is encapsulated as the TS bag respectively; Described TS packet format is made of the packet header of 4 bytes and the load zones of 184 bytes; The packet header of TS packet format is made of the sync byte field of 1 byte, the transmission error code indication field of 1bit, the initial indication field of PU Payload Unit of 1bit, the transmission priority field of 1bit, the PID field of 13bit, the transmission scrambling control field of 2bit, the adaptive control field of 2bit and the continuous counter field of 4bit successively;
The step that each data block that n PES bag is cut apart gained is encapsulated as the TS bag respectively is as follows:
1. for the data block d of 184 bytes N, m:
With data block d N, mBe encapsulated as the load zones of TS packet format; In the packet header of TS packet format, the field except that PID field, the initial indication field of PU Payload Unit and adaptive control field is 0; Two bit of adaptive control field are respectively 0 and 1; The initial indication field of PU Payload Unit is taken as 1 when m=1, be taken as 0 when m ≠ 1;
2. for the data block d that is less than or equal to 184 bytes N, e:
As data block d N, eWhen being 184 bytes, with data block d eBe encapsulated as the load zones of TS packet format; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are respectively 0 and 1;
As data block d N, eWhen being 183 bytes, successively by the self adaptation section length field and the data block d of 1 byte eBe encapsulated as the load zones of TS packet format, the value of self adaptation section length field is 0x01; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are 1;
As data block d N, eDuring less than 183 bytes, successively by self adaptation section length field, a L byte of padding and the data block d of 1 byte N, eBe encapsulated as the load zones of TS packet format, wherein L=183-D Dn, e, D Dn, eBe data block d N, eByte number, the value of self adaptation section length field is (L+1), the value of byte of padding is 0xFF; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are 1;
3. for the PID field in the 1. above-mentioned and 2. middle TS packet format packet header:
And if only if is packaged in data block d in the TS packet format load zones N, mOr data block d N, eDuring from the PES bag of the same type that copies out in the same PS stream, the value of PID field is identical in its packet header;
B3) b1 set by step) and N the PES bag that b2) will from one road PS stream, copy out be converted to TS successively and wrap;
C) pass through steps A) and B) from as copying out the PES bag the I road PS of the digital television program information source stream respectively and being converted to the TS bag; Wherein, I 〉=1;
D) finish multiplexing process, form one road TS stream, be specially:
D1) be calculated as follows code check as a PS bag of one road PS stream in the I road PS of the digital television program information source stream:
R PSj=D PSj×ΔSCR j/F CLK
Wherein, R PSjThe code check of representing j PS bag in one road PS stream, D PSjThe byte number of representing this j PS bag, Δ SCR jThe SCR difference of representing j+1 the PS bag that this j PS bag is adjacent; F CLKThe expression system clock frequency;
D2) be calculated as follows the code check that flows as one road PS in the I road PS stream of digital television program information source:
R i=∑ j=1→J(R PSj)/J;
Wherein, R iExpression is as the code check of PS stream in i road in the I road PS stream of digital television program information source, and J represents to comprise in this i road PS stream the number of PS bag;
D3) by steps d 1) and d2) calculate code check and summation respectively as the I road PS of digital television program information source stream, obtain the total bitrate R of digital television program information source Total
D4) set the code check R that TS flows TS, make it satisfy R Total<R TS<2R Total
D5) be calculated as follows that TS of transmission wraps pairing PCR increment Δ PCR in the TS stream TS:
ΔPCR TS=F CLK×188×8/R TS
D6) circulation turns to the PCR initial value that TS flows as this road PS with the SCR value as first PS bag of one road PS stream in the I road PS stream of digital television program information source, and a TS bag of every insertion PCR value just increases Δ PCR TS, determine thus to be multiplexed with the PCR information that TS flows each road, back as the I road PS stream of digital television program information source; Then, adopting existing multiplexing method to be multiplexed with one road code check as the TS bag of the I road PS stream translation of digital television program information source is R TSTS stream, and insert the PSI information of each way word TV programme information source accordingly, the code check coupling adopts the mode of filling empty TS bag to realize.
The present invention is than the advantage of prior art, the method that multichannel PS stream based on MPEG-2 of the present invention is multiplexed with one road TS stream realizes that in the system layer of Moving Picture Experts Group-2 PS flow to the conversion of TS stream and multiplexing, utilize sound, video data that this method can be streamed with the PS that stores in the DVD CD to be converted to TS stream and be used to make digital television program, making for digital television program provides a kind of new convenient way.
Description of drawings
Fig. 1 is the format structure schematic diagram of PS bag;
Fig. 2 is the format structure schematic diagram of PES bag;
Fig. 3 is the format structure schematic diagram of TS bag.
Embodiment
Below in conjunction with drawings and Examples technical scheme of the present invention is further described.
The method that multichannel PS stream based on MPEG-2 of the present invention is multiplexed with one road TS stream is divided into four big steps:
A) copy out the PES bag in the road PS stream that at first from a DVD CD, reads;
B) and then with the PES bag that copies out be converted to the TS bag;
C) pass through steps A) and B) open from the I as the digital television program information source and copy out the PES bag in the I road PS stream that reads the DVD CD respectively and be converted to the TS bag; Wherein, I 〉=1;
D) finish multiplexing process, form one road TS stream.
Describe the implementation method and the function of above-mentioned each step below in detail.
A) it is as follows to copy out the concrete steps of PES bag from one road PS stream:
A1) calculate the byte number that each PS wraps, principle is exactly to calculate the byte number between adjacent two PS bag initial code in the PS stream, and this byte number is exactly the byte number of PS bag.Obtain after the byte number of PS bag, can be in computer the size in corresponding memory allocated space, whole PS wrapped read in the memory space.The specific implementation method is, the initial code by identification PS bag is to the initial code position of PS bag, and the byte number that calculates then between adjacent two PS bag initial code is the byte number of PS bag, wraps thereby read out each PS.
A2) format structure of PS bag as shown in Figure 1.Each PS includes a plurality of PES bags, resolves system's head part of the PS bag that is extracted respectively, knows the number and the type of the PES bag that is comprised in each PS bag, so just can allocate the number of the memory block of depositing the PES bag in advance; The type of PES bag has two kinds, and a kind of is the voice data type, and another kind is the video data type.The format structure of PES bag as shown in Figure 2.Include PES packet length field in the header packet information of PES bag, resolve the header part of each PES bag respectively, can know the byte number of each PES bag, thereby determine to deposit the size of each memory block of PES bag, copy out the PES bag then respectively and be saved in the corresponding memory block.The specific implementation method is that PS bag pointer is skipped the header part that PS wraps, and handles system's head of PS bag, obtains the number N and the type information of PES bag in the PS bag, distributes N memory block (big or small undetermined) then, simultaneously the packet header of first PES bag of PS bag pointed; Obtain the length of PES bag from the packet header of PES bag, for first memory block allocated size and copy out first PES bag, the next PES of PS bag pointed packet header then; If comprise N PES bag in one road PS stream altogether, then circulate N time like this, up to all N PES bags are all copied in the corresponding memory block.With such method, copy out N the PES bag that is comprised in the PS stream respectively; For different PS stream, the digital N here is not a definite value, need decide according to the PES bag number that comprises in the PS bag number that comprises in every road PS stream and each PS bag.
The concrete steps that the PES bag that B) will copy out from one road PS flows is converted to the TS bag are as follows:
B1) for n PES bag in N the PES bag that from one road PS stream, copies out, n ∈ 1,2 ..., N} wraps n PES the data block d that is divided into M 184 bytes by byte order N, mWith 1 data block d that is less than or equal to 184 bytes N, eWherein m ∈ 1,2 ..., M}, M= Int(D PESn/ 184), D PESnThe byte number of representing n PES bag, Int(D PESn/ 184) expression is less than or equal to (D PESn/ 184) maximum integer;
B2) architecture of TS bag as shown in Figure 3.According to the TS packet format, each data block that n PES bag cut apart gained is encapsulated as the TS bag respectively; Described TS packet format is made of the packet header of 4 bytes and the load zones of 184 bytes; The packet header of TS packet format is made of the sync byte field of 1 byte, the transmission error code indication field of 1bit, the initial indication field of PU Payload Unit of 1bit, the transmission priority field of 1bit, the PID field of 13bit, the transmission scrambling control field of 2bit, the adaptive control field of 2bit and the continuous counter field of 4bit successively;
The step that each data block that n PES bag is cut apart gained is encapsulated as the TS bag respectively is as follows:
1. for the data block d of 184 bytes N, m:
With data block d N, mBe encapsulated as the load zones of TS packet format; In the packet header of TS packet format, the field except that PID field, the initial indication field of PU Payload Unit and adaptive control field is 0; Two bit of adaptive control field are respectively 0 and 1; The initial indication field of PU Payload Unit is taken as 1 when m=1, be taken as 0 when m ≠ 1;
2. for the data block d that is less than or equal to 184 bytes N, e:
As data block d N, eWhen being 184 bytes, with data block d eBe encapsulated as the load zones of TS packet format; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are respectively 0 and 1;
As data block d N, eWhen being 183 bytes, successively by the self adaptation section length field and the data block d of 1 byte eBe encapsulated as the load zones of TS packet format, the value of self adaptation section length field is 0x01; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are 1;
As data block d N, eDuring less than 183 bytes, successively by self adaptation section length field, a L byte of padding and the data block d of 1 byte N, eBe encapsulated as the load zones of TS packet format, wherein L=183-D Dn, e, D Dn, eBe data block d N, eByte number, the value of self adaptation section length field is (L+1), the value of byte of padding is 0xFF; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are 1;
3. for the PID field in the 1. above-mentioned and 2. middle TS packet format packet header:
And if only if is packaged in data block d in the TS packet format load zones N, mOr data block d N, eDuring from the PES bag of the same type that copies out in the same PS stream, the value of PID field is identical in its packet header;
B3) b1 set by step) and N the PES bag that b2) will from one road PS stream, copy out be converted to TS successively and wrap;
C) pass through steps A) and B) from as copying out the PES bag the I road PS of the digital television program information source stream respectively and being converted to the TS bag; PS stream as the digital television program information source can be 1 the tunnel, also can be multichannel, i.e. I 〉=1;
D) finish multiplexing process, the concrete steps that form one road TS stream are as follows:
The emphasis of multiplex process, when decision is inserted into PCR information in the TS data packet stream and goes exactly, the PCR information of inserting is exactly in order to realize SCR(system clock reference in the PS stream) be mapped in the TS stream and go, so that in the decode procedure of TS stream, can carry out frame synchronization to sound, video data.According to DVB standard (Digital Video Broadcasting, digital video-frequency broadcast standard), time interval of occurring of the PCR information in the TS that the generates stream be 40ms.
D1) be calculated as follows code check as a PS bag of one road PS stream in the I road PS of the digital television program information source stream:
R PSj=D PSj×ΔSCR j/F CLK
Wherein, R PSjThe code check of representing j PS bag in one road PS stream, D PSjThe byte number of representing this j PS bag, Δ SCR jThe SCR difference of representing j+1 the PS bag that this j PS bag is adjacent; F CLKThe expression system clock frequency; In this fact Example, system clock is 27MHz, i.e. F CLK=27MHz;
D2) be calculated as follows the code check that flows as arbitrary road PS in the I road PS stream of digital television program information source:
R i=∑ j=1→J(R PSj)/J;
Wherein, R iExpression is as the code check of PS stream in i road in the I road PS stream of digital television program information source, and J represents to comprise in this i road PS stream the number of PS bag;
D3) by steps d 1) and d2) calculate code check and summation respectively as the I road PS of digital television program information source stream, obtain the total bitrate R of digital television program information source Total
D4) set the code check R that TS flows TS, make it satisfy R Total<R TS<2R Tota
The code check R of TS stream TSMust be greater than the total bitrate R of digital television program information source Total, otherwise must cause the decoder buffer underflow.If the code check R of TS stream TSLess than R Total, can cause broadcasting speed slack-off, the asynchronous transmission problem that waits of audio frequency and video.So in the process that multichannel PS stream is multiplexed with one road TS stream, can in TS stream, add empty TS bag during the code check coupling, make the code check of TS stream satisfy R Total<R TS<2R TotaTS stream bit rate R TSCompare R TotalThe benefit of some is greatly, can guarantee that all program streams all arrive decoder on time, and can reduce the disturbed probability of useful TS bag in the TS stream, thereby improves TS stream antijamming capability; R TSLess than 2R TotaReason be to avoid code check expansion excessive and cause comprising too much empty TS bag in the TS stream, make that the hash amount too much reduces efficiency of transmission in the TS stream.
D5) be calculated as follows that TS of transmission wraps pairing PCR increment Δ PCR in the TS stream TS:
ΔPCR=F CLK×188×8/R TS
By this step, multiplexing preceding preparation is finished.
D6) circulation turns to the PCR initial value that TS flows as this road PS with the SCR value as first PS bag of one road PS stream in the I road PS stream of digital television program information source, and a TS bag of every insertion PCR value just increases Δ PCR TS, determine thus to be multiplexed with the PCR information that TS flows each road, back as the I road PS stream of digital television program information source; Then, adopting existing multiplexing method to be multiplexed with one road code check as the TS bag of the I road PS stream translation of digital television program information source is R TSTS stream, and insert the PSI information of each way word TV programme information source accordingly, the code check coupling adopts the mode of filling empty TS bag to realize.
Here will introduce two notions: code check coupling and poll insert.
Code check coupling: each byte has all been determined a unique time point jointly by " system reference clock SCR " and " PS flows current code check " in the PS stream, illustrates that this byte during PS flows before this time point must be admitted in the buffering area of decoder.If definition " difference of adjacent two time points and the TS code check R of setting in one road PS stream TSProduct " be the expectation data volume, " difference of adjacent two time points flows actual bit rate R with PS in the PS stream in definition TotalProduct " be actual amount of data because the TS code check R that sets TSThan PS stream actual bit rate R TotalValue bigger, so actual amount of data is less than the expected data amount, therefore, can make that code check is R by the mode of inserting empty TS bag TotalMultichannel PS stream to be multiplexed with code check be R TSRoad TS stream, promptly the actual amount of data of adjacent two time points after, fill empty TS bag and make that indulging data volume equals the expected data amount.This process is called the code check coupling.
Poll inserts: the standard of pressing DVB, every interval 40ms inserts a TS bag that comprises PCR information, and system clock frequency is 27MHz, with time conversion in 1 second was that the PCR value is 27M PCR clock-unit, then the 40ms time conversion becomes the PCR value to be 0.18 M PCR clock-unit, and therefore the time of 0.18M PCR clock-unit of every increase just needs to insert a TS bag that comprises PCR information in TS stream; And the standard of pressing DVB, the time interval that insertion comprises the TS bag of PSI information program customizing messages (Program Specific Information) must not surpass 700ms, for example every interval 100ms inserts a TS bag that comprises PSI information, the 100ms time conversion becomes the PCR value to be 0.45 M PCR clock-unit, and therefore the time of 0.45M PCR clock-unit of every increase just needs to insert a TS bag that comprises PSI information in TS stream.This process, the poll that is called PCR information and PSI information inserts.In the existing TS stream instructions of taking, the inserted mode of PCR information and PSI information is exactly the poll insertion method that adopts.
Of the present invention taking in the process, the account form of PCR information, promptly circulation turns to the PCR initial value that TS flows as this road PS with the SCR value as first PS bag of one road PS stream in the I road PS stream of digital television program information source, and a TS bag of every insertion PCR value just increases Δ PCR TS, determine thus to be multiplexed with the PCR information that TS flows each road, back as the I road PS stream of digital television program information source.And the PSI informational needs of each way word TV programme information source is formulated according to the specifying information of each way word TV programme information source.Basic PSI information comprises that pat table (program source associative list), pmt table (program source mapping table), SDT show (program information table), introduces the effect of pat table in the PSI information, pmt table and SDT table below:
Pat table: decoder can know that by complete pat table this TS stream file comprises the PID of the pmt table of several roads program and every road program correspondence, gets ready thereby resolve PMT for next step.
Pmt table: defined a PID in the pat table, just can parse the content of pmt table like this by PID for the pmt table of every road program is unique.The effect of pmt table is the PID that tells the PID(Voice ﹠ Video of the data flow of the program stream of this pmt table correspondence of decoder), thus decoder just can extract each road program successively from the TS bag of numerous dispersions.In addition, can obtain to include the PCR(timer reference of programs from pmt table) PID of the TS of information bag, thus decoder can extract PCR information, recovers the system reference clock.
SDT table: the main effect of SDT table is exactly that the program stream in the whole TS stream is described, and decoder can be known programm name by the SDT table, program information such as program provider, the program that can oneself like according to these Information Selection of user like this.
Thus, in TS stream, indicated the number of programs in the TS stream in the pat table, and the pmt table of each road program correspondence, pmt table by every road program correspondence, can know the PID of the Voice ﹠ Video of every road program, just can from numerous TS bags, extract the video and the voice data of each road program correspondence by PID, thereby finish decoding respectively.
To be multiplexed with one road code check as the TS bag of the multichannel PS stream translation of digital television program information source among the present invention is R TSTS stream, in its concrete steps and the prior art that multichannel is identical as the concrete grammar that the TS bag of the ES stream translation of TV programme information source is multiplexed with one road TS stream, belong to prior art, this paper is just no longer given unnecessary details.Multichannel PS stream is according to method of the present invention, add by after the specific PSI information of poll insertion, be converted into one road TS stream, send again, receiving terminal after receiving TS stream abandons empty TS bag wherein, so TS flow each byte time arrive time of decoder must to arrive time of decoder identical with corresponding byte in the former PS stream, decoded like this video and audio frequency must synchronous playing back, thus it is multiplexing to have realized that multichannel PS flows to the conversion of one road TS stream.
Explanation is at last, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not breaking away from the aim and the scope of technical solution of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.

Claims (1)

1. be multiplexed with the method for one road TS stream based on the multichannel PS stream of MPEG-2, it is characterized in that, may further comprise the steps:
A) from one road PS stream, copy out the PES bag, be specially:
A1) read the PS flow data, know the byte number of PS bag, and then extract each PS bag in the PS stream by the byte number that calculates between adjacent two PS bag initial code;
A2) resolve system's head part of the PS bag extracted respectively, know the number and the type of the PES bag that is comprised in each PS bag; Resolve the header part of each PES bag more respectively, know the byte number of each PES bag; And then copy out N the PES that is comprised in the PS stream respectively and wrap;
B) the PES bag that will copy out from one road PS stream is converted to the TS bag, is specially:
B1) for n PES bag in N the PES bag that from one road PS stream, copies out, n ∈ 1,2 ..., N} wraps n PES the data block d that is divided into M 184 bytes by byte order N, mWith 1 data block d that is less than or equal to 184 bytes N, eWherein m ∈ 1,2 ..., M}, M= Int(D PESn/ 184), D PESnThe byte number of representing n PES bag, Int(D PESn/ 184) expression is less than or equal to (D PESn/ 184) maximum integer;
B2) according to the TS packet format, each data block that n PES bag cut apart gained is encapsulated as the TS bag respectively; Described TS packet format is made of the packet header of 4 bytes and the load zones of 184 bytes; The packet header of TS packet format is made of the sync byte field of 1 byte, the transmission error code indication field of 1bit, the initial indication field of PU Payload Unit of 1bit, the transmission priority field of 1bit, the PID field of 13bit, the transmission scrambling control field of 2bit, the adaptive control field of 2bit and the continuous counter field of 4bit successively;
The step that each data block that n PES bag is cut apart gained is encapsulated as the TS bag respectively is as follows:
1. for the data block d of 184 bytes N, m:
With data block d N, mBe encapsulated as the load zones of TS packet format; In the packet header of TS packet format, the field except that PID field, the initial indication field of PU Payload Unit and adaptive control field is 0; Two bit of adaptive control field are respectively 0 and 1; The initial indication field of PU Payload Unit is taken as 1 when m=1, be taken as 0 when m ≠ 1;
2. for the data block d that is less than or equal to 184 bytes N, e:
As data block d N, eWhen being 184 bytes, with data block d eBe encapsulated as the load zones of TS packet format; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are respectively 0 and 1;
As data block d N, eWhen being 183 bytes, successively by the self adaptation section length field and the data block d of 1 byte eBe encapsulated as the load zones of TS packet format, the value of self adaptation section length field is 0x01; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are 1;
As data block d N, eDuring less than 183 bytes, successively by self adaptation section length field, a L byte of padding and the data block d of 1 byte N, eBe encapsulated as the load zones of TS packet format, wherein L=183-D Dn, e, D Dn, eBe data block d N, eByte number, the value of self adaptation section length field is (L+1), the value of byte of padding is 0xFF; In the packet header of TS packet format, the field except that PID field and adaptive control field is 0, and two bit of adaptive control field are 1;
3. for the PID field in the 1. above-mentioned and 2. middle TS packet format packet header:
And if only if is packaged in data block d in the TS packet format load zones N, mOr data block d N, eDuring from the PES bag of the same type that copies out in the same PS stream, the value of PID field is identical in its packet header;
B3) b1 set by step) and N the PES bag that b2) will from one road PS stream, copy out be converted to TS successively and wrap;
C) pass through steps A) and B) from as copying out the PES bag the I road PS of the digital television program information source stream respectively and being converted to the TS bag; Wherein, I 〉=1;
D) finish multiplexing process, form one road TS stream, be specially:
D1) be calculated as follows code check as a PS bag of one road PS stream in the I road PS of the digital television program information source stream:
R PSj=D PSj×ΔSCR j/F CLK
Wherein, R PSjThe code check of representing j PS bag in one road PS stream, D PSjThe byte number of representing this j PS bag, Δ SCR jThe SCR difference of representing j+1 the PS bag that this j PS bag is adjacent; F CLKThe expression system clock frequency;
D2) be calculated as follows the code check that flows as one road PS in the I road PS stream of digital television program information source:
R i=∑ j=1→J(R PSj)/J;
Wherein, R iExpression is as the code check of PS stream in i road in the I road PS stream of digital television program information source, and J represents to comprise in this i road PS stream the number of PS bag;
D3) by steps d 1) and d2) calculate code check and summation respectively as the I road PS of digital television program information source stream, obtain the total bitrate R of digital television program information source Total
D4) set the code check R that TS flows TS, make it satisfy R Total<R TS<2R Total
D5) be calculated as follows that TS of transmission wraps pairing PCR increment Δ PCR in the TS stream TS:
ΔPCR TS=F CLK×188×8/R TS
D6) circulation turns to the PCR initial value that TS flows as this road PS with the SCR value as first PS bag of one road PS stream in the I road PS stream of digital television program information source, and a TS bag of every insertion PCR value just increases Δ PCR TS, determine thus to be multiplexed with the PCR information that TS flows each road, back as the I road PS stream of digital television program information source; Then, adopting existing multiplexing method to be multiplexed with one road code check as the TS bag of the I road PS stream translation of digital television program information source is R TSTS stream, and insert the PSI information of each way word TV programme information source accordingly, the code check coupling adopts the mode of filling empty TS bag to realize.
CN 201110078706 2011-03-30 2011-03-30 Method for multiplexing program stream (PS) paths into transport stream (TS) path based on moving picture experts group (MPEG)-2 Pending CN102104795A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110078706 CN102104795A (en) 2011-03-30 2011-03-30 Method for multiplexing program stream (PS) paths into transport stream (TS) path based on moving picture experts group (MPEG)-2

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110078706 CN102104795A (en) 2011-03-30 2011-03-30 Method for multiplexing program stream (PS) paths into transport stream (TS) path based on moving picture experts group (MPEG)-2

Publications (1)

Publication Number Publication Date
CN102104795A true CN102104795A (en) 2011-06-22

Family

ID=44157257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110078706 Pending CN102104795A (en) 2011-03-30 2011-03-30 Method for multiplexing program stream (PS) paths into transport stream (TS) path based on moving picture experts group (MPEG)-2

Country Status (1)

Country Link
CN (1) CN102104795A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102802039A (en) * 2012-08-14 2012-11-28 武汉微创光电股份有限公司 Multi-channel video hybrid decoding output method and device
CN103546827A (en) * 2013-10-30 2014-01-29 北京视博数字电视科技有限公司 Method, device and system for transmitting transport stream in television system
CN103596043A (en) * 2013-11-14 2014-02-19 上海电力学院 Method for converting TS into PS in digital television
CN110753259A (en) * 2019-11-15 2020-02-04 北京字节跳动网络技术有限公司 Video data processing method and device, electronic equipment and computer readable medium
CN110798731A (en) * 2019-11-15 2020-02-14 北京字节跳动网络技术有限公司 Video data processing method and device, electronic equipment and computer readable medium
CN113141520A (en) * 2020-01-17 2021-07-20 北京达佳互联信息技术有限公司 Video stream transmission method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1349715A (en) * 1999-12-30 2002-05-15 皇家菲利浦电子有限公司 Method and apparatus for converting data streams
CN1684524A (en) * 2005-03-16 2005-10-19 西安电子科技大学 Multiple channel complex method for MPEG-2 single programme transmission
CN1794812A (en) * 2005-12-05 2006-06-28 上海广电(集团)有限公司中央研究院 Method of transmission flow multiplex
CN101080019A (en) * 2006-03-10 2007-11-28 三星电子株式会社 Method of and apparatus for converting data stream format and method of and apparatus for recording data stream using the method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1349715A (en) * 1999-12-30 2002-05-15 皇家菲利浦电子有限公司 Method and apparatus for converting data streams
CN1684524A (en) * 2005-03-16 2005-10-19 西安电子科技大学 Multiple channel complex method for MPEG-2 single programme transmission
CN1794812A (en) * 2005-12-05 2006-06-28 上海广电(集团)有限公司中央研究院 Method of transmission flow multiplex
CN101080019A (en) * 2006-03-10 2007-11-28 三星电子株式会社 Method of and apparatus for converting data stream format and method of and apparatus for recording data stream using the method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《中国优秀硕士学位论文全文数据库》 20090630 潘爱辉 多路MPEG2的PS流复用为一路TS流的研究与实现 第7-15、24-28页 1 , *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102802039A (en) * 2012-08-14 2012-11-28 武汉微创光电股份有限公司 Multi-channel video hybrid decoding output method and device
CN102802039B (en) * 2012-08-14 2015-04-15 武汉微创光电股份有限公司 Multi-channel video hybrid decoding output method and device
CN103546827A (en) * 2013-10-30 2014-01-29 北京视博数字电视科技有限公司 Method, device and system for transmitting transport stream in television system
CN103546827B (en) * 2013-10-30 2017-01-18 北京视博数字电视科技有限公司 Method, device and system for transmitting transport stream in television system
CN103596043A (en) * 2013-11-14 2014-02-19 上海电力学院 Method for converting TS into PS in digital television
CN103596043B (en) * 2013-11-14 2017-05-10 上海电力学院 Method for converting TS into PS in digital television
CN110753259A (en) * 2019-11-15 2020-02-04 北京字节跳动网络技术有限公司 Video data processing method and device, electronic equipment and computer readable medium
CN110798731A (en) * 2019-11-15 2020-02-14 北京字节跳动网络技术有限公司 Video data processing method and device, electronic equipment and computer readable medium
WO2021093500A1 (en) * 2019-11-15 2021-05-20 北京字节跳动网络技术有限公司 Method and device for processing video data, electronic device and computer readable medium
CN113141520A (en) * 2020-01-17 2021-07-20 北京达佳互联信息技术有限公司 Video stream transmission method and device, electronic equipment and storage medium
CN113141520B (en) * 2020-01-17 2022-04-01 北京达佳互联信息技术有限公司 Video stream transmission method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN101068367B (en) Method and apparatus for changing codec
CN107925781B (en) Transmission method, reception method, transmission device, and reception device
JP4668515B2 (en) Metadata transmission apparatus and method synchronized with multimedia contents
KR101227029B1 (en) Method and apparatus for transmitting broadcast, method and apparatus for receiving broadcast
JP6302274B2 (en) Transmitting apparatus and receiving apparatus
KR100552678B1 (en) Apparauts and method for transmitting and receiving with reducing the setup time of data packet
CN100401784C (en) Data synchronization method and apparatus for digital multimedia data receiver
CN102714754B (en) Remote re-multiplexing of transport streams
US20180007421A1 (en) Broadcasting signal transmission device, broadcasting signal reception device, broadcasting signal transmission method, and broadcasting signal reception method
US20130136189A9 (en) Method and system for converting a dss stream to an encrypted mpeg stream
CN102104795A (en) Method for multiplexing program stream (PS) paths into transport stream (TS) path based on moving picture experts group (MPEG)-2
KR20080098328A (en) Method and apparatus for providing high-quality multimedia service in dmb system
JP7054780B2 (en) Transmission method, reception method, transmission device and reception device
US20080037956A1 (en) Systems and Methods of Generating Encapsulated MPEG Program Streams
US7346054B2 (en) Method and system for co-relating transport packets on different channels using a cyclic redundancy check (CRC)
US7415014B2 (en) Method and system for co-relating transport packets on different channels using a packet prioritization scheme
JP5452428B2 (en) Stream dividing apparatus and receiving apparatus
US20150121445A1 (en) Apparatus and method for transmitting and receiving broadcasting
CN101198053B (en) Video data self-adapting partition device in encoder
CN101984655A (en) Digital television receiving system and channel changing method
US20110096775A1 (en) System and method for multiplexing and streaming contents
KR100760260B1 (en) Apparatus and Method for creating transport stream for efficient transmission of timing information, and DMB transmission system using it
CN1510922A (en) Methof for sealing MPEG-4 compressive video frequency data and applied system thereof
KR101414638B1 (en) IPTV receiver and method of changing channel
US7949052B1 (en) Method and apparatus to deliver a DVB-ASI compressed video transport stream

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110622