CN101267572B - A program stream conversion method and device - Google Patents

A program stream conversion method and device Download PDF

Info

Publication number
CN101267572B
CN101267572B CN2008100938524A CN200810093852A CN101267572B CN 101267572 B CN101267572 B CN 101267572B CN 2008100938524 A CN2008100938524 A CN 2008100938524A CN 200810093852 A CN200810093852 A CN 200810093852A CN 101267572 B CN101267572 B CN 101267572B
Authority
CN
China
Prior art keywords
audio
video
rtp
reproduction time
video unit
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
Application number
CN2008100938524A
Other languages
Chinese (zh)
Other versions
CN101267572A (en
Inventor
刘辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2008100938524A priority Critical patent/CN101267572B/en
Publication of CN101267572A publication Critical patent/CN101267572A/en
Application granted granted Critical
Publication of CN101267572B publication Critical patent/CN101267572B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for program stream switch. The method comprises the steps of obtaining a start playing time from a multiplexing subframe head, and obtaining the relative playing time of an audio or video unit from an audio segment or video segment; calculating the common timestamp of all multiplexing blocks in the audio or video unit according to the start playing time and the relative playing time; extracting an audio multiplexing block payload or an video multiplexing block payload from the audio or video unit as the load of an audio or video RTP packet each time, and generating a corresponding RTP serial number, as well as packing and sending the RTP packet with the common timestamp of the audio or video unit as the timestamp of the RTP packet head. According to the invention, the programs of CMMB multiplexing mode 2 are converted to RTP protocol programs, which makes it convenient for terminal processing to integrate current stream media players, mature playing modules are fully made used of, and the development cost of terminals is lowered.

Description

A kind of method and device of program stream conversion
Technical field
The present invention relates to field of mobile phone or other digital TV field, specifically, relate to method and device that a kind of program stream with the CMMB multiplex protocol converts rtp streaming to, be applicable to multiplexer mode 2.
Background technology
Mobile Multimedia Broadcasting is a kind of multimedia broadcasting technology of promoting recently, handheld terminal can receive broadcast singal under mobile status, can watch TV programme through terminal processes, the program receiving TV Guide, can demonstrate the rendition list in terminal, allow the user can watch program selectively.In addition, this technology is also supported the broadcasting of other multi-medium datas, realizes watching real-time stock information and other information on portable terminal.
In CMMB (China Mobile multimedia broadcasting) standard, every road TV programme all takies a broadcast channel, and on physical layer, the broadcast channel correspondence planning in advance good frequency and some time slots.TV programme is carried by multiplexed frame, comprises several multiplexed sub frames in each multiplexed frame.Audio frequency, video data are encapsulated in the audio section and video-frequency band of multiplexed sub frame; Write down the total initial reproduction time of all audio units of this subframe, video unit and the relative reproduction time of each unit in multiplexed sub frame, by these two timestamps, player carries out audio-visual synchronization to be handled.In multiplexer mode 2, sound, video unit have also further comprised one or more multiplexing, and each multiplexing block payload is corresponding one by one with the load of sound, video RTP bag.
Another mobile multimedia is based on the stream media technology of IP, and audio frequency, video data are encapsulated in RTP (the RTP Real Time Transport Protocol) bag.Each RTP bag comprises RTP head, payload header (optional) and load itself.Mainly contain the end that timestamp, sequence number and marker bit are marked with one group of RTP bag of same timestamp in the RTP packet header.Timestamp by each packet header guarantees the synchronous of reproduction time, guarantees the broadcast order that wraps by sequence number.
But, do not have a kind of method that the program stream of CMMB agreement can be converted to the program stream of RTP encapsulation now.If can realize this conversion, so for terminal processes, can integrated easily existing DST PLAYER, improve development rate, reduce the development cost of terminal.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of method and device of program stream conversion, makes the CMMB program that meets multiplexer mode 2 can be directly changed into the program of Real-time Transport Protocol.
In order to address the above problem, the invention provides a kind of method of program stream conversion, comprising:
The initial reproduction time that from the multiplexed sub frame head, obtains, and the relative reproduction time of the audio or video unit that from audio section or video paragraph header, obtains;
Calculate all shared timestamps of multiplexing in the described audio or video unit according to initial reproduction time and relative reproduction time;
From described audio or video unit, extract an audio-frequency multiplex block payload or video multiplex block payload at every turn, as the load of audio or video realtime transmission protocol RTP bag and produce a corresponding RTP sequence number, and the shared timestamp of this audio or video unit as the timestamp in this RTP packet header, is sent after finishing the encapsulation of RTP bag;
Further, according to initial reproduction time and relative reproduction time, obtain the reproduction time of this audio frequency, video unit, and obtain sound, video sampling rate from the multiplexed sub frame head, converting obtains the RTP timestamp;
Further, during in handling an audio or video unit successively multiplexing, produce and keep the RTP sequence number that adds up continuously, and the RTP sequence number of the RTP sequence number of audio frequency and video is separate;
Further, when filling in other territories in the RTP packet header, the V territory in the RTP packet header is changed to 2, the P territory is changed to 0, and the X territory is changed to 0, no SSRC territory, no CSRC territory;
Further, when filling in other territories in the RTP packet header, from multiplexing build, obtain end mark, the M territory in the corresponding RTP packet header is set; According to " video algorithm type " in the multiplexed sub frame head and " audio algorithm type ", convert the PT territory in the RTP packet header to;
In order to address the above problem, the present invention also provides a kind of device that carries out the program stream conversion, comprises information extraction modules, memory module, modular converter, package module;
Described information extraction modules, be used for obtaining initial reproduction time from the multiplexed sub frame head, from audio section or video paragraph header, obtain the relative reproduction time of audio or video unit, and calculate all shared timestamps of multiplexing in this audio or video unit respectively according to described initial reproduction time and relative reproduction time, from described audio or video unit, extract audio-frequency multiplex block payload or video multiplex block payload, send to described modular converter with described shared timestamp;
Described modular converter, audio-frequency multiplex block payload that at every turn from described audio or video unit, extracts according to described information extraction modules or video multiplex block payload, load as an audio or video realtime transmission protocol RTP bag, and produce a corresponding RTP sequence number, and the shared timestamp of this audio or video unit as the timestamp in this RTP packet header, is sent to described memory module with the timestamp in load, corresponding RTP sequence number and the described RTP packet header of described audio or video RTP bag and preserves;
Described memory module is used to preserve the information that obtains after the conversion that described modular converter transmits and the corresponding relation between described information;
Described package module is packaged into the RTP bag according to information of preserving in the described memory module and corresponding relation;
Further, described information extraction modules also is used for obtaining end mark from multiplexing build, obtains video or audio algorithm type from the multiplexed sub frame head, and described end mark, video or audio algorithm type are sent to described modular converter.
Compared with prior art, the present invention has converted the program of CMMB multiplexer mode 2 to the program of the packing manner of following RTP (RTP) regulation, for terminal processes, can integrated easily existing DST PLAYER, make full use of ripe playing module, reduced the development cost of terminal.
Description of drawings
Fig. 1 is the schematic diagram of the program stream of multiplexer mode 2 in the embodiment of the invention;
Fig. 2 is the flow chart that the program stream of multiplexer mode 2 in the embodiment of the invention converts the RTP bag to;
Fig. 3 is the structure chart of program stream conversion equipment in the embodiment of the invention.
Embodiment
The present invention is in order to solve the drawback that conventional solution exists, further set forth the method for a kind of program stream conversion of the present invention and device by following specific embodiment with this function, below embodiment is described in detail, but not as a limitation of the invention.
As shown in Figure 1, be the schematic diagram of the program stream of multiplexer mode 2;
From the multiplexed sub frame head, obtain " initial reproduction time ", from sound, video paragraph header, obtain " reproduction time relatively " of sound, video unit respectively, according to " initial reproduction time " and " relative reproduction time ", obtain the reproduction time of this audio frequency, video unit, and from the multiplexed sub frame head, obtain (sound, video) sample rate, be converted into the RTP timestamp;
Wherein, the unit of " initial reproduction time " and " relative reproduction time " is 1/22500 second; And in the same audio or video unit multiplexing when changing into the RTP bag, all shared identical timestamp;
At this moment, begin conversion, at first, fill in load: from multiplexed sub frame, extract the multiplexing block payload of an audio or video, as the RTP load of audio or video; For multiplexer mode 2, in the multiplexed sub frame, there are relation one to one in the multiplexing block payload of audio or video and RTP load;
Afterwards, fill in packet header: produce the RTP sequence number, fill in the sequence number territory in audio or video RTP packet header, during in handling this audio or video unit successively multiplexing, produce the RTP sequence number that maintenance adds up continuously, the RTP sequence number that to be this RTP sequence number produced when handling last one multiplexing is continuous, so-called last one multiplexing may be in this audio or video unit multiplexing, also may be multiplexing in the audio or video unit of a last multiplexed sub frame, and the RTP sequence number of the RTP sequence number of audio frequency and video be mutually independent; The shared timestamp that calculates before utilizing is filled the timestamp territory in audio frequency, video RTP packet header, wherein, if a plurality of multiplexing appearance are arranged in the same audio or video unit, then a plurality of multiplexing after changing into a plurality of RTP bags, its RTP timestamp is identical; Fill in other territories in the RTP packet header: " V " territory in the RTP packet header is changed to 2, " P " territory is changed to 0, " X " territory is changed to 0, there is not " SSRC " territory, there is not " CSRC " territory, according to obtaining " end mark " in the multiplexing build " M " territory in the corresponding RTP packet header is set,, converts " PT " territory in the RTP packet header to according to " video algorithm type " in the multiplexed sub frame head and " audio algorithm type ";
Need to prove, fill in load and fill in packet header and do not have sequencing, fill in load in this example earlier, fill in packet header again, also can fill in packet header earlier in another embodiment, fill in load again;
At last, encapsulate: RTP packet header and load thereof are packaged into a RTP bag send.
At this moment, if that finish dealing with is last multiplexing of video (audio frequency) unit, then begin to handle next video (audio frequency) unit; Otherwise, continue to handle next multiplexing in this video (audio frequency) unit.
As shown in Figure 2, for the program stream of multiplexer mode 2 converts the flow chart of RTP bag to, when carrying out conversion operations, processing to video unit and audio unit is independently carried out separately, but handling process is identical, is that example describes with a video unit below, and concrete steps are as follows:
Step 200 enters video unit, obtains " initial reproduction time " earlier from the multiplexed sub frame head, obtains " reproduction time relatively " of video unit from the video paragraph header respectively, calculates all total timestamps of multiplexing of this video unit;
Step 201 from video unit, is extracted a multiplexing block payload of video, as the RTP load of video;
Step 202 produces a RTP sequence number, fills in to the sequence number territory in video RTP packet header; When multiplexing of handling successively in the video unit, produce the RTP sequence number that maintenance adds up continuously, the RTP sequence number that to be this RTP sequence number produced when handling last one multiplexing is continuous, so-called last one multiplexing may be in this video unit multiplexing, also may be multiplexing in the video unit of a last multiplexed sub frame, and the RTP sequence number of the RTP sequence number of video and audio frequency be mutually independent;
Step 203 is used the shared timestamp that calculates in the step 200, fills in to the RTP packet header of video (audio frequency);
Step 204 judges whether last multiplexing of video unit, if then execution in step 205; If not, then execution in step 206;
Step 205 puts 1, execution in step 207 with " M " territory in the RTP packet header;
Step 206 puts 0, execution in step 207 with " M " territory in the RTP packet header;
Step 207, fill in other territories in the RTP packet header: " V " territory is changed to 2, and " P " territory is changed to 0, " X " territory is changed to 0, does not have " SSRC " territory, does not have " CSRC " territory, and, convert " PT " territory in the RTP packet header to according to " video algorithm type " in the multiplexed sub frame head and " audio algorithm type ";
Step 208, encapsulation RTP bag also sends;
Step 209, if multiplexing of last of video unit, then execution in step 210; Otherwise, return execution in step 201, continue to handle next multiplexing in the same unit;
Step 210 begins to handle next video unit, is still undertaken by the scheme of this flow process.
Wherein, step 201 to the described load of filling in of step 207 does not limit the present invention with the sequencing of filling in packet header.
In another embodiment, also can as above operate audio unit, flow process is identical, has not just given unnecessary details at this.
As shown in Figure 3, be the structure chart of program stream conversion equipment in the embodiment of the invention, comprising: information extraction modules 10, memory module 30, modular converter 20, package module 40;
Described information extraction modules 10, be used for obtaining initial reproduction time from the multiplexed sub frame head, from audio section or video paragraph header, obtain the relative reproduction time of audio or video unit, and according to initial reproduction time and all shared timestamps of multiplexing in relative reproduction time calculates this audio or video unit respectively, from described audio or video unit, extract audio-frequency multiplex block payload or video multiplex block payload, send to described modular converter 20 with described shared timestamp; Also be used for obtaining end mark, from the multiplexed sub frame head, obtain video or audio algorithm type, described end mark, video or audio algorithm type are sent to described modular converter 20 from multiplexing build;
Described modular converter 20, audio-frequency multiplex block payload that at every turn from described audio or video unit, extracts according to described information extraction modules 10 or video multiplex block payload, as the load of an audio or video realtime transmission protocol RTP bag and produce a corresponding RTP sequence number (during in processing audio or video unit successively multiplexing, the RTP sequence number that is produced keeps adding up continuously, and the RTP sequence number of audio frequency and the RTP sequence number of video are separate), and the shared timestamp of this audio or video unit as the timestamp in this RTP packet header, is sent to described memory module 30 and preserves; The described end mark that transmits according to described information extraction modules 10 is provided with the M territory in the corresponding RTP packet header, according to described video or audio algorithm type, converts the PT territory in the corresponding RTP packet header to, and sends to described memory module and preserve 30; Also be used for the V territory in RTP packet header is changed to 2, the P territory is changed to 0, and the X territory is changed to 0, no SSRC territory, and no CSRC territory, and send to described memory module 30 preservations;
Described memory module 30, be used for preserving the timestamp in the load of the audio or video RTP bag that described modular converter 20 transmits, corresponding RTP sequence number, described RTP packet header, the value in V territory, P territory, X territory, SSRC territory, CSRC territory, M territory and PT territory and the corresponding relation between these information combination;
Described package module 40 is packaged into the RTP bag according to information of preserving in the described memory module 30 and corresponding relation.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.

Claims (7)

1. the method for a program stream conversion is characterized in that, comprising:
The initial reproduction time that from the multiplexed sub frame head that China Mobile multimedia broadcasting CMMB standard agreement is described, obtains, and the relative reproduction time of the audio or video unit that from audio section or video paragraph header, obtains;
Calculate all shared timestamps of multiplexing in the described audio or video unit according to initial reproduction time and relative reproduction time;
From described audio or video unit, extract an audio-frequency multiplex block payload or video multiplex block payload at every turn, as the load of audio or video realtime transmission protocol RTP bag and produce a corresponding RTP sequence number, and the shared timestamp of this audio or video unit as the timestamp in this RTP packet header, is sent after finishing the encapsulation of RTP bag.
2. the method for claim 1 is characterized in that,
According to initial reproduction time and relative reproduction time, obtain the reproduction time of this audio or video unit, and from the multiplexed sub frame head, obtain sound, video sampling rate, converting obtains the RTP timestamp.
3. the method for claim 1 is characterized in that,
During in handling an audio or video unit successively multiplexing, produce and keep the RTP sequence number that adds up continuously, and the RTP sequence number of the RTP sequence number of audio frequency and video is separate.
4. the method for claim 1 is characterized in that,
When filling in other territories in the RTP packet header, the V territory in the RTP packet header is changed to 2, the P territory is changed to 0, and the X territory is changed to 0, no SSRC territory, no CSRC territory.
5. the method for claim 1 is characterized in that,
When filling in other territories in the RTP packet header, from multiplexing build, obtain end mark, the M territory in the corresponding RTP packet header is set; According to " video algorithm type " in the multiplexed sub frame head and " audio algorithm type ", convert the PT territory in the RTP packet header to.
6. a device that carries out the program stream conversion is characterized in that, comprises information extraction modules, memory module, modular converter, package module;
Described information extraction modules, be used for obtaining initial reproduction time from the multiplexed sub frame head that China Mobile multimedia broadcasting CMMB standard agreement is described, from audio section or video paragraph header, obtain the relative reproduction time of audio or video unit, and calculate all shared timestamps of multiplexing in this audio or video unit respectively according to described initial reproduction time and relative reproduction time, from described audio or video unit, extract audio-frequency multiplex block payload or video multiplex block payload, send to described modular converter with described shared timestamp;
Described modular converter, audio-frequency multiplex block payload that at every turn from described audio or video unit, extracts according to described information extraction modules or video multiplex block payload, load as an audio or video realtime transmission protocol RTP bag, and produce a corresponding RTP sequence number, and the shared timestamp of this audio or video unit as the timestamp in this RTP packet header, is sent to described memory module with the timestamp in load, corresponding RTP sequence number and the described RTP packet header of described audio or video RTP bag and preserves;
Described memory module is used to preserve the information that obtains after the conversion that described modular converter transmits and the corresponding relation between described information;
Described package module is packaged into the RTP bag according to information of preserving in the described memory module and corresponding relation.
7. device that carries out program stream conversion as claimed in claim 6, it is characterized in that, described information extraction modules also is used for obtaining end mark from multiplexing build, from the multiplexed sub frame head, obtain video or audio algorithm type, described end mark, video or audio algorithm type are sent to described modular converter.
CN2008100938524A 2008-04-30 2008-04-30 A program stream conversion method and device Expired - Fee Related CN101267572B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100938524A CN101267572B (en) 2008-04-30 2008-04-30 A program stream conversion method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100938524A CN101267572B (en) 2008-04-30 2008-04-30 A program stream conversion method and device

Publications (2)

Publication Number Publication Date
CN101267572A CN101267572A (en) 2008-09-17
CN101267572B true CN101267572B (en) 2010-07-14

Family

ID=39989649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100938524A Expired - Fee Related CN101267572B (en) 2008-04-30 2008-04-30 A program stream conversion method and device

Country Status (1)

Country Link
CN (1) CN101267572B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605252B (en) * 2009-07-17 2011-07-20 深圳创维数字技术股份有限公司 Method and system for converting program stream into transport stream
CN102868937A (en) * 2011-07-08 2013-01-09 中兴通讯股份有限公司 Method and system for transmitting multimedia data
WO2016008131A1 (en) * 2014-07-17 2016-01-21 21 Vianet Group, Inc. Techniques for separately playing audio and video data in local networks
CN105049917B (en) * 2015-07-06 2018-12-07 深圳Tcl数字技术有限公司 The method and apparatus of recording audio/video synchronized timestamp

Also Published As

Publication number Publication date
CN101267572A (en) 2008-09-17

Similar Documents

Publication Publication Date Title
CN101282482B (en) Apparatus, system and method for synchronously playing video data and audio data
CN101827271B (en) Audio and video synchronized method and device as well as data receiving terminal
CN101179736B (en) Method for converting transmission stream program to China mobile multimedia broadcasting program
CN1972454A (en) Mobile multimedia broadcasting real-time traffic flow packaging method
CN101371488A (en) Synchronization method and system between different media flows
CN101729908B (en) Synchronous multiplexing method for video and audio of transmission stream
WO2008028367A1 (en) A method for realizing multi-audio tracks for mobile mutilmedia broadcasting system
CN102196319A (en) Live streaming service system and realization method
CN107079028A (en) Dispensing device and reception device and its signal processing method
CN1972453B (en) A data flow packaging method of mobile multimedia broadcasting system
CN101267572B (en) A program stream conversion method and device
CN100479529C (en) Conversion method of multiplexing protocols in broadcast network
CN101159579A (en) Method and terminal of receiving network transport protocol based stream media data
CN1972408A (en) A data transmission method for mobile multimedia broadcasting system
CN101150383A (en) IP data transmission method
CN1960328B (en) Method for packaging real time stream of mobile multimedia broadcast
CN101163226B (en) Method and system for implementing mobile video session using WiMAX network
CN1976477B (en) Mobile multi-media broadcasting data transmitting method
CN109040818A (en) Audio and video synchronization method, storage medium, electronic equipment and system when live streaming
CN101179735A (en) Packaging method of multimedia broadcasting system media data flow
CN1972443A (en) MPEG1 file real-time playing method based on IP STB
CN103024369B (en) Transmitting terminal, terminal, the system and method for hierarchical coding multiplexing
CN101453286B (en) Method for digital audio multiplex transmission in multimedia broadcasting system
CN101179738B (en) Conversion method from transmission stream to China mobile multimedia broadcasting multiplex protocol
CN102075818B (en) Method for processing intelligent personal television (IPTV) network television data of global system for mobile communication (GSM) mobile phone

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: 20100714

Termination date: 20170430

CF01 Termination of patent right due to non-payment of annual fee