WO2008055420A1 - Procédé de synchronisation entre différents flux de média et un système - Google Patents

Procédé de synchronisation entre différents flux de média et un système Download PDF

Info

Publication number
WO2008055420A1
WO2008055420A1 PCT/CN2007/003176 CN2007003176W WO2008055420A1 WO 2008055420 A1 WO2008055420 A1 WO 2008055420A1 CN 2007003176 W CN2007003176 W CN 2007003176W WO 2008055420 A1 WO2008055420 A1 WO 2008055420A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
correspondence
media stream
pts
stream
Prior art date
Application number
PCT/CN2007/003176
Other languages
English (en)
French (fr)
Inventor
Li Chen
Hongguang Guan
Guoxin Shi
Balakrishnan Usha
Original Assignee
Huawei Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Priority to CN2007800024610A priority Critical patent/CN101371488B/zh
Publication of WO2008055420A1 publication Critical patent/WO2008055420A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/062Synchronisation of signals having the same nominal but fluctuating bit rates, e.g. using buffers
    • H04J3/0632Synchronisation of packets and cells, e.g. transmission of voice via a packet network, circuit emulation service [CES]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43072Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of multiple content streams on the same device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
    • H04N21/4622Retrieving content or additional data from different sources, e.g. from a broadcast channel and the Internet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays

Definitions

  • the present invention relates to a synchronization technique for data streams between media streams, and more particularly to a technique for synchronizing data streams between different media streams.
  • MPEG Moving Picture Exports Group
  • MPEG-2 is one of its international standards (Moving Picture and Sound Coding), which was developed in 1994 and is designed for advanced industrial standard image quality and higher transmission rates.
  • the code rate is from 3 megabits to 100 megabits per second, which is a broadcast-quality image compression standard with CD-quality sound quality.
  • It is one of the core technologies in the fields of digitalization of conventional TV, HDTV HDTV, VOD on video, and interactive TV.
  • Figure 1 is a schematic diagram of the timing model of MPEG-2. As shown in the figure, synchronization in MPEG-2 refers not only to the synchronization between the audio stream and the video stream of the same program, but also to the end-to-end synchronization between the encoder and the decoder. .
  • the synchronization in the MPEG-2 TS stream is implemented by time stamping.
  • the time stamp is created by a single Common System Clock (STC) 27 MHz in the encoder.
  • STC Common System Clock
  • the program reference clock (PCR, Program Clock Reference) indicating the system clock value in the TS header, and only one PCR per program;
  • the Packetized Elementary Stream (PES) header indicates the correct decoding timestamp (DTS, Decoding time-stamp) and presentation time-stamp (PTS, Presentation time-stamp) for audio and video.
  • DTS decoding timestamp
  • PTS presentation time-stamp
  • Each storage unit is equipped with a pair of PTSs. +DTS or a PTS. 2. Synchronization mechanism in the TS stream.
  • the decoder When decoding, the decoder first uses the 27MHz system clock synchronized with the encoder and the encoder to recover the 27MHz system clock, and then uses the DTS and PTS in the PES stream to synchronize the audio and video.
  • FIG. 2 is a schematic flow chart of reconstructing a 27 MHz system clock by PCR.
  • the decoder extracts time information from the header of the input code stream and sends it to the system time clock recovery circuit; the system time clock recovery circuit receives each When a new PCR is performed, local system time clock recovery and phase locking are performed.
  • the PCR of a new program arrives at the decoder, the time base point needs to be updated, and the STC is set to the current value in the PCR.
  • the first PCR solution demultiplexed from the demultiplexer is directly loaded into the STC counter.
  • the PCR value is used as the reference frequency of the phase-locked loop to compare with the current value of the STC.
  • the resulting difference is pulse-width modulated and then input.
  • the control signal is used to control the instantaneous frequency of the Voltage Controlled Oscillator (VCO).
  • VCO Voltage Controlled Oscillator
  • the VCO output frequency is an oscillation signal of about 27MHz, which serves as the system clock of the decoder.
  • the presentation timestamp PTS and the decoding timestamp DTS are solved from the PES header and sent to the decoder.
  • the packet elementary stream decoder After receiving the new PTS DTS, the packet elementary stream decoder is stored in the corresponding first in first out (FIFO) memory for management. For the display unit without PTS/DTS, the difference calculation method is used. Its corresponding timestamp is sent to the FIFO for management.
  • FIFO first in first out
  • each display unit Before each display unit starts decoding, it compares with its corresponding DTS and STC, and starts decoding when STC is equal to DTS.
  • each display unit Before each display unit starts to display, it compares the PTS with the STC, and starts displaying when the STC is equal to the PTS.
  • the real-time transport protocol stream (RTP, Realtime Transport Protocol) synchronization.
  • RTP is a transmission protocol for multimedia data streams on the Internet. It is published by the Internet Engineering Task Force (IETF) as RFC 1889. RTP is defined to work in one-to-one or one-to-many transmissions, with the goal of providing time information and implementation streams. Synchronize. A typical application of RTP is based on the User Datagram Protocol (UDP), but it can also work on the Transmission Control Protocol (TCP) or other protocols. RTP itself only guarantees the transmission of real-time data, and does not provide a reliable transmission mechanism for transmitting packets in sequence, nor does it provide flow control or congestion control. It relies on Real Time Transport Control Protocol (RTCP) to provide these services.
  • RTCP Real Time Transport Control Protocol
  • RTCP is responsible for managing the transmission quality to exchange control information between current application processes.
  • each participant periodically transmits RTCP packets, which contain statistics such as the number of packets sent, the number of lost packets, and so on, so the server can use this information to dynamically change the transmission rate, even Change the payload type.
  • RTCP packets which contain statistics such as the number of packets sent, the number of lost packets, and so on, so the server can use this information to dynamically change the transmission rate, even Change the payload type.
  • the combination of RTP and RTCP optimizes transmission efficiency with effective feedback and minimal overhead, making it ideal for real-time data transmission over the network.
  • the timestamp field is the synchronization information in the RTP header that describes the packet time and is the key to the data in the correct time sequence.
  • the value of the timestamp gives the sampling time of the first byte of data in the packet (Sampling Instant), requiring the clock of the sender's timestamp to be continuous, monotonically increasing, even when there is no data input or data to send. In the silent state, the sender does not have to send data, keep the timestamp grows.
  • the sequence number of the received data packet is not lost, it is known that no data loss occurs, and as long as the difference of the timestamps of the preceding and following packets is compared, You can determine the time interval of the output.
  • the real-time streaming protocol (RTSP) is used to play the RTP program.
  • RTSP is an application layer protocol designed to provide multicast and multicast-on-demand single-delivery protocols for streaming media.
  • RTSP uses streaming technology to divide data into many packets. The size of the packet is determined by the actual bandwidth of the client and the server.
  • the streaming media data can be input live information or a stored video or audio clip.
  • the server can track the time, address and mode of streaming media transmission.
  • RTSP adds control requests to streaming media and can recover streaming media from media servers Body.
  • the sampling frequency is 8000 Hz (the sampling frequency is determined by the load format), the packing interval is 100 ms, the initialized sequence number and the RTP timestamp (rtp timestam) are 0, and the shell 'j is expressed as:
  • the above example shows the correspondence between RTP timestamp and NPT time.
  • the terminal converts the RTP time-stam of multiple RTP streams into a unified NPT, and simultaneously displays the same NPT (with a difference within a certain range). .
  • Embodiments of the present invention provide a synchronization method and system between different media streams for implementing synchronization between media streams from different network media. Further, it is used to implement synchronization between the RTP stream and the TS stream.
  • the method for synchronizing different media streams includes the following steps: establishing a first correspondence between a first time information of a first media stream data packet and a first display time; establishing a second media stream data packet a second correspondence between the second time information and the second display time; according to the correspondence, when the first display time and the second display time difference corresponding to the time information are less than a threshold, the first media stream packet and the second Media stream packets are displayed at the same time.
  • the embodiment of the invention further provides a synchronization system between different media streams, including:
  • a first corresponding module configured to establish a first correspondence between the first time information of the first media stream data packet and the first display time
  • a second corresponding module configured to establish a second correspondence between the second time information of the second media stream data packet and the second display time
  • a display module configured to display the first media stream data packet and the second media stream data packet simultaneously when the first display time and the second display time difference corresponding to the time information are less than a threshold according to the corresponding relationship.
  • An embodiment of the present invention further provides a media stream sending method, including the following steps:
  • Transmitting the first media stream and the second media stream to the terminal where the first media stream and/or the second media stream includes: a first correspondence between the first time information of the first media stream data packet and the first display time Information, second correspondence information of the second media stream packet second time information and the second display time.
  • the embodiment of the present invention further provides a media stream sending system, including a first media stream server that sends a first media stream to a terminal, a second media stream server that sends a second media stream to the terminal, and a corresponding relationship placement module.
  • Corresponding relationship information is set in the first media stream sent by the first media stream server to the terminal, and/or the second media stream sent by the second media stream server to the terminal, where the corresponding relationship includes: the first media stream data First correspondence between the first time information of the package and the first display time The relationship, the second correspondence between the second media stream packet second time information and the second display time.
  • the present invention is to establish a correspondence relationship by using time information embedded in each data packet in a respective media stream, and at the same time, since different media streams need to complete synchronization, there must be a reason for synchronization, for example, simultaneous display, etc.,
  • This common factor establishes a common time coordinate, and then uses the established correspondence to coordinate control, thereby solving the synchronization problem between different media streams.
  • the synchronization between the TS stream and the RTP stream is taken as an example, and the correspondence between the TS stream PTS and the NPT and the correspondence between the RTP stream time-stamp and the PT are the same, and the NPT is the same.
  • the TS stream storage unit is displayed simultaneously with the presentation unit in the RTP stream packet, thereby completing synchronization between the two streams.
  • the program from the broadcast network and the synchronization from the broadband program are realized, and the synchronization between the media streams from different networks is solved, which has significant practical effects and significance in the modern streaming media technology.
  • FIG. 1 is a schematic diagram of a timing model of MPEG-2 described in the background art
  • FIG. 2 is a schematic flow chart of reconstructing a 27 MHz system clock by PCR according to the background art
  • FIG. 3 is a schematic diagram of an application scenario according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a method for synchronizing a RTP stream and a TS stream according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a basic principle of synchronizing a single presentation unit in a method for synchronizing an RTP stream and a TS stream according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a basic principle of synchronization of multiple presentation units in a method for synchronizing RTP streams and TS streams according to an embodiment of the present invention
  • FIG. 7 is a schematic flowchart diagram of a specific embodiment of a method for synchronizing an RTP stream and a TS stream according to an embodiment of the present invention
  • FIG. 8 is a schematic diagram of a basic principle of synchronizing a single presentation unit by using NTP in the method for synchronizing the RTP stream and the TS stream according to the embodiment of the present invention
  • FIG. 9 is implemented by using NTP in the method for synchronizing the RTP stream and the TS stream according to the embodiment of the present invention. Schematic diagram of the synchronization principle of multiple presentation units;
  • FIG. 10 is a schematic flowchart diagram of another specific embodiment of a method for synchronizing an RTP stream and a TS stream according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a synchronization system of an RTP stream and a TS stream according to an embodiment of the present invention
  • FIG. 12 is a schematic diagram of data of the PES packet header according to an embodiment of the present invention
  • FIG. 13 is a schematic diagram of a system architecture of a first embodiment carrying a corresponding relationship according to an embodiment of the present invention
  • FIG. 14 is a schematic diagram of an implementation flow of a broadcast program stream carrying a correspondence relationship according to an embodiment of the present invention.
  • FIG. 15 is a schematic diagram of a system architecture of a first embodiment carrying a corresponding relationship according to an embodiment of the present disclosure
  • FIG. 16 is a schematic diagram of a second implementation flow of a broadcast program stream carrying a correspondence relationship according to an embodiment of the present invention.
  • FIG. 17 is a schematic diagram of a system architecture of a first embodiment carrying a corresponding relationship according to an embodiment of the present invention.
  • FIG. 18 is a schematic diagram of a system architecture of a first embodiment carrying a corresponding relationship according to the first embodiment of the present invention.
  • FIG. 19 is a schematic diagram showing a fourth implementation flow of a broadcast program stream carrying a correspondence relationship according to an embodiment of the present invention.
  • FIG. 20 is a schematic structural diagram of a PES packet according to an embodiment of the present invention.
  • FIG. 21 is a schematic diagram of a system architecture of a second embodiment carrying a corresponding relationship according to an embodiment of the present invention.
  • FIG. 22 is a schematic diagram of an implementation flow of the RTP flow/RTC packet carrying a correspondence relationship according to an embodiment of the present invention
  • FIG. 23 is a schematic diagram of an implementation flow 2 of the RTP flow/RTC packet carrying a correspondence relationship according to an embodiment of the present disclosure
  • FIG. 24 is a flowchart of Embodiment 3 of carrying the correspondence between the RTP stream and the RTCP packet in the embodiment of the present invention.
  • FIG. 25 is a schematic diagram of a system architecture of a second embodiment carrying a corresponding relationship according to the second embodiment of the present invention.
  • FIG. 26 is a schematic diagram of a fourth implementation flow of the RTP flow/RTCP packet carrying correspondence in the embodiment of the present invention.
  • FIG. 27 is a schematic structural diagram of the RTP packet header according to an embodiment of the present invention.
  • FIG. 29 is a schematic structural diagram of the RTCP SR packet according to an embodiment of the present invention.
  • FIG. 30 is a schematic structural diagram of the RTCP SDES packet according to an embodiment of the present invention.
  • FIG. 31 is a schematic structural diagram of an APP: Application-Defined RTCP Packet header according to an embodiment of the present invention
  • FIG. 32 is a schematic diagram of a structure of an APP: Application-Defined RTCP Packet according to an embodiment of the present invention
  • FIG. 33 is a schematic structural diagram of a system for carrying out a correspondence relationship by using a mapping server according to the third embodiment of the present disclosure
  • FIG. 34 is a schematic diagram of an implementation process of using a mapping server to carry a corresponding relationship according to an embodiment of the present disclosure
  • FIG. 35 is a schematic diagram of an implementation flow 2 of using a mapping server to carry a corresponding relationship according to an embodiment of the present disclosure
  • FIG. 36 is a schematic diagram of a third implementation process of using a mapping server to carry a corresponding relationship according to an embodiment of the present disclosure
  • FIG. 37 is a schematic structural diagram of a transmitting system according to an embodiment of the present invention.
  • FIG. 38 is a schematic structural diagram of a second sending system according to an embodiment of the present invention.
  • FIG. 39 is a schematic structural diagram of three transmission systems according to an embodiment of the present invention. detailed description
  • the concept of the embodiment of the present invention is to first establish a first correspondence between the first time information of the first media stream data packet and the first display time, and establish a second time information of the second media stream data packet and the second display time.
  • Corresponding relationship; 4 according to the correspondence relationship, when the first display time and the second display time difference corresponding to the time information are less than the threshold, the first media stream data packet and the second media stream data packet are simultaneously displayed.
  • the essence of the embodiments of the present invention is that a correspondence relationship is established by using time information embedded in each data packet in a respective media stream, and at the same time, since different media streams need to complete synchronization, the reason why synchronization needs to be performed is necessary, for example, simultaneous display is required. Etc., using this common factor to establish a common time coordinate, and then use the established correspondence to coordinate control, thus solving the synchronization problem between different media streams.
  • the embodiments of the present invention use the inherent natural laws in different media streams. Therefore, in the specific implementation of the present invention, two types of media streams are used: the synchronization of the TS stream and the RTP stream is taken as an example to illustrate the present invention. The specific embodiment and the present invention, but it is obvious that the embodiment of the present invention is not only applicable to solving the synchronization problem between the TS stream and the RTP stream.
  • FIG. 3 is a schematic diagram of an application scenario according to an embodiment of the present invention.
  • the TS stream and the RTP stream are synchronously coordinated in the figure. After that, it will show up at the same time.
  • the user turns on the TV and wants to watch the broadcast network program.
  • the user wants to select the broadband program for viewing.
  • the broadcast network program and the broadband program can be displayed in a certain way in the terminal, such as: picture-in-picture, multi-screen Displaying and the like; when the broadcast program is a video program, the broadband program is an audio program; or the broadcast program is a video, an audio program, and the broadband is a second video program (matching with a broadcast video program picture); the broadcast program is low definition
  • the video, audio, and wideband programs are additional definition video and audio. If you want the selected broadband program to be synchronized with the program of the broadcast network, then the two can be synchronized and coordinated by the embodiment of the present invention to display Match high-definition TV shows and more.
  • an embodiment of the present invention is to provide a method of realizing a program from a broadcast network and a synchronization program from a broadband program.
  • synchronization between media from different networks is solved, such as: a program stream (TS stream) from a broadcast network and an RTP program stream from a broadband network.
  • FIG. 4 is a schematic diagram of a method for synchronizing an RTP stream and a TS stream, as shown in the figure, including when synchronizing 76 The following steps:
  • Step 401 Establish a first correspondence between the timestamp of the transport stream and the normal play time.
  • Step 402 Establish a second correspondence between the timestamp of the real-time transport protocol flow and the normal play time.
  • Step 403 The transport stream is sent according to the first correspondence.
  • the presentation timestamp of the storage unit in the storage unit corresponds to the normal play time, and the real-time transport protocol packet is corresponding to the normal play time according to the second correspondence relationship.
  • Step 404 Display the storage unit with the same normal play time and the real-time transport protocol package simultaneously.
  • Presentation time-stamp in the PES header of the TS stream, used to indicate a presentation unit, the presentation unit is a decoded audio access unit or a frame decoded image in the system target The current moment in the decoder;
  • the program reference clock in the TS header is PCR
  • the timestamp (RTP time-stamp) in the RTP header indicates the sampling time of the first byte of the RTP packet. Even if no RTP packet is sent, the times-tamp still grows according to the sampling frequency, and multiple RTP packets.
  • the time stamps can be the same, indicating that the data is sampled at the same time, and is divided into multiple RTP data frame transmissions;
  • the sampling frequency can be known according to the type of media;
  • Range header and RTP-Info header in the PLAY response of RTSP can be used to know the correspondence between RTP timestamp and normal play time (NPT).
  • FIG. 5 is a schematic diagram of the basic principle of synchronization of a single presentation unit in a method for synchronizing an RTP stream and a TS stream, as shown in the figure,
  • RTP(t) the RTP timestam of the tth presentation unit in the RTP packet
  • PTS of the jth presentation unit in the TS stream is PTS1
  • RTP(t) the PTS of the jth presentation unit in the TS stream
  • PTS(j) is converted to NPT (RTP(t)), PT(PTS(j)), when NPT (RTP(t) and NPT(PTS(j)) are equal, or in a certain interval
  • the set interval is used for the first display time and the second display time difference corresponding to the time information.
  • the set threshold value can be determined according to requirements, for example, the normal setting is 0.1 second, and the high precision synchronization is required. This can be set to 0.001 second, etc., and is set in the same manner in the following embodiments.
  • FIG. 6 is a schematic diagram of the basic principle of synchronization of multiple presentation units in a method for synchronizing RTP streams and TS streams, based on the principle described in FIG. 5, and so on, when multiple presentation units exist, as shown in FIG.
  • RTP timestamp of the presentation unit in the RTP stream RTP1, RTP2, ..., RTPn
  • TS1, TS2 TSn PTS time of the presentation unit in the plurality of TS streams
  • the PTS header indicates when the presentation unit should be played at the terminal.
  • the RTP time-stamp in the RTP header indicates the length of the sample time since the start of the on-demand, the sampling frequency of the reference media (the specified sampling frequency can be found from the format of the media), and the Range (play time period) and Range in the PLAY response. Corresponding timestamp value, so the PT time can be used to establish the correspondence between PTS and RTP timestam.
  • FIG. 7 is a schematic flowchart of a specific embodiment of a method for synchronizing an RTP stream and a TS stream. As shown in the figure, the implementation includes the following steps:
  • Step 701 The user views the program, such as: a picture-in-picture program, a dual-screen program, or the like;
  • Step 702 The user selects a broadcast section 3 A according to the program menu to view;
  • Step 703 The terminal goes to the channel where the program A selected by the user is located, and receives the TS stream of the program A.
  • the program A can be sent to the terminal through a protocol such as digital video broadcasting (DVB, Digital Video Broadcast);
  • Step 704 The terminal learns that the start decoder of the program extracts the PCR containing the time information from the header of the input TS stream, and sends the PCR to the system time clock recovery circuit to calibrate the system clock (SCR).
  • SCR system clock
  • Step 705 Obtain a correspondence between the PTS and the NPT.
  • Step 706 After receiving the new PTS, the basic stream decoder is stored in the corresponding FIFO for management. For the display unit without the PTS/DTS, the time label needs to be compared and sent. Managed in the FIFO. That is, obtain PTS(t) for each storage order;
  • Step 707 After obtaining the new PTS by step 706, calculate the normal play time NPT (RTP(t)) corresponding to the program start point corresponding to the PTS(t) according to the corresponding relationship in step 705. The stream processing ends, and the process proceeds to step 713 to wait for display;
  • Step 708 The user selects the broadband program B, and the broadband program B needs to be synchronized with the broadcast program A;
  • Step 709 The terminal and the server establish an RTSP connection.
  • Step 4 710, the terminal according to the media description of the media source, to know the frequency of the media f;
  • Step 711 The terminal user requests to play the program B, and the server responds by sending the RTSP message.
  • the terminal decoder can thereby know between the RTP timestamp and the normal play time (NPT). Correspondence relationship;
  • NPT(RTPG) ) (RTP timestampG) - RTP timestamp(k)) I f + NPT( RTP(k) ); Calculate the PT ( RTP(j) ) corresponding to RTP timestamp(j); where k is located at Before j moment.
  • step 712 the RTP packet sent by the server is received, and the RTP timestamp is obtained as an RTPG.
  • the corresponding NPT time is calculated as NPT (RTPG) according to the corresponding relationship in step 711.
  • the RTP stream processing ends, and the process proceeds to step 713. Waiting for display;
  • Step 713 Comparing the NPT (RTP(j)) converted according to the RTP timestamp and the NPT (PTS(t)) calculated according to the PTS, when they are equal, or according to some calculation rule, the difference is somewhere In the interval, both packages are displayed at the same time.
  • packet-by-packet synchronization achieves synchronization of the two streams.
  • step 705 for the TS stream, in a specific implementation, the correspondence between the PTS and the NPT can be obtained by the following methods.
  • CRC 32 32 rpchof The terminal is played in the program by adding the PTS time stamp (StartAU_PTS) identifier of the starting storage unit of the program in the Event Information Table (EIT) table in the Electronic Program Menu (EPG). During the period, the presentation timestamp PTS of the starting storage unit of the program is known; after the TS stream is decoded, each time a parsed PTS is obtained, the formula is introduced:
  • PT ( t ) ( PTS(t)-StartAU_PTS ) *n/f, f is the transport stream system clock frequency; n is 300 in the implementation, because in the MPEG 2 standard, the PTS (presentation time stamp) is specified
  • the code is 1/300 of the system clock frequency, and the system clock frequency value is in the interval [27 000 000 -810 , 27 000 000 + 810], in Hz.
  • the specific implementation of the present invention is illustrated by the specific implementation values of 300 in the calculations below.
  • the private field or the extended field in the adjustment field in the extended TS header indicates that the packet load corresponds to the PTS of the starting storage unit of the program, that is, the PTS of the program starting storage unit that needs to be recorded at the head end, the identifier
  • the character is sent once every some time.
  • NPT ( t ) ( PTS(t)-PTS ( 0 ) ) *n/f;
  • the play time NPT relative to the starting point of the program can be calculated.
  • the server records the correspondence between the PTS of the program and the relative time PT of the program, as shown in the following table:
  • the accuracy of the NPT is subject to the requirements of synchronization.
  • NPT (PTS(t)) (PTS(t) - PTS(i))*n/f+ NPT (PTS(i) );
  • NPT (PTS(t)) is the normal play time of the timestamp at time t
  • PTS(t) is the presentation timestamp of time t
  • PTS(i)) is the presentation timestamp of time i closest to time t
  • NPT (PTS(i)) is the normal play time for displaying the timestamp at time i closest to time t
  • fl is the clock frequency of the transport stream system.
  • the NPT time corresponding to the solved PTS can be calculated.
  • the terminal can know the correspondence between the PTS and the NPT based on the timestamp.
  • the present invention provides an embodiment.
  • the elements for realizing the synchronization of the TS stream and the RTP stream at the time of implementation of the present invention will be further described below.
  • Presentation time-stamp in the PES header of the TS stream, used to indicate a presentation unit, which is an audio access unit of the decoding or all of the decoded images in a frame.
  • presentation unit which is an audio access unit of the decoding or all of the decoded images in a frame.
  • the program reference clock in the TS header is PCR
  • the timestamp (RTP time-stamp) in the RTP header indicates the sampling instant of the first byte of the RTP packet. Even if there is no RTP packet transmission, timestamp still grows according to the sampling frequency.
  • the time stamps of multiple RTP data packets can be the same, indicating that the data sampled at the same time is divided into multiple RTP data frame transmissions;
  • RTCP Real-time Transport Control Protocol
  • NTP Network Time Protocol
  • RTCP A key function of RTCP is to enable the receiver to synchronize multiple RTP streams.
  • RTCP requires the sender to send a unique identification name (Canonical Name) to each data source, even though it is sent by a data source.
  • the different streams have different Synchronization Source Identities (SSRCs) but have the same canonical name so that the receiver knows which streams are associated.
  • SSRCs Synchronization Source Identities
  • the information contained in the sender report message can be used by the receiver to coordinate the timestamp values in the two streams.
  • the sender report contains an absolute time value expressed in NTP format, and then an RTP timestamp value is given in the RTCP report.
  • the clock that generates the value is the one that generates the TimeStamp field in the RTP packet.
  • FIG. 8 is a schematic diagram of a basic principle of implementing synchronization of a single presentation unit by using NTP in the method for synchronizing the RTP stream and the TS stream in the embodiment, as shown in the figure, assuming that the first presentation unit of the jth packet in the RTP packet KIT timestam is RTP(j), and the PTS of the tth memory location in the TS stream is PTS(t), then it will be converted to NTP (RTP(j), then converted to NPT (RTPG), and PTS(t) Converted to NPT (PTS(t)), when PT(RTP(j)) and PT(PTS(t)) are equal, or when they are set to a certain small interval as needed, they are simultaneously presented from the TS stream. And the two presentation units of the RTP stream, thereby achieving synchronization between the RTP stream and the TS stream.
  • FIG. 9 is a schematic diagram of a basic principle for implementing synchronization of multiple presentation units by using NTP in the method for synchronizing the RTP stream and the TS stream in the embodiment, according to the synchronization idea of a single presentation unit, when multiple presentation units exist, and so on, As shown in the figure, when the RTP timestamp of the presentation unit in the plurality of RTP streams and the PTS time of the plurality of TS stream presentation units are equal after the TP time, or when they are set in a certain small interval as needed, Simultaneously displayed, thereby achieving synchronization between multiple RTP streams and multiple TS streams.
  • FIG. 10 is a schematic flowchart of another embodiment of the method for synchronizing the RTP stream and the TS stream. As shown in the figure, the following steps are included in the synchronization: Step 1001: The user views the program. Such as: picture-in-picture programs, dual-screen programs, etc.;
  • Step 1002 The user selects a broadcast program A according to the program menu to view;
  • Step 1003 The terminal goes to the channel where the program A selected by the user is located, and receives the TS of the program A.
  • Program A can be delivered to the terminal through a protocol such as digital video broadcasting (DVB, Digital Video Broadcast) ⁇ /s/c;
  • DVD Digital Video Broadcast
  • Step 1004 The terminal learns that the start decoder of the program extracts the PCR containing time information from the header of the input TS stream and sends it to the system time clock recovery circuit to calibrate the system clock (SCR).
  • SCR system clock
  • Step 1005 Obtain a correspondence between the PTS and the NPT, and the corresponding obtaining method in this step is the same as the previous embodiment;
  • Step 1006 After receiving the new PTS, the elementary stream decoder is stored in the corresponding FIFO for management. For the display unit without the PTS/DTS, the time tag needs to be compared and sent to the FIFO for management. That is, obtain the PTS(t) of each storage unit;
  • Step 1007 After obtaining a new PTS by step 1006, calculate the normal play time PT (PTS(t)) corresponding to the program start point corresponding to the PTS(t) according to the corresponding relationship in step 1005.
  • PTS(t) normal play time
  • Step 1008 The user selects the broadband program B, and the broadband program B needs to be synchronized with the broadcast program A;
  • Step 1009 The terminal obtains its encoding format and multicast address according to its media description, and can obtain the sampling clock frequency thereof.
  • Step 1010 The terminal joins the multicast group through the Internet Group Management Protocol (IGMP), and receives the media stream (RTP/RTCP) of the multicast group.
  • IGMP Internet Group Management Protocol
  • RTP/RTCP media stream
  • Step 1011 The terminal receives the RTCP SR (Sender Report) packet, obtains a correspondence between the RTP timestam and the NTP timestamp in the packet header, and learns that the NTP time of the starting point is NTP(0); the latest NTP time can learn the current RTP.
  • the NTP time corresponding to timestam the specific formula is as follows:
  • NTPG (RTPG)-RTP(k))*n/f + NTP(k);
  • NTP(k) is the absolute playback time corresponding to RTP(k).
  • Step 1012 Receive an RTP packet sent by the server, and learn that the RTPtimestamp is the RTP (j), and the corresponding NPT time calculated according to the formula in the step 1011 is the NTP1 time.
  • Step 1013 according to the following formula:
  • NPT(RTPG)) NTPG)-NTP(O);
  • Step 1014 Compare the PT (RTPG) converted according to the RTP timestamp and the NPT (PTS (t)) calculated according to the PTS, when they are equal, or according to a certain calculation rule, when the difference is within a certain interval, Both packages are displayed at the same time.
  • packet-by-packet synchronization achieves synchronization of the two streams.
  • FIG. 11 is a schematic structural diagram of a synchronization system of an RTP stream and a TS stream, as shown in the figure, the system includes a corresponding module 1101, two corresponding modules 1102, and a display module 1103, wherein:
  • the first corresponding module is configured to establish a first correspondence between the TS stream PTS and the NPT;
  • the second corresponding module is configured to establish a second correspondence between the RTP flow time stamps NPT;
  • the display module is respectively connected to the first corresponding module and the second corresponding module. After the first corresponding module establishes a correspondence relationship between the storage units in the transport stream, and the second corresponding module establishes a correspondence relationship between the data packets in the RTP stream, the NPT is configured. The same TS stream storage unit is displayed simultaneously with the RTP stream packet.
  • the first corresponding module establishes a correspondence between the PTS and the PT, and is the same as the implementation manner of the foregoing RTP flow and TS flow synchronization method.
  • PT ( t ) is the normal play time at time t
  • PTS(t) is the presentation time stamp at time t
  • StartAU—PTS is the presentation time stamp of the start storage unit by adding the program in the EIT table, fl Is the transport stream system clock frequency
  • press NPT (t) (PTS(t)-PTS (0)) *n/fl to establish the first correspondence
  • PT (t) is the normal play time at time t
  • PTS(t) is time t Presentation timestamp
  • PTS (0) is the presentation timestamp of the program start storage unit
  • fl is the transmission stream system clock frequency
  • PT(PTS(t)) (PTS(t) - PTS(i))*n/fl + NPT (PTS(i))
  • the RPT time corresponding to the PTS is established, and the first correspondence is established.
  • NPT (PTS(t)) is the normal play time of the timestamp at time t
  • FTS(t) is the presentation timestamp of time t
  • PTS(i)) is the presentation timestamp of time i closest to time t
  • NPT (PTS(i)) is the normal play time of displaying the timestamp at the time i closest to time t
  • fl is the clock frequency of the transport stream system
  • the first correspondence is established by adding a normal play timestamp to the extended packet basic flow packet header, establishing a correspondence between the presentation time stamp and the normal play time.
  • the second corresponding module establishes a correspondence between the RTP and the PT, and is the same as the implementation manner of the foregoing RTP stream and TS stream synchronization method.
  • PT (RTP1) Is the normal play time of the real-time transport protocol packet j
  • RTP timestampG) is the real-time transport protocol packet timestamp at j time
  • RTP timestamp(k) is the
  • NTP(j) is the time of the network time protocol at time j
  • RTP(j) is the real-time transmission at time j.
  • 003176 Protocol packet timestamp RTP(k) is the real-time transport protocol packet timestamp at time k closest to j
  • NTP(k) is the time of network time protocol at time k
  • NTP(O) is the start time network time protocol Time
  • NPT (RTP (j) is the normal playback time of the real-time transport protocol packet j
  • £ is the sampling frequency of the media in the real-time transport protocol stream.
  • Figure 12 is a schematic diagram of PES header data.
  • the PES header in the TS stream is shown in the figure, where: 47 40 45 30 in data segment 1201 indicates:
  • Adjustment field control 0x3, adjusted
  • the adjustment field contains only PCR: 10
  • the last 6 bytes of PT/CN2007/003176 are PRC:
  • FA CF C2 80 CO in data segment 1204 indicates:
  • PES packet length is 0xCFC2
  • the first 5 bytes are PTS
  • NPT(PTS (t)) (PTS(t) - PTS(O)) xn/system_clock_frequency, calculate that the NPT time of the corresponding storage unit of the PTS is 15.2 seconds, then The first storage unit of the RTP packet has the same presentation time, and the two storage units are simultaneously displayed.
  • the synchronization between the TS stream and the RTP stream is taken as an example, and the correspondence between the TS stream PTS and the NPT and the correspondence between the RTP stream time-stamp and the NPT are used, and the same TS stream of the NPT is used.
  • the storage unit is displayed simultaneously with the presentation unit in the RTP stream, thereby completing synchronization between the two streams.
  • the foregoing describes an implementation manner of synchronizing the first media stream and the second media stream according to the first correspondence relationship and the second correspondence relationship in the terminal.
  • the implementation is not limited thereto.
  • the first correspondence relationship may also be
  • the second correspondence is sent to the terminal, and the terminal uses the relationship to perform media stream synchronization. After the corresponding relationship is sent to the terminal, the terminal uses the received correspondence to the media stream.
  • a specific embodiment of performing synchronization will be described.
  • the first embodiment describes that the first correspondence is placed in the first streaming media, and the second correspondence is placed in the control flow of the second streaming media. After receiving the two streaming media, the terminal uses the corresponding relationship. The media stream is synchronized.
  • the second embodiment describes that the first correspondence is placed in the second media stream, and the second correspondence is placed in the control stream of the second streaming media. After receiving the two streaming media, the terminal performs the corresponding relationship. The media stream is synchronized.
  • the third embodiment describes that the first correspondence is placed on the time mapping server, and the second correspondence is placed in the control flow of the second streaming media. After receiving the two streaming media, the terminal uses the corresponding relationship to perform media streaming. Synchronize.
  • the TS stream is taken as an example to describe how to carry the corresponding relationship.
  • the correspondence relationship is taken as an example of the correspondence between the PTS and the PT.
  • FIG. 13 is a schematic diagram of a system architecture of a first embodiment carrying a corresponding relationship.
  • a broadcast monthly service provider places a correspondence between a PTS and a PT of a program in a TS stream and sends the information to the terminal, and the broadband The service provider sends the corresponding relationship between the RTP Timestam and the NPT in the RTSP stream to the terminal, and the terminal performs streaming media synchronization according to the two corresponding relationships.
  • FIG. 14 is a schematic diagram of an implementation process of a broadcast program stream carrying a corresponding relationship. As shown in the figure, carrying the corresponding relationship may include the following steps: Step 1401: The broadcast service provider determines to save the broadcast program. Taking the correspondence between the unit PTS and the NPT;
  • Step 1402 and placing the correspondence between the PTS and the PT of the broadcast program A in the TS stream;
  • Step 1403 The broadcast service provider sends the broadcast program A and the TS stream where the time correspondence is located to the terminal.
  • Step 1404 When the terminal receives the broadcast program A streaming media, the broadcast program A can be obtained.
  • Step 1405 The terminal calculates the PTS value of each access unit in the program A according to the FTS of the PES packet in the broadcast program A.
  • Step 1406 According to the correspondence, the NPT corresponding to each access unit may be calculated and obtained;
  • NPT (i) NPT (ik) + PTS(i + k)-PTS(ik) ; or,
  • NPT(i) PT(ik) + ( 7 ⁇ )- - V/ 1 , fl is 1/300 of the system clock frequency.
  • Step 1407 the terminal requests to watch the broadband program B by using the RTSP protocol;
  • Step 1408 the RTSP server responds, and sends the RTP Timestamp of the RTP packet of the broadband program B and the corresponding PT and the like to the terminal;
  • Step 1409 the terminal learns the RTP Timestam of the RTP packet of the broadband program B and the corresponding PT;
  • Step 1410 Obtain an NPT of any access unit by calculation
  • NPT (j) PT (j-k) + (RTP (j) -RTP (j-k) /f2, f2 is the sampling frequency of the RTP flow load.
  • Step 1411 The terminal performs corresponding processing in the corresponding application scenario, such as: fast forward, fast reverse, synchronization, program switching, and the like.
  • step 1411 The various operations in step 1411 can be specifically implemented as follows:
  • the terminal compares the NPT value corresponding to the PTS of the broadcast program A access unit with the PT value corresponding to the RTP Timestam of the broadband program B access unit of the broadband, and performs synchronous presentation;
  • step 1406 If fast forwarding is required, then only the time point of the fast forward and rewind operation is added between step 1406 and step 1407, and then the terminal records the PTS value of the broadcast program A operation point and the corresponding PT (eg : PT(x)); Change step 1407 to: request to deliver the rewind and pause from the fast forward
  • the NPT ( X ) of the PT/CN200 bacteria 176 operation point starts to fast forward and rewind, and the pause point starts to play the program; the step Mil is changed to: at the operation time point, the original broadcast program is switched to the broadband program;
  • the NPT (x+1) corresponding to the broadcast program and the subsequent access unit may play the NPT (x+1) corresponding to the broadband program and the subsequent access unit.
  • step 1406 the terminal knows that the switching time point is NPT (X) or the switched PTS time point, and the corresponding NPT (X) can be obtained by calculation;
  • Step 1407 The change is: Considering the network delay, the terminal starts to request to play the wideband program B from the NPT (x) point at some point before the switching point; the step 1411 is changed to: the RTP stream received by the NPT (x) point is sent The access unit can be played in place of the access unit corresponding to the program NPT ( x ) delivered by the broadcast channel.
  • FIG. 15 is a schematic diagram of a system architecture of the first embodiment carrying a corresponding relationship.
  • the broadcast service provider places the correspondence between the PTS and the NTP of the program in the TS stream and delivers the information to the terminal, and the broadband service provides The quotient carries the corresponding relationship between the RTP Timestamp and the PT in the RTCP stream and sends it to the terminal.
  • the terminal then synchronizes the data according to the two corresponding relationships.
  • the difference is mainly as follows: (1)
  • the corresponding relationship contained in the TS stream delivered by the broadcast provider is the correspondence between the PTS and the NTP; (2)
  • the RTSP becomes RTCP.
  • FIG. 16 is a schematic diagram of the implementation process of the broadcast program stream carrying the corresponding relationship. As shown in the figure, carrying the corresponding relationship may include the following steps: Step 1602: The broadcast monthly service provider determines the broadcast. Correspondence between the program A access unit FTS and the PT;
  • Step 1602 The broadband service provider informs the broadcast service provider of the NPT of the broadband program B and
  • Step 1604 The broadcast service provider places the correspondence between the PTS and the NTP of the broadcast program in the TS stream.
  • Step 1605 The broadcast service provider sends the broadcast program A and the TS stream where the corresponding relationship is located to the terminal;
  • Step 1606 When the terminal receives the broadcast program A media stream, the PTS value of the PES packet of the broadcast program A and the correspondence between the PTS and the NTP are obtained.
  • Step 1607 The terminal calculates the PTS value of each access unit of the program A according to the PTS of the PES packet of the broadcast program A.
  • Step 1608 Calculate, according to the correspondence relationship, an NTP corresponding to each access unit.
  • NTP (i) NTP (ik) + PTS(i + k)-PTS(ik) ; or,
  • NTP (i) NTP (i-k) + ⁇ )-TM(")) / /2.
  • Step 1609 The broadband program B is sent to the multicast group by using RTP protocol encapsulation
  • Step 1610 The RTCP packet related to the broadband program B is sent to the multicast group, and includes the RTCP SR packet.
  • Step 1611 The terminal joins the multicast group to receive the broadband program B and the RTCP packet.
  • Step 1612 The terminal learns the RTPTimestamp of the RTP packet of the broadband program B, and the correspondence between the RTP Timestamp and the NTP Timestamp in the RTCP SR packet.
  • Step 1613 The terminal calculates an NTP of any access unit according to the correspondence relationship of step 1612. Specifically, the terminal may calculate according to the following formula: T N2007/003176
  • NTP (j ) NTP (j-k ) + ( RTP (j ) - RTP (j-k) ) /fl.
  • Step 1614 The terminal performs corresponding processing in the corresponding application scenario, such as: fast forward rewind, synchronization, program switching, and the like.
  • step 1614 can be specifically implemented as follows:
  • the terminal compares the NTP value corresponding to the PTS of the broadcast program A access unit with the NTP value corresponding to the RTP Timestamp of the broadband program B access unit from the broadband, and the same is displayed synchronously;
  • the access unit of the RTP stream When the access unit of the RTP stream is received, and the RTP Timestamp (x) and the corresponding NTP (x) and subsequent access units are known, the PTS corresponding to the NTP (X) in the broadcast program A delivered by the broadcast channel is replaced. x) The indicated access unit and subsequent access units can be played.
  • FIG. 17 is a schematic diagram of the system architecture of the first embodiment carrying the corresponding relationship.
  • the broadcast service provider places the correspondence between the PTS and the NTP of the program in the TS stream and delivers the information to the terminal, and the broadband service provides The quotient is sent to the terminal in the RTCP flow carrying the corresponding relationship between the RTP Timestamp and the NTP, and the terminal performs streaming media synchronization according to the two corresponding relationships.
  • Both architecture 3 and architecture 2 describe the architecture in which the TS stream carries the PTS and NTP time correspondence and the RTCP stream carries the RTP Timestamp and NTP correspondence.
  • the architecture 3 differs in that the broadcast service provider provides the program to the broadband service provider. The NTP time is played or the correspondence between the program NTP and NPT is provided.
  • the broadcast service provider can obtain the time correspondence between the PTS and the NTP and the correspondence between the NPT and the NTP by using the NTP clock and the STC clock sampling on the server.
  • the broadcast service provider needs to inform the broadband program to start broadcasting the broadband program B at the NTP (0) point, or the correspondence between the NTP and the NPT, and the broadband service provider can determine whether the NTP time value of the access unit of the NPT point and the broadcast are broadcast.
  • the broadcast program A provided by the service provider A has the same NTP value of the access unit corresponding to the NPT point, and is equal, otherwise it needs to be corrected.
  • steps 1602 to 1603 in the implementation process of the architecture 2 are changed to the following steps: ⁇ , the broadcast service provider simultaneously samples the STC and the chirp clock to obtain the corresponding PTS (i) and NTP (i); Correspondence between PTS and NTP;
  • NTP ( t ) NTP ( 0 ) + NPT
  • the broadcast service provider sends the correspondence between NTP ( 0 ) or PT and NTP to the broadband service provider;
  • the broadband service provider sets the NTP value corresponding to the broadband program access unit according to the correspondence between the NPT and the NTP provided by the broadcast service provider;
  • the specific implementation may be: When the program is packaged, the correspondence between the NTP and the NPT of the broadband program and the correspondence between the NTP time of the broadcast program and the NPT are the same, that is, the start time of the NTP clock is set to be the same, and the frequency is set to be the same.
  • FIG. 18 is a schematic diagram of a system architecture of a first embodiment carrying a corresponding relationship.
  • a broadband service provider sends a mapping relationship between an RTP Timestamp and a PT of an RTP stream to a broadcast service provider, and a broadcast service provider.
  • the correspondence between the PTS and the RTP Timestamp is obtained, and the time pair in the corresponding relationship is placed in the TS stream and sent to the terminal.
  • the terminal utilizes the PTS value of the broadcast program, the correspondence between the PTS and the RTP Timestam, and the RTP Timestamp of the broadband program, and performs synchronization, switching, and fast rewinding according to the corresponding needs.
  • FIG. 19 is a schematic diagram of an implementation process of the broadcast program stream carrying the corresponding relationship. As shown in the figure, carrying the corresponding relationship may include the following steps: Step 1901: The broadcast service provider determines the broadcast program A. Correspondence between the access unit PTS and the NPT;
  • Step 1902 The broadband service provider sends the correspondence between the RTP Timestam and the NPT of the broadband program B to the broadcast service provider;
  • Step 1903 The broadcast service provider uses the NPT as an intermediate point to find the RTP corresponding to the PTS. Timestamp; If it is RTP Timestam of multiple RTP streams, it needs to be identified to distinguish the RTP Timestamp of the audio and video stream and the PTS;
  • Step 1904 and placing the correspondence between the PTS and the RTP Timestamp of the broadcast program in the TS stream;
  • Step 1905 The broadcast service provider sends the broadcast program A and the TS stream where the time correspondence is located to the terminal.
  • Step 1906 When the terminal receives the broadcast program A streaming media, the PTS value of the PES packet of the broadcast program A and the correspondence between the PTS value and the RTP Timestamp are obtained.
  • Step 1907 The terminal calculates the PTS value of each access unit in the program A according to the PTS of the PES packet of the broadcast program A.
  • Step 1908 Calculate and obtain an RTP Timestamp corresponding to each access unit according to the corresponding relationship. Specifically, the method may be calculated according to the following formula:
  • RTP (i) RTP (ik) + PTS (i + k) - PTS (ik)
  • fl is the sampling frequency corresponding to the load type of the wideband program B
  • f2 is one-third of the clock frequency of the STC.
  • Step 1909 The terminal requests to watch or join the multicast group to receive the broadband program B by using the RTSP protocol, and the broadband program B is sent to the terminal;
  • Step 1910 The terminal learns an RTP Timestamp of the RTP packet of the broadband program B.
  • Step 1911 The terminal performs corresponding processing in the corresponding application scenario, such as: fast forward rewind, synchronization, program switching, and the like.
  • step 1911 can be specifically implemented as follows: 007003176
  • the terminal compares the RTP Timestamp value corresponding to the PTS of the broadcast program A access unit with the RTP Timestamp value of the broadband node 3 ⁇ 4 B access unit from the broadband.
  • step 1908 Adding between step 1908 and step 1909: At the time point of the fast forward and rewind operation, the terminal records the PTS value of the broadcast program operating point and the corresponding RTP Timestamp (eg, RTP (x)); the RTP sent according to the RTSP protocol. Correspondence between Timestamp and NPT, the operating point is PT ( X );
  • step 1909 a time margin is left, and the terminal uses the RTSP protocol to request to issue a request to fast forward and rewind the program broadband program B from the NPT (X) of the operating point;
  • step 1911 at the operation time point, the original broadcast program A is switched to the broadband program B; that is, the access unit corresponding to the PT (x) of the broadcast program is not played, and the PT (x) corresponding to the wide-band program is played. Take the unit, the playback rate is determined by the sent RTSP request.
  • step 1908 the terminal knows the PTS value of the broadcast program switching point and the corresponding RTP Timestamp (eg, RTP (x));
  • the terminal starts to join the multicast group to receive the R P stream;
  • the access unit that receives the NPT (X), that is, the subsequent RTP stream may be played in the subsequent access unit corresponding to the program PT (X) delivered by the broadcast channel.
  • Step 1402, Step 1604, Step 1904 The correspondence between the PTS of the broadcast program and the RTP Timestamp is placed in the TS stream, and may be implemented in the following manner;
  • the location carrying the time correspondence can be carried in the PES header (closely coupled to the media) or SI information.
  • N2007/003176 Figure 20 is a schematic diagram of the structure of the PES packet. As shown in the figure, the correspondence between the PTS and the NTP Timestamp/NPT can be placed on the PES without changing the PES packetization protocol and considering the roles of the fields in the packet.
  • PES Dedicated Data "Header Field” or "PES Extension Field Data” in the "PES Extension” inside the "Optional Field” of the header, there are:
  • the optional field after the 5 flag bits is the data of the correspondence between the PTS and the NTP Timestamp/NPT;
  • the correspondence information can be implemented only by the NTP Timestamp, NPT or RTP Timestamp corresponding to the PTS, such as:
  • the PTS packet containing the PTS and the Reference_Time_descriptor obtains the PTS timestamp of the packet, and the NTP Timestamp and/or NPT and/or RTP Timestamp corresponding to the PTS timestamp.
  • the newly created Time_ Mapping_descriptor(); in the descriptor of the EIT table loop The specific location is: The newly created descriptor describing the time correspondence in the loop loop of the EIT table.
  • the data placed can be:
  • mapping— type 00 If ( mapping— type 00 ) ⁇
  • the descriptor can describe the mapping between the PTS and the NTP, the mapping between the PTS and the NPT Timestamp, or the mapping between the PTS and the RTP Timestamp.
  • an embodiment may add a type identifier of the mapped timestamp in the descriptor to distinguish the type of the mapping. 3. Add a time mapping relationship table ETMT to carry.
  • a new time correspondence table may be created to describe the correspondence between the program timestamps of the services carried in the current TS stream.
  • the format of the new table can be implemented as shown in the following table:
  • the table can be obtained by a specified PID, or obtained by obtaining the PID through the PMT table. It is more efficient to transfer the table only to the media stream in which the running program is located during implementation.
  • the frequency of the table is close to the transmission frequency of the RTCP SR packet, and the frequency is not required to be too high.
  • the RTCP packet carrying the corresponding relationship of the RTP flow is taken as an example for description.
  • 21 is a schematic diagram of a system architecture of a second embodiment carrying a corresponding relationship, as shown in the figure, broadcasting N2007/003176
  • the service provider sends the time correspondence between the PTS and the NPT of the broadcast program A to the broadband service provider, and the broadband service provider compares the relationship between the RTP Timestamp and the NPT of the broadband program B, and the PTS can be known.
  • Correspondence between the RTP and the RTP, and the corresponding relationship is placed in the RTP stream/RTCP packet and sent to the terminal.
  • the terminal utilizes the correspondence between the PTS of the broadcast program, the PTS of the RTP Timestamp ⁇ RTP/RTCP packet of the wideband program, and the RTP Timestamp of the wide-range program, so as to perform processing such as switching, synchronization, fast forward and rewind between the program streams.
  • FIG. 22 is a schematic diagram of an implementation process of the RTP flow/RTCP packet carrying relationship. As shown in the figure, carrying the corresponding relationship may include the following steps:
  • Step 2201 The broadcast service provider determines a correspondence between a PTS and an NPT of the broadcast program A access unit;
  • Step 2202 The broadcast service provider sends the broadcast program A to the terminal;
  • Step 2203 When the terminal receives the broadcast program A media stream, the broadcast program A can be obtained.
  • Step 2204 The terminal has obtained the PTS of the PES packet of the broadcast program A, and the interpolated value calculation obtains the PTS value of each access unit of the program A;
  • Step 2205 The broadcast service provider sends the correspondence between the broadcast program PTS and the 1S1PT to the broadband service provider.
  • Step 220'6 the broadband service provider knows the correspondence between the RTP Timestamp and the NPT of the broadband program B;
  • Step 2207 According to step 2205 and step 2206, establish a correspondence between RTP Timestam and RTP Timestamp by using NPT as an intermediate bridge.
  • the RTP Timestamp and PTS values corresponding to the same NPT value are the corresponding RTP Timestamp and PTS values; for example: PT (X) can be obtained according to the correspondence between RTP Timestamp (x), RTP and PT; according to NPT (X ), the correspondence between the NPT and the PTS, the PTS (x) is obtained; Step 2208, the broadband service provider places the correspondence between the PTS and the RTP Timestamp into the RTP stream; Step 2209, the broadband program B is sent to the terminal;
  • Step 2210 After receiving the RTP stream, the terminal may obtain the RTP Timestamp and the corresponding PTS value of each RTP packet of the program.
  • Step 2211 Interpolate and calculate an RTP Timestamp and a corresponding PTS value of each access unit.
  • Step 2212 The terminal performs corresponding processing in a corresponding application scenario, such as: fast forward rewind, synchronization, and program switching.
  • step 2212 can be specifically implemented as follows:
  • the terminal compares the PTS value corresponding to the RTP Timestam of the obtained broadband program access unit with the PTS value of each access unit of the broadcast program, and the same is synchronously displayed;
  • step 2208 and step 2209 the following processing is added:
  • the terminal knows that the switching time of the program is PTS (X);
  • the terminal joins the multicast group to receive the broadband program B at some time before the PTS (X);
  • step 2212 when the terminal receives the PTS value corresponding to the access unit in the multicast group as PTS (X), the access unit indicated by the PTS (X) of the broadcast program is displayed.
  • the foregoing step is a case where the RTP packet carries the correspondence between the RTP Timestamp and the PTS value.
  • the step 2208 is changed to: the corresponding relationship is placed in the RTCP packet, where After the step 2209 is added: the RTCP packet carries the corresponding relationship between the RTP Timestamp and the PTS and is sent to the terminal.
  • FIG. 23 is a schematic diagram of the implementation flow of the RTP flow/RTCP packet carrying the correspondence relationship.
  • RTCP carries the correspondence between the PTS and the NPT
  • the RTSP carries the correspondence between the RTP Timestam and the NPT
  • carrying the correspondence may include the following steps:
  • Step 2301 The broadcast service provider determines a correspondence between the PTS and the PT of the broadcast program A access unit;
  • Step 2302 The broadcast service provider sends the broadcast program A to the terminal;
  • Step 2303 When the terminal receives the broadcast program A media stream, the PTS value of the PES packet of the broadcast program A can be obtained.
  • Step 2304 The terminal calculates the PTS value of each access unit of the program A according to the PTS of the PES packet of the broadcast program A.
  • Step 2305 The broadcast service provider sends the correspondence between the broadcast program PTS and the NPT to the broadband service provider.
  • Step 2306 The broadband service provider places the time correspondence between the PTS and the NPT into the RTCP packet.
  • Step 2307 the broadband program B is sent to the terminal
  • Step 2308 The RTSP controls the RTP flow, and carries the correspondence relationship between the RTP Timestamp and the NPT and the load type.
  • Step 2309 The RTCP includes a correspondence between the broadcast program PTS and the NPT.
  • the time correspondence between the RTP Timestamp and the corresponding PT value of each RTP packet of the program can be known;
  • NPT PT (i-k) + (RTP (i) -RTP (i-k)) If,
  • Step 2311 The terminal can obtain the NPT corresponding to each access unit of the program according to the correspondence between the PTS, the PTS, and the PT of the broadcast program access unit obtained in the step 2304 and the step 2309. Specifically, the terminal can calculate according to the following formula:
  • NPT (j) NPT (jk) + PTS (j + k) - PTS ⁇ jk); Step 2312, the terminal performs corresponding processing in the corresponding application scenario, such as: fast forward and rewind, synchronization, program switching, etc. deal with.
  • step 2312 can be specifically implemented as follows:
  • the terminal according to the NPT value corresponding to the RTP Timestamp of the broadband program B access unit, andtude
  • PC-T/CN2007 touches 176 broadcast program A.
  • the NPT values corresponding to the PTS of each access unit are compared, and the same is displayed synchronously.
  • step 2306 the following processing is added:
  • the terminal knows that the switching time of the program is PTS (X);
  • the terminal joins the multicast group to receive the broadband program B at some time before the PTS (X);
  • step 2312 PTS(x) corresponds to NPT(x); when the terminal receives the PT value corresponding to the access unit in the multicast group as PT(X), the PTS of the broadcast program is replaced ( X) The identified access unit is displayed.
  • Figure 24 is a schematic diagram of the implementation flow of the RTP flow carrying the corresponding relationship of the RTCP packet, when the RTCP carries the time correspondence between the PTS and the NTP; when the RTCP SR carries the time correspondence between the RTP Timestam and the NIP, as shown in the figure, Carrying the correspondence may include the following steps:
  • Step 2401 The broadcast service provider determines a correspondence between a PTS and a PT of the broadcast program A access unit;
  • Step 2402 The broadcast monthly service provider sends the broadcast program A to the terminal;
  • Step 2403 When the terminal receives the broadcast stream A, the PTS value of the PES packet of the broadcast program A is obtained.
  • Step 2404 The terminal calculates the PTS value of each access unit of the program A according to the PTS of the PES packet of the broadcast program A.
  • Step 2405 The broadcast service provider sends the correspondence between the broadcast program PTS and the NTP to the broadband service provider.
  • Step 2406 determining a correspondence between the broadband program RTP Timestam and the NPT, and a correspondence between the RTP Timestamp and the NTP; the former can learn the RTP (0) through the RTP Timestamp of the RTP packet where the file start point is located, and the RTP packet first.
  • the RTP Timestamp of the access unit and the location of the access unit relative to the program starting point can be obtained according to the server-side storage file, and the PT value can be obtained, and the latter can be sampled according to the RTP Timestam clock and the NTP Timestam clock, that is,
  • Step 2407 According to steps 2405 and 2406, the correspondence between the PTS and the PT of the broadcast program and the correspondence between the NTP and the NPT are known, and the NTP (0) corresponding to the PTS (0) of the program, and the PTS and The correspondence between NTP.
  • Step 2408 Place a correspondence between the PTS and the NTP in the RTCP packet.
  • Step 2409 The broadband program is delivered to the terminal.
  • Step 2410 The RTCP controls the RTP flow, and carries the correspondence between the RTP Timestamp and the NTP and the correspondence between the PTS and the NTP of the broadcast program.
  • Step 2411 the terminal receives the RTP stream, according to step 2409, in step 2410 the program access time is obtained between the units RTP Timestamp, f, RTP Timestamp NTP and a correspondence relationship, the program may be informed of each RTP packet and the RTP Timestamp Corresponding NTP value;
  • NTP (i) NTP (i-k) + (RTP (i) -RTP (i-k)) /f;
  • Step 2412 The terminal can obtain the NPT corresponding to each access unit of the program according to the correspondence between the PTS, the PTS, and the NTP of the broadcast program access unit obtained in the step 2404 and the step 2410. Specifically, the terminal can calculate according to the following formula:
  • NTP (j) NTP (jk) + PTS U + k) - PTS (jk) .
  • Step 2413 The terminal performs corresponding processing in the corresponding application scenario, such as: fast forward and rewind, synchronization, and program switching.
  • step 2413 The various operations in step 2413 can be specifically implemented as follows:
  • the terminal compares the NTP value corresponding to the RTP Timestamp of the broadband program access unit with the NTP value corresponding to the PTS of each access unit of the broadcast program, and the same is synchronously displayed.
  • step 2406 and step 2407 add the following processing:
  • the terminal knows that the switching time of the program is PTS (X); 003176
  • the terminal joins the multicast group to connect to the broadband program B at some time before the PTS (x);
  • step 2413 PTS (x) corresponds to NTP (x); when the terminal receives the NTP value corresponding to the access unit in the multicast group as NTP (X), it replaces the PTS of the broadcast program ( X) The identified access unit is presented.
  • FIG. 25 is a schematic diagram of a system architecture of a second embodiment carrying a corresponding relationship.
  • an STC clock and an NTP Timestamp clock are required on a server of a broadcast service provider, and PTS and NTP can be obtained by simultaneously sampling the two clocks.
  • NPT 0, the corresponding PTS (0) and the corresponding NTP (0) can be known.
  • the correspondence between NTP ( 0 ) and PTS and NTP is sent to the broadband service provider, and the broadband service provider places the correspondence into the RTCP packet and transmits it to the terminal.
  • the terminal can convert the PTS into an NTP Timestamp according to the PTS in the TS, the RTP Timestamp in the RTP, and the correspondence between the RTP Timestamp and the NTP Timestamp in the RTCP SR, and the correspondence between the PTS and the NTP Timestamp in the RTCP packet.
  • RTP Timestam value is converted to NTP Timestamp and processed.
  • FIG. 26 is a schematic diagram of the implementation process of the RTP flow/RTCP packet carrying relationship. As shown in the figure, carrying the corresponding relationship may include the following steps:
  • Step 2601 The broadcast service provider determines a starting PTS of the broadcast program A, and a time correspondence between the PTS and the NPT.
  • Step 2602 The broadcast service provider compares the STC and the NTP clock to obtain a correspondence between the PTS and the NTP.
  • Step 2603 according to step 2602, find NTP (0) corresponding to PTS (0);
  • PTS (t) -PTS (0) (NTP (t) -NTP (0)) * (PTS (t) -PTS (tx)) / (NTP (t) -NTP (tx)), and two pairs PTS (t) and corresponding PTS (t) and PTS ( tx ) and the corresponding NTP ( tx ) can calculate the NTP ( 0 ) corresponding to PTS ( 0 );
  • Step 2604 The broadcast service provider sends the broadcast program A to the terminal.
  • Step 2605 When the terminal receives the broadcast program A media stream, the PTS value of the PES packet of the broadcast program A can be obtained.
  • Step 2606 The terminal obtains, according to the PTS of the PES packet of the broadcast program A, the FTS value of each access unit of the program A by interpolation calculation;
  • Step 2607 sending a start TP (0) of the broadcast program A and a correspondence between the PTS and the NTP to the broadband service provider;
  • Step 2608 the broadband service provider determines that the initial play time of the broadband program B needs to be NTP (0);
  • Step 2609 The broadband service provider places the time correspondence between the PTS and the NTP in the RTCP packet.
  • Step 2610 Send the broadband program B to the multicast group.
  • Step 2611 The RTCP controls the RTP flow, and carries the correspondence between the RTP Timestamp and the NTP and the correspondence between the PTS and the NTP of the broadcast program.
  • Step 2612 The terminal joins the multicast group to receive the RTP stream and the RTCP packet.
  • Step 2613 After receiving the RTP stream and the corresponding RTCP packet, the terminal may obtain the RTP packets of the program according to the time correspondence between the RTP Timestamp, f, the RTP Timestamp, and the NTP of the program access unit obtained in step 2610 and step 2611.
  • RTP Timestam and the corresponding NTP value the specific calculation formula can be:
  • NTP (i) NTP (i-k) + (RTP (i) -RTP (i-k)) /f;
  • Step 2614 The terminal obtains the NTP corresponding to each access unit of the program according to the correspondence between the PTS, the PTS, and the NTP of the broadcast program access unit obtained in the step 2606 and the step 2612.
  • the specific calculation formula may be:
  • NTP (j) NTP (j-k) + PTS(j + k)-PTSO-k) .
  • NTP ( j ) NTP ( jk ) + ( PTSU ) - PTS(j - k) ) /f , where f is one-300th of the frequency of the STC clock.
  • Step 2615 The terminal performs corresponding processing in the corresponding application scenario, such as: synchronization, program switching processing.
  • step 2615 can be specifically implemented as follows:
  • the terminal compares the NTP value corresponding to the RTP Timestamp of the broadband program access unit with the NTP value corresponding to the PTS of each access unit of the broadcast program, and the same is synchronously displayed.
  • step 2609 and step 2610 the following processing is added:
  • the terminal knows that the switching time of the program is PTS (X);
  • the terminal joins the multicast group to receive the broadband program B at some time before the PTS (X);
  • step 2615 PTS (x) corresponds to NTP (x); when the terminal receives the NTP value corresponding to the access unit in the multicast group as NTP (X), the PTS (X) of the broadcast program is replaced.
  • the identified access unit is presented.
  • step 2208 placing the time correspondence between the PTS and the NTP in the RTCP packet, which can be implemented in the following manner;
  • Figure 27 is a schematic diagram of the RTP packet header structure. As shown in the figure, the corresponding relationship/program start time point can be placed in the extension header of the RTP header.
  • the CS extension list after the RTP header is the Head Extension field, where "defined by profile" is a specific 16 position, indicating that the subsequent header extension field carries the PTS value or the initial PTS of the program. information.
  • Figure 28 is a schematic diagram of the structure of the RTP packet, the information placed as shown in the figure, original network id, Transport id service id, event id is a unique identifier that identifies the event, indicating that the PTS value of the broadcast event corresponds to the RTP Timestamp, or PTS (0) of the RTP packet;
  • Figure 29 is a schematic diagram of the RTCP SR packet structure. As shown in the figure, the profile-specific extensions section in the RTCP SR packet is extended to describe the initial PTS ( 0 ) of the broadcast program or the PTS time of the broadcast program corresponding to the SR packet NTP Timestam. stamp. Wherein, the 16-bit type is used to describe the subsequent fields used to describe the time correspondence;
  • the original network id, the transport id, the service id, and the event id are identifiers of the unique identifier event, indicating that the PTS value of the broadcast event corresponds to the RTP Timestamp of the RTP packet, or the PTS (0) of the broadcast program;
  • the S bit position identifier carries the starting PTS time of the program, or the PTS value corresponding to the RTP Timestam and NTP Timestam timestamp carried by the RTCP SR packet;
  • the last 33-bit PTS timestamp is PTS ( 0 ) or the PTS value corresponding to the RTP Timestamp and NTP Timestamp timestamps.
  • Figure 30 is a schematic diagram of the structure of the RTCP SDES packet.
  • the time correspondence information can be placed in the value string of the PRDES SDES items of the SDES.
  • the type in the SDES items is 8, and the prefix string is time mapping info.
  • the original network id, the transport id, the service id, and the event id are identifiers of the unique identifier event, indicating the correspondence between the broadcast event PTS ( 0 ) or the PTS and the RTP Timestamp associated with the broadcast program;
  • the last 33 bits of the PTS timestamp are PTS (0) or all of the last data describing a one-to-one correspondence between PTS (33 bits) and RTP Timestamp (32 bits) / NTP Timestamp (64 bits).
  • Figure 31 shows the structure of the APP: Application-Defined RTCP Packet header. As shown in the figure, the correspondence is placed in the application-dependent data section, and the name (ASCII) is the Time Mappint Info recognized by the standard organization.
  • Figure 32 is a schematic diagram of the structure of the APP: Application-Defined RTCP Packet. The information of the placed information is shown in the figure.
  • the original network id, transport id, service id, and event id are unique identifiers of the event, indicating the broadcast event PTS. (0) or the correspondence between the PTS and the RTP Timestamp associated with the broadcast program, the item is optional.
  • the last 33 bits of the PTS timestamp are PTS (0) or all of the last data describing a one-to-one correspondence between PTS (33 bits) and RTP Timestamp (32 bits) / NTP Timestamp (64 bits).
  • This embodiment is described by taking a time mapping server bearer correspondence as an example.
  • the purpose of this embodiment is to illustrate that the generation and delivery of correspondences is not limited to being done by existing entities, but it can also be done by proprietary, new entities.
  • FIG. 33 is a schematic diagram of a system architecture of a third embodiment using a mapping server to carry a corresponding relationship, such as As shown in the figure, the architecture includes broadcast service providers, broadband service providers, time map servers, and terminals. The following entities are described as follows:
  • a broadcast service provider for informing a time mapping server of a time correspondence of a broadcast program; encapsulating a broadcast program with a TS protocol, and transmitting the program to the terminal through DVB S/T/C;
  • the absolute start time of the broadcast program can also be negotiated with the broadband service provider as needed;
  • Broadband service provider used to encapsulate A/V with RTP protocol and send broadband programs to the terminal;
  • RTSP or RTCP to control the transmission of RTP streams, and carry the correspondence between RTP Timestamp and NTP/NPT to the terminal;
  • the time mapping server may also be informed of the time correspondence of the broadband program as needed, and the broadband service provider negotiates the absolute starting time point of the broadcast program;
  • a time mapping server a time correspondence for receiving a broadcast service provider broadcast program
  • Terminal used to receive broadcast programs and receive broadband programs
  • the corresponding processing is performed.
  • FIG. 34 is a schematic diagram of an implementation process of using a mapping server to carry a corresponding relationship.
  • a time correspondence is a PTS and an NTP time correspondence relationship
  • a broadcast service provider and a broadband service provider start from a program start time.
  • Negotiation begins, and the RTP stream is controlled using RTCP. You can do this as follows:
  • Step 3401 The broadcast service provider determines a starting time point PTS (0) of the program
  • Step 3402 The broadcast service provider compares the STC and the NTP clock to obtain a time correspondence between the PTS and the NTP.
  • PTS (t) -PTS (0) ( TP ( t ) - NTP ( 0 ) ) * ( PTS ( t ) -PTS (tx)) I (NTP (t) -NTP (tx)), and
  • NTP (0) corresponding to PTS (0) can be calculated;
  • Step 3404 The broadcast service provider informs the broadband service provider that the starting time of the broadcast program A is NTP (0);
  • Step 3405 The broadband service provider sets the NTP of the start frame of the broadband program B as NTP(0);
  • Step 3406 The broadcast service provider sends the time correspondence (PTS and NTP) of the broadcast program to the time mapping server;
  • Step 3407 The time mapping server saves a time mapping relationship of the broadcast program.
  • Step 3408 After the broadcast service provider TS protocol encapsulates the broadcast program A, it is sent to the terminal by using the DVB S/C/T protocol;
  • Step 3409 The terminal learns the PTS value of the PES packet of the broadcast program.
  • Step 3410 the terminal interpolation calculation obtains the FTS of each access unit
  • Step 3411 The terminal requests the time server to send a time correspondence of the broadcast program A (synchronous application scenario), or a time correspondence of a certain point (program switching application scenario);
  • Step 3412 The time mapping server correspondingly requests, and sends a time correspondence relationship of the broadcast program A (synchronous application scenario), or a time corresponding to a certain point (program switching application scenario);
  • Step 3413 Calculate an NTP timestamp corresponding to each access unit PTS of the broadcast program A.
  • Step 3414 The broadband service provider encapsulates the broadband program B by using the RTP protocol on the server side, and sends the multicast program B to the multicast group by using RTP over UDP/TCP over IP. ;
  • Step 3415 The RTCP packet related to the broadband program B is sent to the multicast group.
  • Step .3416 The terminal joins the multicast group to receive the broadband program B and the RTCP control packet.
  • Step 3417 The terminal calculates the NTP value of each access unit according to the correspondence between the RTPTimestamp of each access unit in step 3415 and the RTPTimestamp and NTP known in step 3416.
  • Equation ⁇ The terminal calculates the NTP value of each access unit according to the correspondence between the RTPTimestamp of each access unit in step 3415 and the RTPTimestamp and NTP known in step 3416.
  • the PCT/CN2007 touches the 176 step 3418, and the terminal performs corresponding processing in the corresponding application scenario, such as: fast forward and rewind, synchronization, and program switching.
  • step 3418 can be specifically implemented as follows:
  • the terminal compares the PTS value corresponding to the RTP Timestam of the obtained broadband program access unit with the PTS value of each access unit of the broadcast program, and the same is synchronously displayed;
  • step 3410 the terminal manually or automatically switches the program, and knows that the switching point of the program is PTS (X);
  • step 3411 query NTP ( x ) corresponding to PTS ( x );
  • the network delay may be considered, and the time point corresponds to the NTP time query at a certain moment before the switching point;
  • step 3418 when the terminal receives the NTP value corresponding to the access unit in the multicast group as NTP (X), the access unit indicated by the PTS (X) of the broadcast program is displayed.
  • the terminal displays a broadcast program; plays a wide-band program.
  • the first process of the third embodiment may also be that the broadcast service provider sends a correspondence between the PTS and the NPT to the time mapping server, and the broadband program is controlled by using the RTSP, and the terminal is based on the PTS of the broadcast program and the slave time mapping server.
  • the mapping relationship between the broadcast program PTS and the PT obtained by the request/the corresponding time of a certain point, the RTP Timestamp of the broadband program, the correspondence between the RTP Timestamp of the RTSP and the NPT is calculated, and then the synchronization, switching, or combination presentation is performed. .
  • FIG. 35 is a schematic diagram of an implementation process of using a mapping server to carry a corresponding relationship.
  • the broadband service provider informs the time mapping server of its time correspondence.
  • the RT stream is controlled using the RTCP protocol.
  • the broadcast service provider provides the time mapping server between the PTS and the NPT of the broadcast program. Mapping relationship;
  • the time mapping server knows the time mapping relationship between the PTS and the NTP according to the mapping relationship between the PTS and the NPT of the broadcast program A and the NTP (0) of the broadband program B.
  • Step 3501 The broadcast monthly service provider determines a start time point PTS ( 0 ) of the program and a time correspondence relationship between the PTS and the PT;
  • Step 3502 The broadcast service provider sends the PTS and NPT correspondence of the broadcast program to the time mapping server;
  • Step 3503 The time mapping server saves a time mapping relationship of the broadcast program.
  • Step 3504 The broadcast service provides a commercial TS protocol to encapsulate the broadcast program A, and then sends the program to the terminal by using the DVB S/C/T protocol;
  • Step 3505 The terminal learns the PTS value of the PES packet of the broadcast program.
  • Step 3506 the terminal interpolation calculation obtains the PTS of each access unit
  • Step 3507 The terminal requests the time mapping server to deliver the time correspondence of the broadcast program A (synchronous application scenario), or the time correspondence of a certain point (program switching application scenario);
  • Step 3508 The time mapping server responds to the request, and the time correspondence of the broadcast program is sent (synchronous application scenario), or the time corresponding to a certain point (program switching application scenario);
  • Step 3509 Calculate an NPT timestamp corresponding to each access unit PTS of the broadcast program A (synchronous application scenario);
  • Step 3510 The terminal requests to deliver the broadband program B, and the starting time point is the request time PTS or some An NPT corresponding to a special PTS value;
  • Step 3511 The broadband program B is sent to the terminal;
  • Step 3512 The RTSP controls the broadband program B, and carries the correspondence between the RTP Timestamp and the NPT to the terminal;
  • Step 3513 The terminal calculates the PT value of each access unit according to the correspondence between the RTPTimestamp of each access unit in step 3515 and the RTP Timestamp and the PT known in step 3515.
  • NPT (i) NPT (i-k) + (RTP (i) -RTP (i-k)) / f; f is the sampling frequency corresponding to the load type;
  • Step 3514 The terminal performs corresponding processing in the corresponding application scenario, such as: fast forward and rewind, synchronization, and program switching.
  • step 3514 can be specifically implemented as follows:
  • the terminal compares the NPT value corresponding to the RTP Timestamp of the broadband program access unit with the NPT value corresponding to each access unit PTS of the broadcast program, and the same is synchronously displayed;
  • step 3507 the NPT value corresponding to the PTS (X) of the access unit is requested to be paused, fast forwarded and retracted;
  • step 3508 the PT (x) value corresponding to the PTS (X) is delivered in response;
  • Steps 3509 can be omitted
  • step 3514 the playback of the broadcast program is stopped at the PTS (X) point, and the broadcast of the wideband program is performed;
  • step 3506 adds the following processing between step 3506 and step 3507:
  • the terminal knows that the switching time point is PTS (x);
  • step 3507 request NPT ( x ) corresponding to PTS ( X ); Responding to the NTP (x) value corresponding to PTS (x) in step 3508;
  • step 3510 the terminal requests to start broadcasting the broadband program B from the PT (X) point;
  • step 3514 the broadcast of the broadcast program is stopped at the PTS (X) point, and the broadcast of the broadband program is performed;
  • the NTP time query may be performed at a certain time before the switching point, and the broadband program is requested to be delivered;
  • FIG. 36 is a schematic diagram of the implementation process of the mapping relationship between the mapping server and the server, and as shown in the figure, when the time correspondence is the correspondence between the PTS and the RTP Timestamp time, the broadband service provider informs the time mapping server of the time mapping of the broadband program. Relationships, and control RTP streams using RTCP or RTSP. You can do this as follows:
  • Step 3601 The broadcast service provider determines a time correspondence between the PTS and the NPT of the program;
  • Step 3602 The broadcast service provider sends the time correspondence (PTS and PT) of the broadcast program A to the time mapping server;
  • Step 3603 The time mapping server saves a time mapping relationship of the broadcast program A.
  • Step 3604 The broadband service provider sends the time correspondence (RTP Timestamp and NPT) of the broadband program B to the time mapping server;
  • step 3605 the time mapping server saves the time mapping relationship of the broadband program B;
  • Step 3607 The broadcast service provider encapsulates the broadcast program A by using the TS protocol, and then sends the program to the terminal by using the DVB S/C/T protocol;
  • Step 3608 The terminal learns the PTS value of the PES packet of the broadcast program A. 03176 Step 3609, the terminal interpolation calculation obtains the PTS of each access unit;
  • Step 3610 The terminal requests the time server to deliver the time correspondence of the broadcast program A (synchronous application scenario), or the time correspondence of a certain point (program switching application scenario);
  • Step 3611 The time mapping server responds to the request, and sends a time correspondence relationship of the broadcast program A (synchronous application scenario), or a time corresponding to a certain point (program switching application scenario);
  • Step 3612 The broadband program B is sent to the terminal;
  • Step 3613 The RTSP controls the broadband program B, and carries the correspondence between the RTP Timestamp and the PT to the terminal; or the RTCP controls the broadband program B, and carries the correspondence between the RTP Timestamp and the NTP to the terminal;
  • Step 3614 The terminal calculates the PTS value of each access unit according to the RTPTimestamp of each access unit in step 3615 and the correspondence between the RTP Timestamp and the PTS obtained in step 3611.
  • PTS(i) PTS( ik )+(RTP( i ) - RTP( ik ))*( PTS (i+k) -PTS (ik) )/(RTP (i+k) -RTP (ik) );
  • PTS (i) PTS (i-k) + (RTP (i) -RTP (i-k) )* brain;
  • Step 3615 The terminal performs corresponding processing in the corresponding application scenario, such as: fast forward and rewind, synchronization, and program switching.
  • step 3615 can be implemented as follows:
  • the terminal compares the PTS value corresponding to the RTP Timestamp of the obtained broadband program access unit with each access unit PTS of the broadcast program, and the same is synchronously displayed.
  • step 3609 the terminal knows that the switching time point is PTS (x); in step 3609, requesting RTP (x) corresponding to PTS (X);
  • step 3610 responding to the RTP (X) value corresponding to PTS (X);
  • step 3615 the RTP Timestamp of the broadband program is obtained according to the result of step 3614.
  • the corresponding PTS value is PTS ( x )
  • the broadcast program is stopped at the PTS (x) point, and the broadcast of the wide-band program is performed.
  • the embodiment of the present invention further provides a media stream sending system, and a specific implementation manner of the system is described below with reference to the accompanying drawings.
  • the first media stream server that sends the media stream to the terminal is used in the first media stream.
  • Corresponding relationship information is placed in the first media stream sent by the server to the terminal, and/or the second media stream sent by the second media stream server to the terminal, where the corresponding relationship includes: the first media stream data packet and the time information a first correspondence of the display time, a second correspondence between the second time information of the second media stream packet and the second display time.
  • the correspondence between PTS and NPT or PTS ( 0 ) can be obtained from the time correspondence source.
  • a corresponding relationship placing module in the system includes a first placing unit and a second placing unit.
  • the broadcast service provider in the figure serves as a first media stream server, and the broadband service provider acts as a
  • the second media stream server is known, the first placement unit is located on the broadcast service provider side, and the second placement unit is located on the broadband service provider side, where:
  • a first placement unit configured to: in the first media stream, first correspondence information of the first time information of the first media stream packet and the first display time;
  • a second placement unit configured to: in the second media stream, the second correspondence information of the second media stream packet second time information and the second display time.
  • the first placement unit may further include one of the first subunit, the second subunit, and the third subunit, or a combination thereof, and the functions are respectively:
  • a first subunit configured to: place the first correspondence information in a packet basic stream header of the first media stream;
  • a second subunit configured to: place the first correspondence information in a transport stream event information table of the first media stream; 07 003176 ⁇ three subunits, configured to place the first correspondence information in a newly created time mapping relationship table of the first media stream.
  • a correspondence placement module in the system includes a transmission unit and a third placement unit.
  • the broadcast service provider is used as the first media stream server, and the broadband service provider is used as the second.
  • Media stream server where:
  • the transmission unit is connected to the broadcast service provider and the broadband service provider, and is configured to acquire, from the broadcast service provider that is the first media stream server, the first correspondence information of the first time information of the first media stream packet and the first display time. And transmitting to the third placement unit located at the broadband service provider side; the third placement unit is configured to: first time correspondence information of the first media stream, second time information of the second media stream packet, and second display time The second correspondence information is placed in the second media stream.
  • a corresponding relationship placing module in the system includes a sending unit, a second placing unit, and a mapping server.
  • the broadcast service provider in the figure serves as a first media stream server, and a broadband service provider.
  • the sending unit is connected to the mapping server and the broadcast service provider, and the second placing unit is connected to the terminal on the broadband service provider side as the second media stream server, where:
  • a sending unit configured to send the first correspondence information of the first time information of the first media stream packet and the first display time to the mapping server;
  • a second placement unit configured to: in the second media stream, the second correspondence information of the second media stream packet second time information and the second display time;
  • mapping server configured to send the first correspondence information to the terminal.
  • the terminal further includes a corresponding relationship processing module, configured to: according to the received correspondence, when the first display time and the second display time difference corresponding to the time information are less than a threshold, the first media is used The stream packet is processed with the second media stream packet.
  • the correspondence processing module may include one of a synchronization processing unit, a first switching unit, and a second switching unit, where:
  • a synchronization processing unit configured to simultaneously display the data packet of the first media stream and the second display time stamp of the first display time identifier when the first display time and the second display time are the same or the difference is less than the threshold a packet of the second media stream;
  • a first switching unit configured to switch, when the first display time and the second display time are the same or the difference is less than the threshold, to switch the data packet of the first media stream of the first display time identifier into the second media stream of the second display time identifier data pack;
  • a second switching unit configured to switch the data packet of the second media stream identified by the second display time into the first media stream of the first display time identifier when the first display time and the second display time are the same or the difference is less than the threshold data pack.
  • streaming technology plays an important role in distance education, digital libraries, e-commerce, video on demand, interactive TV, telemedicine, network audio/video, real-time multimedia conferencing, and more.
  • streaming media technology and its applications will inevitably play a more important role and will profoundly change people's lifestyles. Therefore, the synchronization problem between different media streams solved by the embodiments of the present invention has important application value and significance.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

一种不同媒体流间的同步方法及系统 技术领域
本发明涉及媒体流间数据流的同步技术, 特别涉及不同媒体流间数据流 的同步技术。 背景技术
现代通信中存在着各种不同的媒体流, 其中比较具有代表性的是传输流 与实时传输协议流。
―、 传输流(TS, Transport Stream )的同步。
活动图像专家組 (MPEG, Moving Picture Exports Group)于 1988年成 。 MPEG-2是其颁布的(活动图像及声音编码)国际标准之一,制定于 1994年, 是为高级工业标准的图像质量以及更高的传输率而设计。 编码码率从每秒 3 兆比特 ~ 100兆比特, 是广播级质量的图像压缩标准, 并具有 CD级的音质。 它在常规电视的数字化、 高清晰电视 HDTV、 视频点播 VOD, 交互式电视等 各个领域中都是核心的技术之一。 图 1为 MPEG-2的时序模型示意图, 如图 所示, MPEG-2中的同步不仅仅指同一节目的音频流和视频流间的同步,还包 括编码器和解码器之间端到端的同步。
1、 TS流中时间戳定义。
MPEG-2 TS流中的同步是通过时间戳来实现的, 由编码器中单一的公用 系统时钟(STC, System Time Clock ) 27 MHz创建时间戳, TS流中时间戳有 两类:
TS 包头中指出系统时钟值的节目参考时钟 ( PCR , Program Clock Reference ), 每个节目当且仅有一个 PCR;
分組基本流(PES, Packetised Elementary Stream ) 包头中指出音频和视 频正确的解码时间戳 ( DTS , Decoding time-stamp )和展现时间戳(PTS, Presentation time-stamp ), 每个存储单元配有一对 PTS+DTS或者一个 PTS。 2、 TS流中的同步机制。
解码器在解码时, 首先利用 PCR重建和编码器同步的 27MHz系统时钟, 恢复 27MHz系统时钟后,再利用 PES流中的 DTS、 PTS进行音频和视频间的 同步。
具体算法如下:
图 2为用 PCR重建 27MHz系统时钟的流程示意图, 如图所示, 解码器 从输入码流的包头中解出时间信息 PCR送入到系统时间时钟恢复电路; 系统 时间时钟恢复电路再接收到每一个新的 PCR时, 进行本地系统时间时钟恢复 和锁相。 当一个新节目的 PCR到达解码器时就需要更新时间基点, STC要设 置为 PCR中的当前值。通常第一个从解复用器中解出的 PCR被直接装入 STC 的计数器, PCR值作为锁相环的参考频率用来和 STC的当前值比较, 产生的 差值经过脉宽调制后输入到低通滤波器并经放大, 成为控制信号用来控制压 控振荡器(VCO, Voltage Controlled Oscillator )的瞬时频率, VCO输出的频 率是在 27MHz左右的振荡信号, 它作为解码器的系统时钟。
解复用器后, 从 PES包头解出展现时间戳 PTS和解码时间戳 DTS, 并送 入到解码器中。
分组基本流解码器在接收到新的 PTS DTS 后, 存入对应的先进先出 ( FIFO, First In First Out )存储器中进行管理, 对于没有 PTS/DTS的显示单 元, 通过差值计算的方法获得其对应的时间戳, 并送入到 FIFO中管理。
每一个显示单元开始解码前,用其对应的 DTS与 STC进行比较, 当 STC 与 DTS相等时开始解码。
每一个显示单元开始显示前, 用其对庶的 PTS与 STC进行比较, 当 STC 与 PTS相等时开始显示。
二、 实时传输协议流(RTP, Realtime Transport Protocol )的同步。
RTP是针对 Internet上多媒体数据流的一个传输协议 , 由 Internet工程任 务组(IETF, Internet Engineering Task Force )作为 RFC 1889发布。 RTP被定 义为在一对一或一对多的传输情况下工作, 其目的是提供时间信息和实现流 同步。 RTP的典型应用建立在用户数据 ^艮协议 ( UDP, User Datagram Protocol ) 上, 但也可以在传输控制协议(TCP, Transmission Control Protocol )或其他 协议之上工作。 RTP本身只保证实时数据的传输, 并不能为按顺序传送数据 包提供可靠的传送机制, 也不提供流量控制或拥塞控制, 它依靠实时传输控 制协议(RTCP, Realtime Transport Control Protocol )提供这些服务。
RTCP负责管理传输质量在当前应用进程之间交换控制信息。 在 R P会 话期间, 各参与者周期性地传送 RTCP包, 包中含有巳发送的数据包的数量、 丢失的数据包的数量等统计资料, 因此, 服务器可以利用这些信息动态地改 变传输速率, 甚至改变有效载荷类型。 RTP和 RTCP配合使用, 能以有效的 反馈和最小的开销使传输效率最佳化, 故特别适合传送网上的实时数据。
1、 RTP流中时间戳的处理。
时间戳字段是 RTP首部中说明数据包时间的同步信息, 是数据能以正确 的时间顺序恢复的关键。 时间戳的值给出了分组中数据的第一个字节的采样 时间 (Sampling Instant), 要求发送方时间戳的时钟是连续、 单调增长的, 即使 在没有数据输入或发送数据时也是如此。 在静默时, 发送方不必发送数据, 保持时间戳的增长, 在接收端, 由于接收到的数据分组的序号没有丟失, 就 知道没有发生数据丢失, 而且只要比较前后分組的时间戳的差异, 就可以确 定输出的时间间隔。
2、 实时流协议 ( RTSP, Real-time Streaming Protocol )播放 RTP节目过 程示意。
RTSP是应用层协议, 目的是为流媒体实现多点传送和以点播方式单一传 送提供的协议。 RTSP利用流技术把数据分成许多包, 包的大小由客户端和服 务端的实际带宽决定, 当客户端接收到足够的数据包时, 用户不需下载整个 媒体文件就可以开始播放流媒体。 因为播放器在播放一个包的同时, 解压另 一个包并下载第三个包。 流媒体数据可以是输入的实况信息, 也可以是存储 的视、 音频片段。 通过 RTSP协议, 服务器端可以跟踪流媒体传输的时间、地 址和方式。 RTSP增加了对流媒体的控制请求, 能恢复来自媒体服务器的流媒 体。
在 RTSP中假定: 采样频率为 8000 Hz (采样频率由负载格式决定), 打 包间隔为 100 ms, 初始化的序列号(sequence number )和 RTP时间戳 ( rtp timestam ) 为 0, 贝' j表述为:
C->S: PLAY rtsp://xyz/fizzle RTSP/1.0
CSeq: 4
Session: abcdefg
Range: npt=10-15
S->C: RTSP/1.0 200 OK
CSeq: 4
Session: abcdefg
Range: npt=10-15
RTP-Info: url="rtsp://xyz/fizzle/audiotrack"
ssrc=0D12F123: seq=0;rtptime=0
RTP的数据流描述如下:
S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s S -> C: RTP packet - seq = 1 , rtptime = 800, NPT time = 10.1s
S -> C: RTP packet - seq - 49, rtptime = 39200, NPT time = 14.9s 其中, PT为正常播放时间 ( Normal play time )。
通过 Range: 10― 15可以获知播放的节目的时间段为节目的第 10 ~ 15秒; 所以 RTSP服务器下发的 RTP包的显示时间 ( PT )从 10开始。
通过上例可以看出 RTP timestamp和 NPT时间之间的对应关系, 终端根 据将多个 RTP流的 RTP time-stam 转换为统一的 NPT,将 NPT相同的(相差 在某个范围之内) 同时展现。
目前存在着将 TS流与 RTP流之间同步的需求, 进一步的, 更加需求在 任意不同媒体流之间进行同步。 然而, 现有技术中却没有相应的解决方法。 P T/CN2007/003176 发明内容
本发明实施例提供一种不同媒体流间的同步方法及系统, 用以实现来自 于不同网络媒体之间的媒体流之间的同步。 更进一步的, 用于实现 RTP流与 TS流之间的同步。
本发明实施例所提供的一种不同媒体流间的同步方法, 包括如下步骤: 建立第一媒体流数据包第一时间信息与第一显示时间的第一对应关系; 建立第二媒体流数据包第二时间信息与第二显示时间的第二对应关系; 根据所述对应关系, 在时间信息对应的第一显示时间与第二显示时间差 小于阔值时, 将第一媒体流数据包与第二媒体流数据包同时显示。
本发明实施例还提供了一种不同媒体流间的同步系统, 包括:
第一对应模块, 用于建立第一媒体流数据包第一时间信息与第一显示时 间的第一对应关系;
第二对应模块, 用于建立第二媒体流数据包第二时间信息与第二显示时 间的第二对应关系;
显示模块, 用于才艮据所述对应关系, 在时间信息对应的第一显示时间与 第二显示时间差小于阔值时, 将第一媒体流数据包与第二媒体流数据包同时 显示。
本发明实施例还提供了一种媒体流发送方法, 包括如下步骤:
将第一媒体流、 第二媒体流发送至终端, 所述第一媒体流和 /或第二媒体 流中包括: 第一媒体流数据包第一时间信息与第一显示时间的第一对应关系 信息、 第二媒体流数据包第二时间信息与第二显示时间的第二对应关系信息。
本发明实施例还提供了一种媒体流发送系统, 包括向终端发送第一媒体 流的第一媒体流服务器、 向终端发送第二媒体流的第二媒体流服务器, 还包 括对应关系放置模块, 用于在第一媒体流服务器向终端发送的第一媒体流、 和 /或第二媒体流服务器向终端发送的第二媒体流中放置对应关系信息, 所述 对应关系包括: 第一媒体流数据包第一时间信息与第一显示时间的第一对应 关系、 第二媒体流数据包第二时间信息与第二显示时间的第二对应关系。 本发明有益效果如下:
本发明在于通过利用在各自媒体流中各数据包中固含的时间信息建立对 应关系, 同时由于不同媒体流需要完成同步, 则其必然存在需要同步的原因, 比如需要同时显示等等, 从中利用这个共同的因数建立起一个共同的时间坐 标, 再利用所建立的对应关系来进行协调控制, 从而解决了不同媒体流之间 的同步问题。 更进一步的, 本发明实施例中以 TS流与 RTP流之间的同步为 例, 利用了 TS流 PTS与 NPT的对应关系, 以及 RTP流 time-stamp与: PT 的对应关系, 将 NPT相同的 TS流存储单元与 RTP流包中的展现单元同时显 示, 从而完成了两种流之间的同步。 实现了来自于广播网络的节目和来自于 宽带节目的同步, 解决了来自于不同网络的媒体流之间的同步, 在现代流媒 体技术中具有显著的实际运用效果及意义。 附图说明
图 1为背景技术中所述 MPEG-2的时序模型示意图;
图 2为背景技术中所述用 PCR重建 27MHz系统时钟的流程示意图; 图 3为本发明实施例应用场景示意图;
图 4为本发明实施例中所述 RTP流与 TS流的同步方法实施示意图; 图 5为本发明实施例中所述 RTP流与 TS流的同步方法中单个展现单元 的同步基本原理示意图;
图 6为本发明实施例中所述 RTP流与 TS流的同步方法中多个展现单元 的同步基本原理示意图;
图 7为本发明实施例中所述 RTP流与 TS流同步方法的一个具体实施例 的流程示意图;
图 8为本发明实施例中所述 RTP流与 TS流的同步方法中利用 NTP实现 单个展现单元的同步基本原理示意图;
图 9为本发明实施例中所述 RTP流与 TS流的同步方法中利用 NTP实现 多个展现单元的同步基本原理示意图;
图 10为本发明实施例中所述 RTP流与 TS流同步方法的另一个具体实施 例的流程示意图;
图 11为本发明实施例中所述 RTP流与 TS流的同步系统结构示意图; 图 12为本发明实施例中所述 PES包头数据示意图;
图 13为本发明实施例中所述第一实施例携带对应关系的系统架构一示意 图;
图 14为本发明实施例中所述广播节目流携带对应关系的实施流程一示意 图;
图 15为本发明实施例中所述第一实施例携带对应关系的系统架构二示意 图;
图 16为本发明实施例中所述广播节目流携带对应关系的实施流程二示意 图;
图 17为本发明实施例中所述第一实施例携带对应关系的系统架构三示意 图;
图 18为本发明实施例中所述第一实施例携带对应关系的系统架构四示意', 图;
图 19为本发明实施例中所述广播节目流携带对应关系的实施流程四示意 图;
图 20为本发明实施例中所述 PES包结构示意图;
图 21为本发明实施例中所述第二实施例携带对应关系的系统架构一示意 图;
图 22为本发明实施例中所述 RTP流/ RTCP包携带对应关系的实施流程一 示意图;
图 23为本发明实施例中所述 RTP流/ RTCP包携带对应关系的实施流程二 示意图;
图 24为本发明实施例中所述 RTP流/ RTCP包携带对应关系的实施流程三 示意图;
图 25为本发明实施例中所述第二实施例携带对应关系的系统架构四示意 图;
图 26为本发明实施例中所述 RTP流 /RTCP包携带对应关系的实施流程四 示意图;
图 27为本发明实施例中所述 RTP包头结构示意图;
图 28为本发明实施例中所述 RTP包结构示意图;
图 29为本发明实施例中所述 RTCP SR包结构示意图;
图 30为本发明实施例中所述 RTCP SDES包结构示意图;
图 31为本发明实施例中所述 APP: Application-Defined RTCP Packet包头 结构示意图;
图 32为本发明实施例中所述 APP: Application-Defined RTCP Packet包结 构示意图;
图 33为本发明实施例中所述第三实施例利用映射服务器承载对应关系的 系统架构示意图;
图 34为本发明实施例中所述利用映射服务器承载对应关系的实施流程一 示意图;
图 35为本发明实施例中所述利用映射服务器承载对应关系的实施流程二 示意图;
图 36为本发明实施例中所述利用映射服务器承载对应关系的实施流程三 示意图;
图 37为本发明实施例中所述发送系统一结构示意图;
图 38为本发明实施例中所述发送系统二结构示意图;
图 39为本发明实施例中所述发送系统三结构示意图。 具体实施方式
下面结合附图对本发明的具体实施进行说明。 本发明实施例的构思在于, 首先建立第一媒体流数据包第一时间信息与 第一显示时间的第一对应关系; 建立第二媒体流数据包第二时间信息与第二 显示时间的笫二对应关系; 4艮据对应关系, 在时间信息对应的第一显示时间 与第二显示时间差小于阈值时, 将第一媒体流数据包与第二媒体流数据包同 时显示。 本发明实施例构思实质在于, 通过利用在各自媒体流中各数据包中 固含的时间信息建立对应关系, 同时由于不同媒体流需要完成同步, 则其必 然存在需要同步的原因, 比如需要同时显示等等, 从中利用这个共同的因数 建立起一个共同的时间坐标, 再利用所建立的对应关系来进行协调控制, 从 而解决了不同媒体流之间的同步问题。
由于, 本发明实施例构思所使用的是不同媒体流中的固有自然规律, 因 此, 本发明具体实施中将用比较典型的两种媒体流: TS流与 RTP流的同步为 例来阐述本发明的具体实施方式以及本发明, 但显然, 本发明实施例并不仅 仅只能运用于解决 TS流与 RTP流之间的同步问题。
为了更清晰的了解本发明实施例的目的, 首先介绍一下本发明实施例的 应用场景, 图 3为本发明实施例应用场景示意图, 如图所示, 在图中 TS流与 RTP 流经过同步协调后, 同时展现出来。 假设用户打开电视机, 想要观看广 播网节目; 同时, 用户又希望选择宽带节目进行观看; 在广播网节目和宽带 节目在终端能以一定的方式组合显示时, 如: 画中画, 多屏幕显示等等方式; 当广播节目是视频节目, 宽带节目为音频节目; 或广播节目是视频、 音频节 目, 宽带为第二视频节目 (与广播的视频节目画面匹配) 时; 广播节目是低 清晰度的视频、 音频, 宽带节目是附加清晰度的视频、 音频, 此时如果希望 所选择的宽带节目需要与广播网络的节目同步, 那么两者就可以通过本发明 实施例同步协调结合, 从而显示出相匹配的高清晰度的电视节目等等。
也就是, 本发明实施例是要提供一种实现来自于广播网络的节目和来自 于宽带节目的同步方法。 从而解决来自于不同网络的媒体之间的同步, 如: 来自广播网络的节目流( TS流)和来自宽带网絡的 RTP节目流。
图 4为 RTP流与 TS流的同步方法实施示意图, 如图所示, 同步时包括 76 以下步骤:
步驟 401、 建立传输流展现时间戳与正常播放时间的第一对应关系; 步驟 402、 建立实时传输协议流时间戳与正常播放时间的第二对应关系; 步骤 403、根据第一对应关系将传输流中的存储单元的展现时间戳与正常 播放时间对应, 根据第二对应关系将实时传输协议包与正常播放时间对应; 步驟 404、 将正常播放时间相同的存储单元与实时传输协议包同时显示。 下面对本实施例中用以实现 TS流和 RTP流同步的元素进行说明:
1、 TS流的 PES包头中的展现时间戳 ( PTS, Presentation time-stamp ), 用以指出一个展现单元 (presentation unit ), 展现单元是已解码的一个音频访 问单元或一帧解码图像在系统目标解码器中 现的时刻;
2、 TS包头中节目参考时钟 PCR;
3、 RTP包头中的时间戳(RTP time-stamp ), 表示本 RTP数据包的第一个 字节的采样时刻, 即使没有 RTP包发送, times-tamp仍然按照采样频率增长, 多个 RTP数据包的时间戳可以相同, 表示是同一时刻采样出的数据, 分成多 个 RTP数据帧传输;
4、 RTSP媒体描述中的数据类型和编码格式。 如 "m=audio 3456 RTP/AVP 0"。 根据媒体的类型可以获知其采样频率;
5、 RTSP的 PLAY response中的 Range header和 RTP-Info header, 可以通 过它获知 RTP timestamp 和正常播放时间 ( NPT )之间的对应关系。
图 5为 RTP流与 TS流的同步方法中单个展现单元的同步基本原理示意 图, 如图所示,
假设 RTP包中的第 t个展现单元的 RTP timestam 为 RTP(t), TS流中第 j 个展现单元的 PTS为 PTS①, 根据一定的计算法则 (后面详细介绍该计算方 法)将 RTP(t)、 PTS(j)转换为 NPT(RTP(t) )、 PT(PTS(j)), 当 NPT(RTP(t)和 NPT(PTS(j))相等的时候, 或者在某一个设定的区间内的时候, 则同时展现来 自 TS流和 RTP流的这两个展现单元, 从而实现这两个流的同步。 该设定的 区间用于当时间信息对应的第一显示时间与第二显示时间差小于该设定阈值 时, 将第一媒体流数据包与第二媒体流数据包同时显示, 显然, 该设定的阈 值是可以根据需要来确定的, 如普通的设定为 0.1秒, 而对要求高精度同步的 这可以设为 0.001秒等等, 以下实施例中同理进行设定。
图 6为 RTP流与 TS流的同步方法中多个展现单元的同步基本原理示意 图, 基于图 5所述的原理, 以此类推, 当多个展现单元存在时, 则如图 6所 示, 多个 RTP流(RTP1、 RTP2、 …、 RTPn ) 中展现单元的 RTP timestamp和 多个 TS流(TS1、 TS2 TSn ) 中展现单元的 PTS时间均对应成的 PT 时间相等时, 或者在某一个小的按需要设置的区间内的时候, 则同时显示, 从而实现同步。
PTS头表示应该何时在终端播放该展现单元。 RTP头中的 RTP time-stamp 表示自开始点播以来的釆样时间长度, 参考媒体的采样频率 (从媒体的格式 可以查找到规定的采样频率) 以及 PLAY response中的 Range (播放时间段) 和 Range对应的 timestamp数值, 因此实施时可以利用 PT时间建立 PTS和 RTP timestam 之间的对应关系。
图 7为 RTP流与 TS流同步方法的一个具体实施例的流程示意图, 如图 所示, 实施时包括以下步骤:
步驟 701、 用户观看节目, 如: 画中画节目、 双屏幕节目等;
步骤 702、 用户根据节目菜单选择广播节 3 A进行观看;
步骤 703、 终端转到用户所选节目 A所在的频道, 并接收节目 A的 TS 流; 实施时节目 A可以通过数字视频广播(DVB, Digital Video Broadcast) 等协议下发到终端;
步驟 704、 终端获知该节目的起始解码器从输入的 TS流的包头中解出含 时间信息的 PCR送入到系统时间时钟恢复电路, 校准系统时间时钟 ( SCR, System Clock Reference );
步骤 705、 获得 PTS和 NPT之间的对应关系;
步骤 706、基本流解码器在接收到新的 PTS后, 存入对应的 FIFO中进行 管理, 对于没有 PTS/DTS的显示单元, 需要对其时间标签进行差值, 并送入 到 FIFO中管理。 即获得每个存储单无的 PTS(t);
步骤 707、 当由步骤 706获得新 PTS后, 再根据步骤 705中的对应关 系, 计算出该 PTS(t)所对应的相对于节目起点的正常播放时间 NPT(RTP(t)), 此时 TS流处理结束, 转入步骤 713等待进行显示;
步骤 708、 用户选择宽带节目 B , 宽带节目 B需要和广播节目 A同步播 放;
步骤 709、 终端和服务器建立 RTSP连接;
步 4聚 710、 终端根据媒体源的媒体描述, 来获知媒体的釆样频率 f;
步骤 711、 终端用户请求播放节目 B, 服务器响应发送 RTSP报文; 根据 RTSP协议 PLAY response中的 Range header和 RTP-Info header, 终端解码器 由此可获知 RTP timestamp和正常播放时间 ( NPT )之间的对应关系;
即以后的 RTP时间戳可通过公式:
NPT( RTPG) ) =(RTP timestampG) - RTP timestamp(k)) I f + NPT( RTP(k) ); 计算出 RTP timestamp(j)对应的 PT ( RTP(j) ); 其中, k时刻位于 j时刻 之前。
步驟 712、 收到服务器发送的 RTP包, 获知其 RTPtimestamp为 RTPG), 根据步骤 711中的对应关系计算出对应的 NPT时间为 NPT ( RTPG) ), 此时, RTP流处理结束, 转入步驟 713等待显示;
、 步骤 713、 比较上述根据 RTP时间戳转换后的 NPT ( RTP(j) )和根据 PTS 计算出来的 NPT(PTS (t)), 当它们相等时, 或按照某种计算规则, 相差在某个 区间时, 同时显示这两个包。
依此类推, 逐个包的同步即实现了两个流的同步。
在步骤 705 中, 对于 TS流, 在具体实施时可以通过如下几种方法获取 PTS与 NPT之间的对应关系。
方法 1 :
Syntax iNumber of bits Identifier event_information_section() {
table— id 8 uimsbf section— syntax— indicator 1 bslbf reserved_future_use 1 bslbf reserved 2 bslbf section— length 12 uimsbf service— id 16 uimsbf reserved 2 bslbf version一 number 5 uimsbf current— next— indicator 1 bslbf section— number 8 uimsbf last— section— number 8 uimsbf transport— stream— id 16 uimsbf original— network— id 16 uimsbf segmsnt一 last— section— number 8 uimsbf last— table— id 8 uimsbf for(i=0 i<N;i++){
event— id 16 uimsbf start— time 40 bslbf
StartAU_PTS 33
duration 24 uimsbf running— status 3 uimsbf free—CA—mode 1 bslbf descriptors_loop_length 12 uimsbf for(i=0;i<N;i++){
descriptor()
}
}
CRC 32 32 rpchof
Figure imgf000017_0001
通过在电子节目菜单 (EPG, Electronic Prog ram Guide ) 中的事件信息表 ( EIT, Event Information Table )表中添加节目的起始存储单元的 PTS时间戳 ( StartAU_PTS )标识符, 来使得终端在节目播放期间, 获知节目的起始存储 单元的展现时间戳 PTS; 在 TS流解码后,每获得一个解析出的 PTS后, 带入 公式:
PT ( t ) = ( PTS(t)-StartAU_PTS ) *n/f, f是传输流系统时钟频率; n在 实施中取值为 300 , 因为在 MPEG 2标准中, 规定 PTS (展现时间戳)被编码 为系统时钟频率的 1/300, 系统时钟频率值位于 [27 000 000 -810 , 27 000 000 + 810]区间内, 单位为 Hz。 以下计算中涉及 n值的均以 300的具体实施值来说 明本发明的具体实施。
按以上公式便可计算出该存储单元的相对节目起始点的播放时间 PT。 方法 2:
用扩展 TS包头中的调整字段中的私有字段或者扩展字段,表明该包负荷 对应节目的起始存储单元的 PTS, 也就是头端需要记录下发送过的节目起始 存储单元的 PTS, 该标识符每隔一段时间就发送一次。
则当获得新的存取单元的 PTS后, 通过以下公式:
NPT ( t ) = ( PTS(t)-PTS ( 0 ) ) *n/f;
即可计算出相对节目起始点的播放时间 NPT。
方法 3:
服务器记录下节目的 PTS和节目播放的相对时间 PT的对应关系,如下 表所示:
Event_id/Service— id/Transport— stream— id/original_network_id
(唯一的标识节目)
PTS NPT
随机值 o 随机值 + 27000 1.000 随机值 +节目时长 3000.000
实施时 NPT的精度以满足同步的要求为准。
将该表随着节目的发送, 发送到终端, 终端记录下来, 根据如下公式: NPT (PTS(t))=(PTS(t) - PTS(i))*n/f+ NPT (PTS(i));
其中: NPT(PTS(t))是 t时刻展现时间戳的正常播放时间, PTS(t)是 t时刻 的展现时间戳, PTS(i))是离 t时刻最近的 i时刻的展现时间戳, NPT(PTS(i)) 是离 t时刻最近的 i时刻展现时间戳的正常播放时间, fl是传输流系统时钟频 率。
按上述公式即可计算出解出的 PTS对应的 NPT时间。
方法 4:
直接扩展 PES 包头, 加入 PT时间戳。 终端根据该时间戳即可知 PTS 和 NPT之间的对应关系。
为更充分的描述本发明的具体实施, 本发明又提供一实施例进行说明。 下面对本发明实施时用以实现 TS流和 RTP流同步的元素再进行说明。
1、 TS流的 PES包头中的展现时间戳 ( PTS, Presentation time-stamp ), 用以指出一个展现单元( presentation unit ), 展现单元是巳解码的一个音频访 问单元或一帧解码图像中所有的编码数据及跟随其后的任何填充直至(但不 包括)下一个单元的开始, 在系统目标解码器中被展现的时刻;
2、 TS包头中节目参考时钟 PCR;
3、 RTP包头中的时间戳(RTP time-stamp ), 表示本 RTP数据包的第一个 字节的采样时刻。 即使没有 RTP包发送, timestamp仍然按照采样频率增长, 多个 RTP数据包的时间戳可以相同, 表示是同一时刻采样出的数据, 分成多 个 RTP数据帧传输;
4、 实时传输控制协议(RTCP, Real-time Transport Control Protocol ) 包 头中, RTP时间戳和网络时间协议 ( NTP , Network Time Protocol ) 时间戳之 P T/CN200菌 176 间的对应关系;
RTCP的一个关键作用就是能让接收方同步多个 RTP流, 为能进行流同 步, RTCP要求发送方给每个传送一个唯一的标识数据源的规范名(Canonical Name ), 尽管由一个数据源发出的不同的流具有不同的同步源标识 ( SSRC ), 但具有相同的规范名, 这样接收方就知道哪些流是有关联的。 而发送方报告 报文所包含的信息可被接收方用于协调两个流中的时间戳值。 发送方报告中 含有一个以 NTP格式表示的绝对时间值,接着 RTCP报告中给出一个 RTP时 间戳值,产生该值的时钟就是产生 RTP分组中的 TimeStamp字段的那个时钟。
' 5、 正常播放时间 (NPT ), 精度满足同步的需要。
图 8为实施例中所述 RTP流与 TS流的同步方法中利用 NTP实现单个展 现单元同步的基本原理示意图, 如图所示, 假设 RTP包中的第 j个包的第一 个展现单元的 KIT timestam 为 RTP(j), TS流中的第 t个存储单元的 PTS为 PTS(t), 则将转换为 NTP (RTP(j), 再转换成 NPT (RTPG), 并将 PTS(t)转换为 NPT(PTS(t)), 当 PT(RTP(j))和 PT(PTS(t))相等的时候, 或者按需要设置在 某一个小的区间内的时候, 则同时展现来自 TS流和 RTP流的这两个展现单 元, 从而实现 RTP流和 TS流之间的同步。
图 9为实施例中所述 RTP流与 TS流的同步方法中利用 NTP实现多个展 现单元同步的基本原理示意图, 按单个展现单元的同步思路, 在多个展现单 元存在时, 以此类推, 如图所示, 多个 RTP流中的展现单元的 RTP timestamp 和多个 TS流展现单元的 PTS时间对应成为 TP时候后均相等时, 或者按需要 设置在某一个小的区间内的时候, 则同时显示, 从而实现多个 RTP流和多个 TS流之间的同步。
下面再举一例以说明具体实施的方式, 图 10为 RTP流与 TS流同步方法 的另一个具体实施例的流程示意图, 如图所示, 在同步时包括如下步骤: 步骤 1001、 用户观看节目, 如: 画中画节目、 双屏幕节目等;
步骤 1002、 用户根据节目菜单选择广播节目 A进行观看;
步骤 1003、 终端转到用户所选节目 A所在的频道, 并接收节目 A的 TS 流; 实施时节目 A可以通过数字视频广播 ( DVB, Digital Video Broadcast ) τ/s/c等协议下发到终端;
步骤 1004、 终端获知该节目的起始解码器从输入的 TS流的包头中解出 含时间信息的 PCR送入到系统时间时钟恢复电路,校准系统时间时钟( SCR, System Clock Reference );
步驟 1005、获得 PTS和 NPT之间的对应关系,本步骤中的的对应获取方 法同上一实施例;
步骤 1006、 基本流解码器在接收到新的 PTS后, 存入对应的 FIFO中进 行管理, 对于没有 PTS/DTS的显示单元, 需要对其时间标签进行差值, 并送 入到 FIFO中管理。 即获得每个存储单元的 PTS(t);
步骤 1007、 当由步骤 1006获得新的 PTS后, 再根据步骤 1005中的对应 关系,计算出该 PTS(t)所对应的相对于节目起点的正常播放时间 PT(PTS(t)), 此时 TS流处理结束, 转入步骤 1014等待进行显示;
步驟 1008、 用户选择宽带节目 B, 宽带节目 B需要和广播节目 A同步播 放;
步骤 1009、 终端根据其媒体描述获得其编码格式及组播地址, 并可得知 其采样时钟频率;
步骤 1010、终端通过因特网组管理协议 (IGMP , Internet Group Management Protocol )加入組播組, 接收组播组的媒体流(RTP/RTCP );
步骤 1011、 终端接收 RTCP SR (发送方报告) 包, 获得包头中的 RTP timestam 及 NTP 时间戳之间的对应关系, 并且获知起点的 NTP 时间为 NTP(0); 最近的 NTP时间可以获知当前 RTP timestam 对应的 NTP时间, 具 体公式如下所示:
NTPG)=(RTPG)-RTP(k))*n/f + NTP(k);
其中, NTP(k)为 RTP(k)对应的绝对播放时间。
步骤 1012、 收到服务器发送的 RTP包, 获知其 RTPtimestamp为 RTP(j), 根据步骤 1011中的公式计算出的对应的 NPT时间为 NTP①时间; 步骤 1013、 再根据如下公式:
NPT(RTPG)) = NTPG)-NTP(O);
计算出该包对应的 PT时间; 此时, RTP流处理结束, 转入步骤 1014 等待显示;
步骤 1014、比较上述根据 RTP时间戳转换后的 PT( RTPG) )和根据 PTS 计算出来的 NPT(PTS (t)), 当它们相等时, 或按照某种计算规则, 相差在某个 区间时, 同时显示这两个包。
依此类推, 逐个包的同步即实现了两个流的同步。
其中, 当 RTP包的 RTP时间戳的递增不是严格线性递增时, 按上述方式 实施; 而当 RTP包的 RTP时间戳的递增是严格递增时, 则不需要将其转化为 NTP 时间戳然后再转换为 NPT, 根据下列公式 NPT ( RTP(j) ) = (RTP(j) - RTP(0))/f 负荷频率直接转换成 NPT时间戳即可。
基于上述发明构思, 本发明实施例还提供了一种实时传输协议流与传输 流的同步系统, 图 11为 RTP流与 TS流的同步系统结构示意图, 如图所示, 实施时系统中包括第一对应模块 1101、 二对应模块 1102、 显示模块 1103 , 其中:
第一对应模块用于建立 TS流 PTS与 NPT的第一对应关系;
第二对应模块用于建立 RTP流时间戳 NPT的第二对应关系;
显示模块, 分别与第一对应模块与第二对应模块相连, 在第一对应模块 将传输流中的存储单元建立对应关系、 第二对应模块将 RTP流中的数据包建 立对应关系后, 将 NPT相同的 TS流存储单元与 RTP流包同时显示。
实施中, 第一对应模块建立 PTS与 PT的对应关系, 与前述 RTP流与 TS流同步方法的实施方式相同。
在任一时间 t时, 第一对应模块按 NPT ( t ) = ( PTS(t)-StartAU_PTS ) *n/fl 建立第一对应关系,
其中: PT ( t )是 t时刻的正常播放时间, PTS(t)是 t时刻的展现时间戳, StartAU— PTS 是通过在 EIT表中添加节目的起始存储单元的展现时间戳, fl 是传输流系统时钟频率;
或, 按 NPT (t) = (PTS(t)-PTS (0)) *n/fl建立第一对应关系, 其中: PT (t)是 t时刻的正常播放时间, PTS(t)是 t时刻的展现时间戳, PTS (0)是节目起始存储单元的展现时间戳, fl是传输流系统时钟频率; 或, 根据唯一标识节目表的展现时间戳和节目播放相对时间的正常播放 时间对应表, 按公式: PT(PTS(t))=(PTS(t) - PTS(i))*n/fl + NPT (PTS(i))得出 的 PTS对应的 RPT时间 , 建立第一对应关系,
其中: NPT(PTS(t))是 t时刻展现时间戳的正常播放时间, FTS(t)是 t时刻 的展现时间戳, PTS(i))是离 t时刻最近的 i时刻的展现时间戳, NPT(PTS(i)) 是离 t时刻最近的 i时刻展现时间戳的正常播放时间, fl是传输流系统时钟频 率;
或, 通过在扩展分組基本流包头加入正常播放时间戳, 建立的展现时间 戳与正常播放时间的对应关系, 建立第一对应关系。
同样, 实施中, 第二对应模块建立 RTP与 PT的对应关系, 与前述 RTP 流与 TS流同步方法的实施方式相同。
在任一时间 j时,第二对应模块按 PT ( RTPG) ) =(RTP timestampO) - RTP timestamp(k))/f2+NPT (RTP(k))建立第二对应关系, 其中: PT (RTP①)是实时传输协议包 j 时刻的正常播放时间, RTP timestampG)是 j时刻的实时传输协议包时间戳, RTP timestamp(k)是同一次请 求响应后位于 j时刻之前的 k时刻的实时传输协议包时间戳, f2是实时传输协 议流中媒体的采样频率; PT (RTP(k))是同一次请求响应后位于 j时刻之前 的 k时刻的实时传输协议包的正常播放时间。
或者,在任一时间 j时,第二对应模块按公式: NTPG')=(RTP(j)-RTP(k))*n/f2 + NTP(k)得出 NTP(k)后, 根据 PT(RTP(i)) = NTP(j)-NTP(0)得出实时传输协 议流包的 NPT时间, 建立第二对应关系,
其中: NTP(j)是 j时刻网络时间协议的时间, RTP(j)是 j时刻的实时传输 003176 协议包时间戳, RTP(k)是离 j 时刻最近的 k时刻的实时传输协议包时间戳, NTP(k)是 k时刻网络时间协议的时间, NTP(O)是起始时刻网络时间协议的时 间, NPT(RTP(j》是实时传输协议包 j时刻的正常播放时间, £2是实时传输协 议流中媒体的采样频率。
下面, 根据上述 RTP流与 TS流的同步原理, 再举运用实例来进一步阐 述本发明实施例中同步方法以及同步系统的具体实施方式。
下例是 RTSP操作的音视 over RTP的具体过程,同时另有一路 TS视频流 直接通过 Cable传输: '
RTSP RTP:
C->S: DESCRIBE rtsp://xyz/fizzle RTSP/1.0
CSeq: 312
User-Agent: PhonyClient 1.2
Accept: application/sdp, application/rtsl, application/m eg S->C: RTSP/1.0 200 OK
CSeq: 312
Date: 23 Jan 1997 15:35:06 GMT
Server: PhonyServer 1.1
Content-Type: application/sdp
Content-Length: 367 " v=0
o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4 s=SDP Seminar
i=A Seminar on the session description protocol
u=http://www. example .com/lectures/sdp .ps e=seminar@example.com (Seminar Management)
t=2873397496 2873404696
m=audio 3456 RTP/AVP 0 007 003176
C->S: PLAY rtsp://xyz/fizzle RTSP/1.0
CSeq: 4
Session: abcdefg
5 Range: npt=10-15;
S->C: RTSP/1.0 200 OK
CSeq: 4
Session: abcdefg
l o Range: npt= 10-15
RTP-Info: url="rtsp ://xyz/ fizzle/ audiotrack"
ssrc-OD12F123:seq-20;rtptime=76400
从媒体描述 "m=audio 3456 RTP/AVP 0"可以看出, 这是一段音频, 采样 频率是 8000HZ,则每隔 1秒, timestamp值会增加 8000。从" Range: npt=10-15" 15 和 "rtptime=76400,, 可以看出, 是从第 10秒开始播放, 第 10秒采样的 RTP 包头的 timestamp是 76400。
假如过一段时间后,媒体终端收到一个 RTP包, RTP包头中的 timestamp 值是 118000 , 则我们可以换算出此帧对应 的剪辑播放时间 =( 118000-76400)/8000+ 10=15.2秒。
20 图 12为 PES包头数据示意图, 在 TS流中 PES包头如图所示, 其中: 数据段 1201中的 47 40 45 30表示:
有效负载起始指示器: 1
PID, 0x45 (视频流)
调整字段控制: 0x3 , 调整
25 字段后为有效负荷;
数据段 1202中的 07 10 8 A A4 B6 3B FE 00表示: 调整字段长度: 0x07
调整字段中只包含 PCR: 10 P T/CN2007/003176 后面 6个字节为 PRC:
数据段 1203中的 00 00 01表示:
PES开始标志;
数据段 1204中的 FA CF C2 80 CO表示:
流 ID为 OxFA
PES包长度为 0xCFC2
包头中只含有 PTS+DTS: 80C0:
数据段 1205 中的 OA 31 00 53 BF 81
PES包头长度: 0x0 A
后面前 5个字节为 PTS
后面后 5个字节为 DTS。
TS包头中的调准字段中的 PCR值为:
if (PTS—DTS— flags = = Ί0') {
'0010'
PTS [32..30]
marker— bit
PTS [29..15]
marker— bit
PTS [14..0]
marker— bit
}
if (PTS— DTS— flags = = '11') {
Ό01Γ
PTS [32..30]
marker— bit
PTS [29..15]
marker bit PTS [14..0]
marker— bit
ΌΟΟΓ
DTS [32..30]
marker— bit
DTS [29·.15]
marker— bit
DTS [14..0]
marker— bit
} 由上图中的 PTS值、 节目开始的 PTS值(假设为 0 )及 ES包头中 PTS 的数据格式可以获知笫一个存储单元的 FTS值为 14 DF CO, 十进制表示为 1368000 , 再将 PTS 带入到公式: NPT(PTS (t)) = (PTS(t) - PTS(O)) x n/system— clock— frequency, 计算得出该 PTS对应得存储单元的 NPT时间为 15.2秒, 则与上述的 RTP包的第一个存储单元的展现时间相同, 则同时显示 这两个存储单元。
对于多个媒体流的情况, 用此构思即可实现同步。
由以上描述可知, 本发明实施例中以 TS流与 RTP流的同步为例, 利用 了 TS流 PTS与 NPT的对应关系, 以及 RTP流 time-stamp与 NPT的对应关 系 , 将 NPT相同的 TS流存储单元与 RTP流中展现单元同时显示, 从而完成 了两种流之间的同步。 从而揭示了如何在不同的媒体流之间实现数据的同步, 实现了来自于广播网络的节目和来自于宽带节目的同步, 解决了来自于不同 网络的媒体流之间的同步问题。
上面描述了在终端中根据第一对应关系、 第二对应关系将第一媒体流与 第二媒体流同步的实施方式; 但并不仅限于此, 在具体实施中, 还可以将第 一对应关系与第二对应关系下发至终端, 终端在利用所述关系进行媒体流同 步。 下面对将对应关系下发至终端后, 终端利用接收到的对应关系对媒体流 进行同步的具体实施方式进行说明。
第一实施例描述了将第一对应关系被放置到第一流媒体中, 第二对应关 系被放置到第二流媒体的控制流中; 终端接收这两个流媒体后, 利用其中的 对应关系进行媒体流同步。
第二实施例描述了将第一对应关系放置到第二媒体流中, 第二对应关系 被放置到第二流媒体的控制流中; 终端接收这两个流媒体后, 利用其中的对 应关系进行媒体流同步。
第三实施例描述了将第一对应关系放置在时间映射服务器上, 第二对应 关系放置在第二流媒体的控制流中; 终端接收这两个流媒体后, 利用其中的 对应关系进行媒体流同步。
下面对各实施例进行说明。
第一实施例:
本实施例以 TS流为例来说明如何携带对应关系 ,对应关系以 PTS和 PT 之间的对应关系为例。
图 13为第一实施例携带对应关系的系统架构一示意图, 如图所示, 广播 月艮务提供商将节目的 PTS和 PT之间的对应关系放置在 TS流中下发至终端, 而宽带服务提供商在 RTSP流中携带 RTP Timestam 和 NPT之间的对应关系 下发至终端, 终端再根据这两个对应关系进行流媒体同步。
具体携带对应关系可以按以下方式进行实施, 图 14为广播节目流携带对 应关系的实施流程一示意图, 如图所示, 携带对应关系可以包括如下步驟: 步骤 1401、广播服务提供商确定广播节目存取单元 PTS和 NPT之间的对 应关系;
步驟 1402、并将广播节目 A的这种 PTS和 PT的对应关系放置在 TS流 中;
步骤 1403、 广播服务提供商将广播节目 A及上述的时间对应关系所在的 TS流发送至终端;
步骤 1404、 终端接收到广播节目 A流媒体时, 即可获得广播节目 A中 PES包的 PTS值, 以及 PTS值和 NPT之间的对应关系;
步骤 1405、终端根据已经获得广播节目 A中 PES包的 FTS, 即可插值计 算获得节目 A中各个存取单元的 PTS值;
步骤 1406、 根据对应关系, 可计算获得各个存取单元对应的 NPT;
具体实施时可根据如下公式计算获得:
NPT(i + k)-NPT(i-k) * 一 一
NPT (i) =NPT (i-k) + PTS(i + k)-PTS(i-k) ; 或,
NPT(i) = PT(i-k) + ( 7^·)- - V/1, fl为系统时钟频率的 1/300。 步驟 1407、 终端使用 RTSP协议请求观看宽带节目 B;
步骤 1408、 RTSP服务器响应, 并发送宽带节目 B 的 RTP 包的 RTP Timestamp及对应的 PT等信息至终端;
步骤 1409、 终端获知宽带节目 B的 RTP包的 RTP Timestam 及对应的 PT;
步骤 1410、 通过计算可获得任一存取单元的 NPT;
具体可以通过如下计算公式计算获得:
NPT (j) = PT (j-k) + (RTP (j) -RTP (j-k) /f2, f2为 RTP流负荷 的采样频率。
步骤 1411、 终端在相应的应用场景下进行所需要的相应处理, 如: 快进 快退、 同步、 节目切换等。
对于步骤 1411中的各种操作具体可以按如下方式进行实施:
1、如需要实施同步,则终端根据广播节目 A存取单元的 PTS对应的 NPT 值, 和来自于宽带的宽带节目 B存取单元的 RTP Timestam 对应的 PT值进 行比较, 相同即进行同步展现;
2、 如需实施快进快退, 则只需在步驟 1406和步骤 1407之间添加快进快 退操作的时间点, 然后终端记录下该广播节目 A操作点的 PTS值及对应的 PT (如: PT(x)); 将步驟 1407变化为: 请求下发从该快进快退、 暂停的 P T/CN200菌 176 操作点的 NPT ( X )开始快进快退播放、 暂停点开始播放节目; 将步驟 Mil 变化为: 在操作时间点处, 将原来的广播节目切换为宽带节目; 即不播放广 播节目的 NPT ( x+1 )对应的及后续的存取单元, 播放宽带节目的 NPT ( x+1 ) 对应的及后续的存取单元即可。
3、 如需切换节目, 则在步骤 1406和步驟 1407之间加上: 终端已知切换 时间点为 NPT ( X )或切换的 PTS时间点, 计算可获得对应的 NPT ( X ); 将 步骤 1407变化为: 考虑到网络延时, 在切换点之前的某一时刻终端开始请求 从 NPT ( x ) 点开始播放宽带节目 B; 将步骤 1411变化为: 接收到 NPT ( x ) 点的 RTP流下发的存取单元替代广播通道下发的该节目 NPT ( x )对应的存 取单元播放即可。
图 15为第一实施例携带对应关系的系统架构二示意图, 如图所示, 广播 服务提供商将节目的 PTS和 NTP之间的对应关系放置在 TS流中下发至终端, 而宽带服务提供商在 RTCP流中携带 RTP Timestamp和 PT之间的对应关系 下发至终端, 终端再才艮据这两个对应关系进行流媒体同步。 与架构一相比, 不同点主要体现在: (1 ) 广播提供商下发的 TS 流中包含的对应关系为 PTS 和 NTP之间的对应关系; ( 2 ) RTSP变为 RTCP。
具体携带对应关系可以按以下方式进行实施, 图 16为广播节目流携带对 应关系的实施流程二示意图, 如图所示, 携带对应关系可以包括如下步骤: 步骤 1601、 广播月艮务提供商确定广播节目 A存取单元 FTS和 PT之间 的对应关系;
步骤 1602、 宽带服务提供商告知广播服务提供商宽带节目 B的 NPT和
NTP Timestamp之间的时间对应关系;
具体实施中步驟 1601、 步骤 1602的先后顺序不须作出限定。
步骤 1603、 广播服务提供商, 根据步骤 1601、 步骤 1602中获得的对应 关系通过计算可获得广播节目 A的 PTS和宽带节目 B的 NTP Timestam 之间 的对应关系; 具体对应关系可按下式进行计算为: PTS (t) = fl ; ψα = PTS(0) - * NTP(0)
其中, /1 , 2为 STC频率的 1/300, fl为宽带节目 B 负荷类型的采样频率; 广播节目 PTS(O) 可以 居 NPT = 0找到对应的 PTS
( 0 ), NTP ( 0 ) 同样根据 PT = 0找到对应的 NTP ( 0 )。
步驟 1604、广播服务提供商将广播节目的 PTS和 NTP之间的对应关系放 置在 TS流中;
步骤 1605、 广播服务提供商将广播节目 A及上述的对应关系所在的 TS 流发送至终端;
步骤 1606、 终端接收到广播节目 A媒体流时, 即可获得广播节目 A的 PES包的 PTS值及 PTS和 NTP之间的对应关系;
步骤 1607、 终端根据已经获得广播节目 A的 PES包的 PTS, 即可插值 计算获得节目 A各个存取单元 PTS值;
步骤 1608、 根据对应关系计算获得各个存取单元对应的 NTP;
具体可根据如下公式计算获得:
NTP i + k)-NTPii-k)
NTP (i) =NTP (i-k) + PTS(i + k)-PTS(i-k) ; 或,
NTP (i) =NTP (i-k) + ·)-™("))//2。
步驟 1609、 宽带节目 B经 RTP协议封装下发至组播组;
步骤 1610、宽带节目 B相关的 RTCP包发送至组播组,包含 RTCP SR包; 步骤 1611、 终端加入组播組接收宽带节目 B及 RTCP包;
步骤 1612、终端获知宽带节目 B的 RTP包的 RTPTimestamp,以及 RTCP SR包中的 RTP Timestamp和 NTP Timestamp之间的对应关系;
步骤 1613、终端根据步驟 1612的对应关系计算获得任一存取单元的 NTP; 具体可以根据如下公式计算获得: T N2007/003176
NTP (j ) = NTP (j-k ) + ( RTP (j ) - RTP (j-k) ) /fl。
步骤 1614、 终端在相应的应用场景下进行所需的相应处理, 如: 快进快 退、 同步、 节目切换等操作处理。
对于步骤 1614中的各种操作具体可以按如下方式进行实施:
1、 同步处理:
终端根据获得广播节目 A存取单元的 PTS对应的 NTP值,和来自于宽带 的宽带节目 B存取单元的 RTP Timestamp对应的 NTP值进行比较, 相同则同 步展现即可;
2、 切换处理:
当接收到 RTP流的存取单元, 并获知其 RTP Timestamp ( x )及对应的 NTP ( x )以及后续的存取单元, 替代广播通道下发的广播节目 A中 NTP ( X ) 对应的 PTS ( x )所指示的存取单元以及后续存取单元进行播放即可。
图 17为第一实施例携带对应关系的系统架构三示意图, 如图所示, 广播 服务提供商将节目的 PTS和 NTP之间的对应关系放置在 TS流中下发至终端, 而宽带服务提供商在 RTCP流中携带 RTP Timestamp和 NTP之间的对应关系 下发至终端, 终端再根据这两个对应关系进行流媒体同步。
架构三和架构二均是描述 TS流中携带 PTS和 NTP时间对应关系及 RTCP 流携带 RTP Timestamp和 NTP对应关系的架构, 架构三的不同之处在于广播 服务提供商向宽带服务提供商提供节目起始播放 NTP时间或提供节目 NTP和 NPT之间的对应关系。
由于此时实施例中的广播服务器本身有 NTP时钟, 广播服务提供商采用 本服务器端的 NTP时钟和 STC时钟采样即可获得 PTS和 NTP之间的时间对 应关系及 NPT和 NTP之间的对应关系。
广播服务提供商需告知宽带节目在 NTP ( 0 )点开始播放宽带节目 B, 或 NTP和 NPT之间的对应关系, 宽带服务提供商即可判别 NPT点的存取单元 的 NTP时间值是否和广播服务提供商提供的广播节目 A该 NPT点对应的存 取单元的 NTP值相等, 相等即可, 否则需要进行修正。 相应的,将架构二的实施流程中的步骤 1602 ~步驟 1603变更为以下步骤: Α、广播服务提供商同时对 STC和 ΝΤΡ时钟进行采样,获得对应的 PTS ( i )和 NTP ( i ); 获得了 PTS和 NTP的对应关系;
B、 根据架构二中的步骤 1601 , 广播服务提供商即可获知 PT = 0处的 PTS ( 0 ), 再根据上一步驟 A即可获知 PTS ( 0 ) 对应的 NTP ( 0 );
可知, 此时的 PT和 NTP之间的对应关系为: NTP ( t ) = NTP ( 0 ) +NPT
( t );
C> 广播服务提供商将 NTP ( 0 )或 PT和 NTP之间的对应关系发送到 宽带服务提供商;
D、 宽带服务提供商根据广播服务提供商提供的 NPT和 NTP之间的对应 关系, 设置宽带节目存取单元对应的 NTP值;
具体实现可以为: 给节目打包时, 宽带节目的 NTP和 NPT的对应关系和 广播节目的 NTP时间和 NPT之间的对应关系相同, 即 NTP时钟的起始时刻 置为相同, 频率置为相同。
图 18为第一实施例携带对应关系的系统架构四示意图, 如图所示, 宽带' 服务提供商将 RTP流的 RTP Timestamp和 PT之间的映射关系发送给广播服 务提供商, 广播服务提供商经过换算后获知 PTS和 RTP Timestamp之间的对 应关系, 并将这一对应关系中的时间对放置到 TS流中下发至终端。 终端利用 广播节目的 PTS 值、 PTS 和 RTP Timestam 的对应关系、 宽带节目 RTP Timestamp, 根据相应的需要进行同步、 切换、 快件快退等处理。
具体携带对应关系可以按以下方式进行实施, 图 19为广播节目流携带对 应关系的实施流程四示意图, 如图所示, 携带对应关系可以包括如下步骤: 步骤 1901、 广播服务提供商确定广播节目 A存取单元 PTS和 NPT之间 的对应关系; &
步骤 1902、宽带服务提供商将宽带节目 B的 RTP Timestam 和 NPT之间 的对应关系发送至广播服务提供商;
步骤 1903、 广播服务提供商以 NPT做为中介点, 找到 PTS对应的 RTP Timestamp; 如果为多个 RTP流的 RTP Timestam , 需要加标识进行区分是那 个音视频流的 RTP Timestamp和 PTS的对应;
步骤 1904、 并将广播节目的这种 PTS和 RTP Timestamp的对应关系放置 在 TS流中;
步骤 1905、 广播服务提供商将广播节目 A及上述的时间对应关系所在的 TS流发送至终端;
步骤 1906、 终端接收到广播节目 A流媒体时, 即可获得广播节目 A的 PES包的 PTS值及其 PTS值和 RTP Timestamp之间的对应关系;
步骤 1907、 终端根据已经获得广播节目 A的 PES包的 PTS, 即可插值 计算获得节目 A中各个存取单元 PTS值;
步骤 1908、根据对应关系,计算获得各个存取单元对应的 RTP Timestamp; 具体可根据如下公式计算获得:
RTP(i + k)-RTP(i-k)
:(PTS(i)-PTS(i-k))
RTP (i) =RTP (i-k) +PTS(i + k)-PTS(i-k)
或,
n
RTP ( i ) = f2
u (. =RTP(0)-^-"PTS(0)
其中 /2 , fl为宽带节目 B的负荷类型对应的采样频 率, f2为 STC的时钟频率的三百分之一。 (需要步骤 2还需传输宽带节目 B 的负荷类型)。
步驟 1909、 终端使用 RTSP协议请求观看或加入组播组接收宽带节目 B, 宽带节目 B发送至终端;
步骤 1910、 终端获知宽带节目 B的 RTP包的 RTP Timestamp;
步骤 1911、 终端在相应的应用场景下进行需要的相应处理, 如: 快进快 退、 同步、 节目切换等处理。
对于步骤 1911中的各种操作具体可以按如下方式进行实施: 007003176
1、 进行同步处理:
终端根据获得广播节目 A存取单元的 PTS对应的 RTP Timestamp值, 和 来自于宽带的宽带节 ¾ B存取单元的 RTP Timestamp值进行比较 ' 相同则同 步展现;
2、 快进快退处理:
在步骤 1908和步骤 1909之间添加: 快进快退操作的时间点, 终端记录 下该广播节目操作点的 PTS值及对应的 RTP Timestamp (如: RTP ( x ) ); 根据 RTSP协议发送的 RTP Timestamp和 NPT的对应关系, 可知操作点 为 PT ( X );
在步骤 1909中留一些时间余量, 终端使用 RTSP协议, 请求下发从该操 作点的 NPT ( X )开始快进快退播放节目宽带节目 B的请求;
在步驟 1911中, 在操作时间点处, 将原来的广播节目 A切换为宽带节目 B; 即不播放广播节目的 PT(x)对应的存取单元,播放宽带节目的 PT(x) 对应的存取单元, 播放速率由发送的 RTSP请求决定即可。
3、 切换处理:
在步驟 1908和步驟 1909之间加上: 终端已知该广播节目切换点的 PTS 值及对应的 RTP Timestamp (如: RTP (x));
在切换点之前的某一时刻终端开始加入组播組接收 R P流;
在步驟 1911中, 将接收到 NPT ( X ), 即后续 RTP流下发的存取单元, 替 代广播通道下发的该节目 PT (X)对应的后续的存取单元播放即可。
下面对在 TS流中携带时间对应关系的方式进行说明。
即: 对于上述实施例中的步骤 1402、 步骤 1604、 步驟 1904所提到的: 将广播节目的 PTS和 RTP Timestamp的对应关系放置在 TS流中,具体可以按 以下方式实施;
对于 TS流而言,携带时间对应关系的位置可以在 PES包头(与媒体紧耦 合)或者 SI信息中进行携带。
一、 PES包头携带的实施。 N2007/003176 图 20为 PES包结构示意图, 如图所示, 在不改变 PES分包协议及考虑 包中各字段作用的前提下, 可以将 PTS和 NTP Timestamp/NPT之间的对应关 系放置在 PES包头 "可选字段" 内部的 "PES扩展" 中的 "PES专用数据"、 "包头字段" 或 "PES扩展字段数据" 中, 则有:
PES— extension— flag=l&PESjprivate— data— flag=,r ,贝1 J 5个标志位后的可选 字段为 PTS和 NTP Timestamp/NPT之间的对应关系的数据;
或者,
PES— extension— flag=l & PES_extension— flag— 2=' Γ, 则 5个标志位后的可 选字段中的数据即为 PTS和 NTP Timestamp/NPT之间的对应关系的数据。
对于在放置的数据处理上,由于目前的 PES包头中 PTS—DTSJlag的值只 有两个 "10" 和 "11" (表示仅含有 PTS或含有 PTS和 DTS ), 均可表示含有 PTS (展现时间戳), 所以, 对应关系信息只需舍有该 PTS 对应的 NTP Timestamp 、 NPT或 RTP Timestamp即可实现, 如:
Reference—Time—Type— flag
If( Time— Reference— Type— flag==00){
NTP [63..0]
}
If(Time— Reference— flag==01){
PT[31...0]
}
If(Time—Reference— flag 10) {
RTP[31...0]
}
含有 PTS和该 Reference— Time— descriptor的 PES包,即可获得该包的 PTS 时间戳, 以及和该 PTS时间戳对应的 NTP Timestamp 和 /或 NPT和 /或 RTP Timestamp
二、 在 EIT表的 loop中进行携带。
在 EIT表的 loop中的 descriptor新建的 Time— Mapping_descriptor(); 放置 的具体位置是: EIT表的 loop 循环中放置新建的、 描述时间对应关系的 descriptor。
放置的数据可以为:
Time_Mapping_descriptor() {
mapping—type;
If ( mapping— type 00 ) {
for(j=0;j<M;j++){
PTS[32...0];
NTP[63 · . ·()];
I
if(mapping_type==01 ) {
forG=0;j<M;j++){
PTS[32...0];
NPT[31...0];
}
}
if(mapping_type= 10){
forG=0;j<M;j++){
PTS[32...0];
RTP[31...0];
}
}
}
该 descriptor可以描述 PTS和 NTP之间的映射关系、 PTS和 NPT Timestamp 之间的映射关系, 或 PTS和 RTP Timestamp之间的映射关系。
考虑到以后也许会使用到 PTS和另外的时间戳之间的映射关系, 所以实 施例中可以在 descriptor中添加一个映射的时间戳的类型标识符用于区分映射 的类型。 三、 新增时间映射关系表 ETMT来进行携带。
为了脱离 EIT表对时间映射关系信息的束缚, 也可以创建新的时间对应 关系表来描述当前 TS流中携带的业务的节目时间戳的对应关系。
新增的表的格式可以按下表所示进行实施:
Figure imgf000037_0001
Figure imgf000038_0001
实施中, 该表可以通过一个指定的 PID获得, 或者通过 PMT表获得其 PID后获得。实施时如果只对正在运行的节目所在的媒体流中传输该表则会更 加的高效。该表的频率和 RTCP SR包的发送频率接近即可, 不需要频率太高。
第二实施例:
本实施例以 RTP流的 RTCP包携带对应关系为例进行说明。
图 21为第二实施例携带对应关系的系统架构一示意图, 如图所示, 广播 N2007/003176 服务提供商将广播节目 A的 PTS和 NPT之间的时间对应关系发送至宽带服务 提供商, 宽带服务提供商将宽带节目 B的 RTP Timestamp, NPT之间的关系 进行比较, 可获知 PTS和 RTP Timestamp之间的对应关系, 并将这一对应关 系放置 RTP流/ RTCP包中, 下发至终端。 终端利用广播节目的 PTS、 宽带节 目的 RTP Timestamp ^ RTP/RTCP包的 PTS和 RTP Timestamp之间的对应关系, 即可进^"节目流之间的切换、 同步、 快进快退等处理。
具体携带对应关系可以按以下方式进行实施,图 22为 RTP流 /RTCP包携 带对应关系的实施流程一示意图, 如图所示, 携带对应关系可以包括如下步 骤:
步骤 2201、 广播良务提供商确定广播节目 A存取单元的 PTS和 NPT之 间的对应关系;
步骤 2202、 广播服务提供商将广播节目 A发送至终端;
步骤 2203、 终端接收到广播节目 A媒体流时, 即可获得广播节目 A的
PES包的 PTS值;
步骤 2204、终端 居已经获得广播节目 A的 PES包的 PTS, 即可插值计 算获得节目 A各个存取单元 PTS值;
步驟 2205、广播服务提供商将广播节目 PTS和 1S1PT的对应关系发送到宽 带服务提供商;
步骤 220'6、宽带 务提供商获知宽带节目 B的 RTP Timestamp和 NPT之 间的对应关系;
步驟 2207、 根据步骤 2205和步骤 2206, 以 NPT为中间桥梁建立 RTP Timestam 和 RTP Timestamp之间的对应关系;
如:对应同一 NPT值的 RTP Timestamp和 PTS值为对应的 RTP Timestamp 和 PTS值; 如: 根据 RTP Timestamp ( x )、 RTP和 PT之间的对应关系即可 获得 PT ( X ); 根据 NPT ( X )、 NPT和 PTS的对应关系, 即可获得 PTS ( x ); 步骤 2208、 宽带服务提供商将 PTS和 RTP Timestamp的这一对应关系放 置到 RTP流中; 步骤 2209、 宽带节目 B下发至终端;
步骤 2210、终端接收到 RTP流后即可获知节目各 RTP包的 RTP Timestamp 及对应的 PTS值;
步骤 2211、 插值计算各存取单元的 RTP Timestamp及对应的 PTS值; 步骤 2212、 终端在相应的应用场景下进行需要的相应处理, 如: 快进快 退、 同步、 节目切换等处理。
对于步骤 2212中的各种操作具体可以按如下方式进行实施:
1、 同步处理:
终端根据获得宽带节目存取单元的 RTP Timestam 对应的 PTS值, 和广 播节目各存取单元的 PTS值进行比较, 相同则同步展现;
2、 组合处理:
在步骤 2208和步珮 2209之间, 添加如下处理:
终端获知节目的切换时间点为 PTS ( X );
终端在 PTS ( X )之前某一时刻, 加入组播组接收宽带节目 B;
在步骤 2212中, 当终端接收到组播组内的存取单元对应的 PTS值为 PTS ( X )时, 替代广播节目的 PTS ( X )标识的存取单元展现。
上述步驟为 RTP包中携带 RTP Timestamp和 PTS值之间的对应关系的情 况, 对于 RTCP包中携带 RTP Timestamp及对应的 PTS值时, 将步骤 2208变 为: 将对应关系放置到 RTCP包中, 在步骤 2209后添加: RTCP包携带 RTP Timestamp和 PTS之间的对应关系下发至终端即可。
图 23为 RTP流 /RTCP包携带对应关系的实施流程二示意图, 当用 RTCP 携带 PTS和 NPT之间的对应关系; RTSP携带 RTP Timestam 和 NPT之间的 对应关系; RTSP进行 RTP流的控制时, 如图所示, 携带对应关系可以包括如 下步骤:
步驟 2301、 广播服务提供商确定广播节目 A存取单元的 PTS和 PT之 间的对应关系;
步骤 2302、 广播服务提供商将广播节目 A发送至终端; 步骤 2303、 终端接收到广播节目 A媒体流时, 即可获得广播节目 A的 PES包的 PTS值;
步骤 2304、终端才艮据已经获得广播节目 A的 PES包的 PTS, 即可插值计 算获得节目 A各个存取单元 PTS值;
步骤 2305、广播服务提供商将广播节目 PTS和 NPT的对应关系发送到宽 带服务提供商;
步驟 2306、 宽带服务提供商将 PTS和 NPT的时间对应关系放置到 RTCP 包中;
步驟 2307、 宽带节目 B下发至终端;
步骤 2308、 RTSP控制 RTP流, 并携带 RTP Timestamp和 NPT之间的对 应关系及负荷类型;
步骤 2309、 RTCP中含有广播节目 PTS和 NPT之间的对应关系; 步驟 2310、 终端接收到 RTP流后, 根据步骤 2307、 步骤 2308获得的节 目存取单元的 RTP Timestamp、 f、 RTP Timestam 和 NPT之间的时间对应关 系, 可获知节目各 RTP包的 RTP Timestamp及对应的 PT值;
具体可按如下公式计算获得:
NPT (0 = PT (i-k) + (RTP (i) -RTP (i-k)) If,
步骤 2311、 终端根据步骤 2304、 步骤 2309获得的广播节目存取单元的 PTS、 PTS和 PT之间的对应关系, 可获知节目各存取单元对应的 NPT; 具体可按以下公式计算获得:
( )—
NPT (j) =NPT (j-k) + PTS(j + k)-PTS{j-k); 步骤 2312、 终端在相应的应用场景下进行需要的相应处理, 如: 快进快 退、 同步、 节目切换等处理。
对于步骤 2312中的各种操作具体可以按如下方式进行实施:
1、 同步处理:
终端根据获得宽带节目 B存取单元的 RTP Timestamp对应的 NPT值, 和 „
PC—T/CN2007觸 176 广播节目 A各存取单元的 PTS对应的 NPT值进行比较, 相同则同步展现。
2、 切换处理:
步骤 2306和步骤 2307之间, 添加如下处理:
终端获知节目的切换时间点为 PTS ( X );
终端在 PTS ( X )之前某一时刻, 加入组播组接收宽带节目 B;
在步骤 2312中, 才艮据步驟 2311可知 PTS ( x )对应 NPT ( x ); 当终端接 收到组播组内的存取单元对应的 PT值为 PT ( X )时,替代广播节目的 PTS ( X )标识的存取单元展现即可。
图 24为 RTP流 RTCP包携带对应关系的实施流程三示意图, 当用 RTCP 携带 PTS和 NTP之间的时间对应关系; RTCP SR携带 RTP Timestam 和 NIP 之间的时间对应关系时, 如图所示, 携带对应关系可以包括如下步骤:
步驟 2401、 广播服务提供商确定广播节目 A存取单元的 PTS和 PT之 间的对应关系;
步骤 2402、 广播月艮务提供商将广播节目 A发送至终端;
步骤 2403、 终端接收到广播节目 A 某体流时, 即可获得广播节目 A的 PES包的 PTS值;
步骤 2404、终端根据已经获得广播节目 A的 PES包的 PTS, 即可插值计 算获得节目 A各个存取单元 PTS值;
步骤 2405、广播服务提供商将广播节目 PTS和 NTP的对应关系发送到宽 带服务提供商;
步骤 2406、 确定宽带节目 RTP Timestam 和 NPT之间的对应关系, 以及 RTP Timestamp和 NTP之间的对应关系; 前者可以通过文件起始点所在 RTP 包的 RTP Timestamp 获知 RTP ( 0 ), 以及 RTP 包第一个存取单元的 RTP Timestamp及根据服务器端存储文件即可获知该存取单元相对于节目起始点 的位置, 即可获得其 PT值, 后者可以根据 RTP Timestam 时钟和 NTP Timestam 时钟的采样,即可获知 RTP Timestamp和 TP Timestamp之间的对 应关系。 由此即可获知节目的 NTP和 NPT之间的对应关系: NTP ( t ) = NPT N2007/003176
( t ) +NTP ( 0 );
步驟 2407、根据步骤 2405、 步驟 2406获知广播节目的 PTS和 PT之间 的对应关系、 NTP和 NPT之间的对应关系, 即可获知节目的 PTS (0)对应 的 NTP ( 0 ), 以及 PTS和 NTP之间的对应关系。
步骤 2408、 将 PTS和 NTP之间的对应关系放置 RTCP包中;
步驟 2409、 宽带节目下发至终端;
步骤 2410、 RTCP控制 RTP流, 并携带 RTP Timestamp和 NTP之间的对 应关系及广播节目 PTS和 NTP之间的对应关系;
步驟 2411、 终端接收到 RTP流后, 根据步骤 2409、 步骤 2410获得的节 目存取单元的 RTP Timestamp、 f、 RTP Timestamp和 NTP之间的时间对应关 系, 可获知节目各 RTP包的 RTP Timestamp及对应的 NTP值;
具体可按以下公式计算:
NTP (i) =NTP (i-k) + (RTP (i) -RTP (i-k)) /f;
步骤 2412、 终端根据步骤 2404、 步骤 2410获得的广播节目存取单元的 PTS、 PTS和 NTP之间的对应关系, 可获知节目各存取单元对应的 NPT; 具体可按以下公式计算: '
„ -WN j +NTP"
NTP (j) =NTP (j-k) + PTSU + k)-PTS(j-k) . 步驟 2413、 终端在相应的应用场景下进行相应的处理, 如: 快进快退、 同步、 节目切换。
对于步骤 2413中的各种操作具体可以按如下方式进行实施:
1、 同步处理:
终端根据获得宽带节目存取单元的 RTP Timestamp对应的 NTP值, 和广 播节目各存取单元的 PTS对应的 NTP值进行比较, 相同则同步展现。
2、 切换处理:
在步骤 2406和步驟 2407之间, 添加以下处理:
终端获知节目的切换时间点为 PTS (X); 003176 终端在 PTS (x)之前某一时刻, 加入组播组接 宽带节目 B;
在步骤 2413中, 才艮据步骤 2412可知 PTS ( x )对应 NTP ( x ); 当终端接 收到组播组内的存取单元对应的 NTP值为 NTP ( X )时, 替代广播节目的 PTS (X)标识的存取单元展现。
图 25为第二实施例携带对应关系的系统架构四示意图, 如图所示, 在广 播服务提供商的服务器上需要有 STC时钟和 NTP Timestamp时钟, 并对这两 时钟同时采样可获得 PTS和 NTP之间的对应关系, 广播服务提供商已知节目 的 PTS和 NPT之间的对应关系, 当 NPT = 0处, 即可获知对应的 PTS ( 0 ) 及对应的 NTP ( 0 )。 将 NTP ( 0 )及 PTS和 NTP之间的对应关系发送至宽带 服务提供商, 宽带服务提供商将这一对应关系放置到 RTCP包中传输到终端。 终端根据 TS 中的 PTS、 RTP 中的 RTP Timestamp 以及 RTCP SR中 RTP Timestamp和 NTP Timestamp之间的对应关系,以及 RTCP包中的 PTS和 NTP Timestamp之间的对应关系, 即可将 PTS 转换为 NTP Timestamp, RTP Timestam 值转换为 NTP Timestamp后进行处理。
具体携带对应关系可以按以下方式进行实施,图 26为 RTP流 /RTCP包携 带对应关系的实施流程四示意图, 如图所示, 携带对应关系可以包括如下步 骤:
步骤 2601、 广播服务提供商确定广播节目 A的起始 PTS, 以及 PTS和 NPT之间的时间对应关系;
步驟 2602、 广播服务提供商对 STC和 NTP时钟釆样, 获得 PTS和 NTP 的对应关系;
步骤 2603、 根据步驟 2602查找到 PTS ( 0 )对应的 NTP ( 0 );
由于 (PTS (t) -PTS (0)) /f=NTP (t) -NTP (0), 所以根据任意一 对的 PTS (t)和 NTP (t)即可获得 PTS (0)对应的 NTP (0);
或者,
根据 PTS (t) -PTS (0) = (NTP (t) -NTP (0)) * (PTS (t) -PTS (t-x)) / (NTP (t) -NTP (t-x)), 及两对 PTS (t)及对应的 PTS (t)和 PTS ( t-x )及对应的 NTP ( t-x ) 即可计算处 PTS ( 0 )对应的 NTP ( 0 );
步骤 2604、 广播服务提供商将广播节目 A发送至终端;
步骤 2605、终端接收到广播节目 A媒体流时,即可获得广播节目 A的 PES 包的 PTS值;
步骤 2606、 终端根据已经获得广播节目 A的 PES包的 PTS, 即可通过 插值计算获得节目 A各个存取单元 FTS值;
步骤 2607、发送广播节目 A的起始 TP ( 0 )及 PTS和 NTP之间的对应 关系至宽带服务提供商;
步骤 2608、 宽带服务提供商确定宽带节目 B的起始播放时间需要为 NTP (0);
步骤 2609、宽带服务提供商将 PTS和 NTP之间的时间对应关系放置 RTCP 包中;
步骤 2610、 将宽带节目 B发送到组播组;
步骤 2611、 RTCP控制 RTP流, 并携带 RTP Timestamp和 NTP之间的对 应关系及广播节目 PTS和 NTP之间的对应关系;
步骤 2612、 终端加入组播组接收 RTP流及 RTCP包;
步骤 2613、 终端接收到 RTP流及对应的 RTCP包后, 根据步骤 2610、 步 骤 2611获得的节目存取单元的 RTP Timestamp, f、 RTP Timestamp和 NTP之 间的时间对应关系,可获知节目各 RTP包的 RTP Timestam 及对应的 NTP值; 具体计算公式可以为:
NTP (i) =NTP (i-k) + (RTP (i) -RTP (i-k)) /f;
步骤 2614、 终端根据步骤 2606、 步骤 2612获得的广播节目存取单元的 PTS、 PTS和 NTP之间的对应关系, 可获知节目各存取单元对应的 NTP; 具体计算公式可以为:
NTP (j) =NTP (j-k) + PTS(j + k)-PTSO-k) .
或者, 03176
NTP ( j ) = NTP ( j-k ) + ( PTSU) - PTS(j - k) ) /f, 其中的 f为 STC时钟 的频率的 300分之一。
步骤 2615、 终端在相应的应用场景下进行所需的相应处理, 如: 同步、 节目切换处理。
对于步驟 2615中的各种操作具体可以按如下方式进行实施:
1、 同步处理:
终端根据获得宽带节目存取单元的 RTP Timestamp对应的 NTP值, 和广 播节目各存取单元的 PTS对应的 NTP值进行比较, 相同则同步展现。
2、 切换处理:
在步骤 2609和步骤 2610之间, 添加如下处理:
终端获知节目的切换时间点为 PTS ( X );
终端在 PTS ( X )之前某一时刻, 加入組播组接收宽带节目 B;
在步骤 2615中, 根据步骤 2614可知 PTS ( x )对应 NTP ( x ); 当终端接 收到组播组内的存取单元对应的 NTP值为 NTP ( X )时,替代广播节目的 PTS ( X )标识的存取单元展现。
下面对在 RTP流 /RTCP包中携带时间对应关系的方式进行说明。
即: 对于上述实施例中的步驟 2208、 步骤 2306、 步骤 2609所提到的: 将 PTS和 NTP之间的时间对应关系放置 RTCP包中, 具体可以按以下方式实 施;
一、 在 RTP流携带时间对应关系 /节目起始时间点。
图 27为 RTP包头结构示意图, 如图所示, 对应关系 /节目起始时间点可 以在 RTP包头的扩展包头内放置。 当 RTP包头中的 X位置为 1时, RTP包头 后面 CSRC列表后即为 Head Extension字段, 其中, "defined by profile" 为特 定的 16位置,表明后续的 header extension字段携带 PTS值或节目的初始 PTS 信息。
图 28为 RTP包结构示意图, 放置的信息如图所示, original network id、 transport id service id, event id为唯一的标识事件的标识符, 表明该广播事件 的 PTS值对应该 RTP包的 RTP Timestamp, 或 PTS ( 0 );
S比特位置标识携带的为节 S的起始 PTS时间,还是该 RTP包携带的 RTP Timestamp时间戳,不妨设 S = 1则为 PTS( 0 ), S = 1则 PTS为 RTP Timestamp 对应的 PTS值;
最后的 33位的 PTS时间戳位 PTS ( 0 )或者和该 RTP Timestamp对应的 PTS值。
二、 在 RTCP SR包中放置时间对应关系。
图 29 为 RTCP SR 包结构示意图, 如图所示, 在 RTCP SR 包中的 profile-specific extensions部分扩展来描述广播节目的初始 PTS ( 0 )或和该 SR 包 NTP Timestam 对应的广播节目的 PTS时间戳。 其中, 16比特的 type用于 描述后续的字段用来描迷时间对应关系;
original network id、 transport id、 service id、 event id为唯一的标识事件的 标识符, 表明该广播事件的 PTS值对应该 RTP包的 RTP Timestamp, 或该广 播节目的 PTS ( 0 );
S比特位置标识携带的为节目的起始 PTS时间,还是该 RTCP SR包携带的 RTP Timestam 及 NTP Timestam 时间戳对应的 PTS值;
最后的 33位的 PTS时间戳为 PTS ( 0 )或者和该 RTP Timestamp及 NTP Timestamp时间戳对应的 PTS值。
三、 在 RTCP SDES中放置时间对应关系:
图 30为 RTCP SDES包结构示意图, 如图所示, 时间对应关系信息可以放 置在 SDES的 PRIV SDES items的 value string中,此时的 SDES items中的 type 为 8, prefix string为 time mapping info。其中 , original network id、 transport id、 service id, event id为唯一的标识事件的标识符, 表明该广播事件 PTS ( 0 )或 该广播节目相关的 PTS和 RTP Timestamp的对应关系; 该项可选。
S比特位置标识携带的为节目的起始 PTS时间、 还是时间对应关系; 设 S = 1时, 表示后面为 PTS ( 0 ), S = 0时, 表示后面为 PTS和 NTP/RTP的时间 T N2007/003176 对应关系;
T比特位在 S比特位标识位时间对应关系时有效, 即 s = o时。 该位标识
PTS对应的时间位 RTP Timestamp还是 NTP Timestamp; 设 S = 1时, 为 RTP Timestamp; S = 0时, 为 NTP Timestamp;
最后的 33位的 PTS时间戳为 PTS ( 0 )或者最后所有的数据描述一一对应 的 PTS ( 33位)和 RTP Timestamp ( 32位) /NTP Timestamp ( 64位)。
四、 在 APP: Application-Defined RTCP Packet中放置时间对应关系。
图 31为 APP: Application-Defined RTCP Packet包头结构示意图,如图所示, 对应关系放置在 application-dependent data部分, 且 name ( ASCII ) 为标准组 织承认的 Time Mappint Info。
图 32为 APP: Application-Defined RTCP Packet包结构示意图,放置的信息 ^口图所示, original network id, transport id、 service id、 event id为唯一的标只 事件的标识符, 表明该广播事件 PTS ( 0 )或该广播节目相关的 PTS和 RTP Timestamp的对应关系, 该项可选。
S比特位置标识携带的为节目的起始 PTS时间, 还是时间对应关系; 设 S = 1时, 表示后面为 PTS ( 0 ), S = 0时, 表示后面为 PTS和 NTP RTP的时间 对应关系;
T比特位在 S比特位标识位时间对应关系时有效, 即 s = o时。 该位标识
PTS对应的时间位 RTP Timestamp还是 NTP Timestamp; 设 S = 1时, 为 RTP Timestamp; S = 0时, 为 NTP Timestamp;
最后的 33位的 PTS时间戳为 PTS ( 0 )或者最后所有的数据描述一一对应 的 PTS ( 33位) 和 RTP Timestamp ( 32位) /NTP Timestamp ( 64位)。
第三实施例
本实施例以时间映射服务器承载对应关系为例来说明。 本实施例的目的在 于说明对应关系的产生以及发送并不仅限于由现有的实体来完成, 它也可以 由专有的、 新增的实体来进行。
图 33 为第三实施例利用映射服务器承载对应关系的系统架构示意图, 如 图所示, 架构中包括广播服务提供商、 宽带服务提供商、 时间映射服务器、 终端, 下面对各实体介绍如下:
( 1 ) 广播服务提供商: 用于将广播节目的时间对应关系告知时间映射服 务器; 用 TS协议封装广播节目, 并通过 DVB S/T/C发至终端;
根据需要也可以和宽带服务提供商协商广播节目的绝对起始时间点;
( 2 ) 宽带服务提供商: 用于利用 RTP协议封装 A/V, 发送宽带节目至终 端;
使用 RTSP或 RTCP控制 RTP流的传输,并携带 RTP Timestamp和 NTP/NPT 之间的对应关系至终端;
根据需要也可以将宽带节目的时间对应关系告知时间映射服务器, 和宽带 服务提供商协商广播节目的绝对起始时间点;
( 3 ) 时间映射服务器: 用于接收广播服务提供商广播节目的时间对应关 系;
向终端提供广播节目的时间对应关系和 /或宽带节目的时间对应关系; 根据需要也可以接收宽带节目服务提供商宽带节目的时间对应关系;
( 4 ) 终端: 用于接收广播节目与接收宽带节目;
向时间映射服务器请求下发时间映射关系;
根据节目的时间戳、 时间映射关系, 进行相应的处理。
图 34为利用映射服务器承载对应关系的实施流程一示意图, 如图所示, 当时间对应关系为 PTS和 NTP时间对应关系时, 广播服务提供商和宽带服务 提供商之间从节目起始时间点开始协商, 并且 RTP流使用 RTCP进行控制。 则可以按如下步骤实施:
步骤 3401、 广播服务提供商确定节目的起始时间点 PTS ( 0 );
步骤 3402、 广播服务提供商对 STC和 NTP时钟进行釆样, 获得 PTS和 NTP的时间对应关系;
步骤 3403、 根据步骤 3401和步骤 3402获得的时间点以及对应关系计算 获得节目的起始 NTP ( 0 ); T N2007/003176 由于(PTS (t) -PTS (0)) /f=NTP (t) -NTP (0), 则根据任意一对 的 PTS (t)和 NTP (t) 即可获得 PTS (0)对应的 NTP (0);
或者根据 PTS (t) -PTS (0) = ( TP ( t ) - NTP ( 0 ) ) * ( PTS ( t ) -PTS (t-x)) I (NTP (t) -NTP (t-x)), 及两对 PTS (t)及对应的 PTS (t) 和 PTS (t-x)及对应的 NTP (t-x) 即可计算处 PTS (0)对应的 NTP (0);
步骤 3404、 广播服务提供商告知宽带服务提供商广播节目 A的起始时间 点为 NTP (0);
步驟 3405、宽带服务提供商将宽带节目 B的起始帧的 NTP定为 NTP( 0 ); 步骤 3406、 广播服务提供商将广播节目的时间对应关系 (PTS和 NTP) 发送至时间映射服务器;
步骤 3407、 时间映射服务器保存广播节目的时间映射关系;
步骤 3408、广播服务提供商 TS协议封装广播节目 A后,使用 DVB S/C/T 协议发送到终端; '
步驟 3409、 终端获知广播节目的 PES包的 PTS值;
步驟 3410、 终端插值计算获得各个存取单元的 FTS;
步骤 3411、 终端向时间服务器请求下发广播节目 A的时间对应关系 (同 步应用场景), 或某一点的时间对应关系 (节目切换应用场景);
步驟 3412、 时间映射服务器相应请求, 下发广播节目 A的时间对应关系 (同步应用场景), 或某一点对应的时间 (节目切换应用场景);
步骤 3413、 计算广播节目 A各个存取单元 PTS对应的 NTP时间戳; 步骤 3414、宽带服务提供商在服务器端,使用 RTP协议封装宽带节目 B, 使用 RTP over UDP/TCP over IP发送到组播组;
步骤 3415、 宽带节目 B相关的 RTCP包下发至组播組;
步骤.3416、 终端加入组播组接收宽带节目 B及 RTCP控制包;
步驟 3417、 终端根据步骤 3415中各存取单元的 RTPTimestamp、 及步骤 3416所知的 RTPTimestamp和 NTP之间的对应关系,计算处各个存取单元的 NTP值; „ ―
PCT/CN2007觸 176 步赛 3418、 终端在相应的应用场景下进行相应的处理, 如: 快进快退、 同步、 节目切换。
对于步骤 3418中的各种操作具体可以按如下方式进行实施:
1、 同步处理:
终端根据获得宽带节目存取单元的 RTP Timestam 对应的 PTS值, 和广 播节目各存取单元的 PTS值进行比较, 相同则同步展现;
2、 切换处理:
在步骤 3410、 步骤 3411之间加入如下处理: 终端手动或自动进行节目的 切换, 并获知节目的切换点为 PTS ( X );
根据步骤 3411、 步骤 3412获取的对应关系, 查询 PTS ( x )对应的 NTP ( x );
具体实施中, 可以考虑到网络延时, 则在切换点之前的某一时刻进行时 间点对应 NTP时间的查询;
在步驟 3418中,当终端接收到組播组内的存取单元对应的 NTP值为 NTP ( X )时, 替代广播节目的 PTS ( X )标识的存取单元展现。 终端展现广播节 目; 播放宽带节目。
实施例三的第一流程, 也可以变为广播服务提供商向时间映射服务器发 送 PTS和 NPT之间的对应关系, 宽带节目使用 RTSP进行控制, 则终端根据 广播节目的 PTS、从时间映射服务器上请求获得的广播节目 PTS和 PT之间 的映射关系 /某一点的对应时间、 宽带节目的 RTP Timestamp, RTSP的 RTP Timestamp和 NPT之间的对应关系进行计算后, 进行同步、 切换或组合展现 等处理。
图 35为利用映射服务器承载对应关系的实施流程二示意图, 流程二中宽 带服务提供商告知时间映射服务器其时间对应关系。 RT 流使用 RTCP协议 控制。
流程二和流程一的不同之处在于服务器间的交互不同, 流程二中: 广播服务提供商提供给时间映射服务器的为广播节目的 PTS和 NPT之间 的映射关系;
宽带服务提供商提供给时间映射服务器的为宽带节目的 RTP Timestamp 和 NPT时间之间的映射关系及 NTP ( 0 );
没有广播服务提供商和宽带服务提供商之间的交互;
时间映射服务器根据广播节目 A的 PTS和 NPT之间的映射关系,以及宽 带节目 B的 NTP ( 0 ), 荻知 PTS和 NTP之间的时间映射关系。
如: 原有的 PTS (t) =PTS (0) +NPT (t) *f; 变为 PTS (t) = (PTS (0) -NTP (0) *f) +NTP (t) *f;
原有的 PTS ( t )对应 PT ( t ), 现在变为 PTS ( t )对应 NTP ( t ) (其中 的 NTP (t) =NPT (t) +NTP (0));
则如图所示, 可以按如下步骤实施:
步骤 3501、 广播月良务提供商确定节目的起始时间点 PTS ( 0 )及 PTS和 PT之间的时间对应关系;
步驟 3502、广播服务提供商将广播节目的 PTS和 NPT对应关系发送至时 间映射服务器;
步骤 3503、 时间映射服务器保存广播节目的时间映射关系;
步骤 3504、广播服务提供商用 TS协议封装广播节目 A后,使用 DVB S/C/T 协议发送到终端;
步骤 3505、 终端获知广播节目的 PES包的 PTS值;
步骤 3506、 终端插值计算获得各个存取单元的 PTS;
步骤 3507、 终端向时间映射服务器请求下发广播节目 A的时间对应关系 (同步应用场景), 或某一点的时间对应关系 (节目切换应用场景);
步骤 3508、时间映射服务器响应请求,下发广播节目的时间对应关系 (同 步应用场景), 或某一点对应的时间 (节目切换应用场景);
步驟 3509、 计算广播节目 A各个存取单元 PTS对应的 NPT时间戳(同 步应用场景);
步骤 3510、 终端请求下发宽带节目 B, 起始时间点为请求时刻 PTS或某 一特殊 PTS值对应的 NPT;
步骤 3511、 宽带节目 B下发至终端;
. 步骤 3512、 RTSP控制宽带节目 B , 并携带 RTP Timestamp和 NPT之间 的对应关系至终端;
步骤 3513、 终端根据步骤 3515中各存取单元的 RTPTimestamp、 及步骤 3515所知的 RTP Timestamp和 PT之间的对应关系, 计算处各个存取单元的 PT值;
具体计算公式可以为: NPT (i) =NPT (i-k) + (RTP (i) -RTP (i-k)) /f; f为负荷类型对应的采样频率;
步骤 3514、 终端在相应的应用场景下进行相应的处理, 如: 快进快退、 同步、 节目切换。
对于步骤 3514中的各种操作具体可以按如下方式进行实施:
1、 同步处理:
终端根据获得宽带节目存取单元的 RTP Timestamp对应的 NPT值, 和广 播节目各存取单元 PTS对应的 NPT值进行比较, 相同则同步展现;
.2、 快进快退处理:
在步骤 3507为请求暂停、快进快退点处存取单元的 PTS ( X )对应的 NPT 值;
在步骤 3508为响应下发 PTS (X)对应的 PT (x)值;
可以省略步錄 3509;
在步骤 3514中在 PTS (X)点停止广播节目的播放, 进行宽带节目的播 放;
实际过程中, 可以留有时间余量进行请求响应。
3、 切换处理:
在步骤 3506和步練 3507之间加上如下处理:
终端已知切换时间点为 PTS (x);
在步骤 3507中请求 PTS ( X )对应的 NPT ( x ); 在步驟 3508中响应 PTS (x)对应的 NTP (x)值;
在步骤 3510中终端请求从 PT (X) 点开始播放宽带节目 B;
在步骤 3514 中, 在 PTS (X) 点停止广播节目的播放, 进行宽带节目的 播放;
实际实现的过程中, 考虑到网络延时, 可以在切换点之前的某一时刻进 行时间点对应 NTP时间的查询, 和请求下发宽带节目;
图 36为利用映射月 I务器承载对应关系的实施流程三示意图, 如图所示, 当时间对应关系为 PTS和 RTP Timestamp时间对应关系时, 宽带服务提供商 告知时间映射服务器宽带节目的时间映射关系, 并对 RTP 流使用 RTCP 或 RTSP进行控制。 则可以按如下步驟实施:
步驟 3601、广播服务提供商确定节目的 PTS和 NPT之间的时间对应关系; 步驟 3602、广播服务提供商将广播节目 A的时间对应关系( PTS和 PT ) 发送至时间映射服务器;
步骤 3603、 时间映射服务器保存广播节目 A的时间映射关系;
步骤 3604、 宽带服务提供商将宽带节目 B 的时间对应关系 (RTP Timestamp和 NPT )发送至时间映射服务器;
步據 3605、 时间映射服务器保存宽带节目 B的时间映射关系;
步骤 3606、以 NPT为中间桥梁计算出 PTS和 RTP Timestamp的对应关系; 例如: 原有的 RTP Timestam 和 NPT之间的对应关系为: ( RTP ( t ) - RTP (0)) /fl =NPT (t), 原有的 PTS和 PT之间的对应关系为 (PTS (t) — PTS (0)) /f2 = NPT (t); 变为 (RTP (t) —RTP (0)) /f 1 = (PTS (t) - PTS (0)) /f2, 其中 fl 为宽带节目 B 的负荷采样频率, RTP (0) 可以根据 NPT =0获知, 为 STC采样频率的 300分之一, PTS ( 0 ) 可以根据 PT = 0获知
步骤 3607、广播良务提供商以 TS协议封装广播节目 A后,使用 DVB S/C/T 协议发送到终端;
步骤 3608、 终端获知广播节目 A的 PES包的 PTS值; 03176 步骤 3609、 终端插值计算获得各个存取单元的 PTS;
步骤 3610、 终端向时间服务器请求下发广播节目 A的时间对应关系 (同 步应用场景), 或某一点的时间对应关系 (节目切换应用场景);
步骤 3611、 时间映射服务器响应请求, 下发广播节目 A的时间对应关系 (同步应用场景), 或某一点对应的时间 (节目切换应用场景);
步骤 3612、 宽带节目 B下发至终端;
步骤 3613、 RTSP控制宽带节目 B, 并携带 RTP Timestamp和 PT之间 的对应关系至终端;或 RTCP控制宽带节目 B,并携带 RTP Timestamp和 NTP 之间的对应关系至终端;
步骤 3614、 终端根据步骤 3615中各存取单元的 RTPTimestamp、 及步骤 3611所获知的 RTP Timestamp和 PTS之间的对应关系, 计算处各个存取单元 的 PTS值;
具体的计算公式可以为: PTS(i) = PTS( i-k )+(RTP( i ) - RTP( i-k ))*( PTS (i+k) -PTS (i-k) )/(RTP (i+k) -RTP (i-k) );
或者,
PTS (i) =PTS (i-k) + (RTP (i) -RTP (i-k) )*腦;
步骤 3615、 终端在相应的应用场景下进行相应的处理, 如: 快进快退、 同步、 节目切换。
对于步骤 3615中的各种搡作具体可以按如下方式进行实施:
1、 同步处理:
终端根据获得宽带节目存取单元的 RTP Timestamp对应的 PTS值, 和广 播节目各存取单元 PTS进行比较, 相同则同步展现。
1、 切换处理:
在步骤 3609和步骤 3610之间加上: 终端已知切换时间点为 PTS (x); 在步骤 3609中 , 请求 PTS ( X )对应的 RTP ( x );
在步骤 3610中, 响应 PTS ( X )对应的 RTP ( X )值;
在步骤 3615中, 根据步骤 3614的结果获得宽带节目的 RTP Timestamp 对应的 PTS值为 PTS ( x ) 时, 在该 PTS ( x ) 点停止广播节目的播放, 进行 宽带节目的播放。
本发明实施例还提供了一种媒体流发送系统, 下面结合附图对本系统的 具体实施方式进行说明。
在媒体流发送系统中, 包括向终端发送笫一媒体流的第一媒体流服务器、 向终端发送第二媒体流的第二媒体流服务器, 还包括对应关系放置模块, 用 于在第一媒体流服务器向终端发送的第一媒体流、 和 /或第二媒体流服务器向 终端发送的第二媒体流中放置对应关系信息, 所述对应关系包括: 第一媒体 流数据包笫一时间信息与第一显示时间的第一对应关系、 第二媒体流数据包 第二时间信息与第二显示时间的第二对应关系。
系统实施中, 可以从时间对应关系源来获取 PTS和 NPT之间的对应关系 或 PTS ( 0 )。
下面对系统的具体实施进行说明。
图 37为发送系统一结构示意图, 如图所示, 系统中的对应关系放置模块 包括第一放置单元、 第二放置单元, 图中广播服务提供商作为第一媒体流服 务器, 宽带服务提供商作为第二媒体流服务器, 则易知, 第一放置单元位于 广播服务提供商侧, 第二放置单元位于宽带服务提供商侧, 其中:
第一放置单元, 用于在第一媒体流中放置第一媒体流数据包第一时间信 息与第一显示时间的第一对应关系信息;
第二放置单元, 用于在笫二媒体流中放置第二媒体流数据包第二时间信 息与第二显示时间的第二对应关系信息。
所述第一放置单元还可以包括第一子单元、 第二子单元、 第三子单元之 一或者其组合, 其功能分别为:
第一子单元, 用于将第一对应关系信息放置在笫一媒体流的分組基本流 包头中; '
第二子单元, 用于将所述第一对应关系信息放置在第一媒体流的传输流 事件信息表中; 07 003176 笫三子单元, 用于将所述第一对应关系信息放置在第一媒体流新建的时 间映射关系表中。
图 38为发送系统二结构示意图, 如图所示, 系统中的对应关系放置模块 包括传输单元、 第三放置单元, 图中广播服务提供商作为第一媒体流服务器, 宽带服务提供商作为第二媒体流服务器, 其中:
传输单元与广播服务提供商、 宽带服务提供商相连, 用于从作为第一媒 体流服务器的广播服务提供商获取第一媒体流数据包第一时间信息与第一显 示时间的第一对应关系信息, 并传输至位于宽带服务提供商侧的笫三放置单 元; 第三放置单元将第一媒体流的第一时间对应关系信息、 第二媒体流数据 包第二时间信息与第二显示时间的第二对应关系信息放置到第二媒体流中。
图 39为发送系统三结构示意图, 如图所示, 系统中的对应关系放置模块 包括发送单元、 第二放置单元、 映射服务器, 图中广播服务提供商作为第一 媒体流服务器, 宽带服务提供商作为第二媒体流服务器, 发送单元与映射服 务器、 广播服务提供商相连, 第二放置单元在作为第二媒体流服务器的宽带 服务提供商侧, 映射服务器与终端相连, 其中:
发送单元, 用于将笫一媒体流数据包第一时间信息与第一显示时间的第 一对应关系信息发送至映射服务器;
第二放置单元, 用于在第二媒体流中放置第二媒体流数据包第二时间信 息与第二显示时间的第二对应关系信息;
映射服务器, 用于将第一对应关系信息发送至终端。
在上述发送系统中, 还可以在终端中进一步包括对应关系处理模块, 用 于根据接收到的对应关系, 在时间信息对应的第一显示时间与第二显示时间 差小于阈值时,,对第一媒体流数据包与第二媒体流数据包进行处理。
具体的, 对应关系处理模块可以包括同步处理单元、 第一切换单元、 第 二切换单元之一, 其中:
同步处理单元, 用于在第一显示时间和笫二显示时间相同或相差小于阈 值时, 同时展现第一显示时间标识的第一媒体流的数据包和第二显示时间标 识的第二媒体流的数据包;
第一切换单元, 用于在第一显示时间和第二显示时间相同或相差小于阈 值时, 切换第一显示时间标识的第一媒体流的数据包成第二显示时间标识的 第二媒体流的数据包;
第二切换单元, 用于在第一显示时间和第二显示时间相同或相差小于阈 值时, 切换第二显示时间标识的第二媒体流的数据包成第一显示时间标识的 第一媒体流的数据包。
现代以及未来社会中, 技术的进步和用户的需求促进了流媒体应用的迅 速发展。 在远程教育、 数字图书馆、 电子商务、 视频点播、 交互电视、 远程 医疗、 网络音 /视频、 实时多媒体会议等方面, 流媒体技术都起到很重要的作 用。 随着流媒体应用的不断普及, 流媒体技术及其应用必然会发挥更重要的 作用, 并将深刻的改变人们的生活方式。 因此, 通过本发明实施例解决的不 同媒体流之间的同步问题具有重要的运用价值与意义。
显然, 本领域的技术人员可以对本发明进行各种改动和变型而不脱离本 发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权利要 求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在内。

Claims

权 利 要 求
1、 一种不同媒体流间的同步方法, 其特征在于, 包括如下步驟: 建立第一媒体流数据包第一时间信息与第一显示时间的第一对应关系; 建立第二媒体流数据包第二时间信息与第二显示时间的第二对应关系; 根据所述第一对应关系和第二对应关系, 在第一显示时间与笫二显示时 间差小于阈值时, 将第一媒体流数据包与第二媒体流数据包同时显示。
2、 如权利要求 1所述的方法, 其特征在于, 当所述第一媒体流是传输流 时, 所述第一时间信息^ L现时间戳, 所述第一显示时间是正常播放时间; 当所述第二媒体流是实时传输协议流时, 所述第二时间信息是实时传输 协议时间戳, 所述第二显示时间是正常播放时间。
3、 如权利要求 2所述的方法, 其特征在于, 在任一时间 t时, 所述第一 对应关系是:
根据 t时刻的展现时间戳、在 EIT表中添加节目的起始存储单元的展现时 间戳、 传输流系统时钟频率, 建立展现时间戳与正常播放时间的对应关系; 或,
根据 t时刻的展现时间戳、节目起始存储单元的展现时间戳、传输流系统 时钟频率, 建立展现时间戳与正常播放时间的对应关系;
或,
根据唯一标识节目表的展现时间戳和节目播放相对时间的正常播放时间 对应表、 以及 t时刻的展现时间戳、 上述表中离 t时刻最近的时刻的展现时间 戳、上述表中离 t时刻最近的时刻展现时间戳的正常播放时间、传输流系统时 钟频率, 建立展现时间戳与正常播放时间的对应关系;
通过在扩展分组基本流包头加入正常播放时间戳, 建立展现时间戳与正 常播放时间的对应关系。
4、 如权利要求 3所述的方法, 其特征在于, 在任一时间 t时, 所述第一 对应关系是:
PT ( t ) = ( PTS(t)-StartAU_PTS ) *n/fl ,
其中: NPT ( t )是 t时刻的正常播放时间, PTS(t)是 t时刻的展现时间戳,' StartAU一 PTS是通过在 EIT表中添加节目的起始存储单元的展现时间戳, fl 是传输流系统时钟频率;
或,
NPT ( t ) = ( PTS(t)-PTS ( 0 ) ) *n/fl ,
其中: NPT ( t )是 t时'刻的正常播放时间, PTS(t)是 t时刻的展现时间戳, PTS ( 0 )是节目起始存储单元的展现时间戳, fl是传输流系统时钟频率; 或,
根据唯一标识节目表的展现时间戳和节目播放相对时间的正常播放时间 对应表,按公式: PT(PTS(t) =(PTS(t) - PTS(i))*n/fl + NPT (PTS(i))得出的 PTS 对应的 NPT时间, "
其中: NPT(PTS(t))是 t时刻展现时间戳的正常播放时间, PTS(t)是 t时刻 的展现时间戳, PTS(i))是离 t时刻最近的 i时刻的展现时间戳, NPT(PTS(i)) 是离 t时刻最近的 i时刻展现时间戳的正常播放时间, fl是传输流系统时钟频 率。
5、 如权利要求 2所述的方法, 其特征在于, 在任一时间 j时, 所述第二 对应关系是根据 j时刻的实时传输协议包时间戳、实时传输协议流中媒体的采 样频率、 同一次请求响应后位于 k时刻的实时传输协议包时间戳、 同一次请 求响应后位于 k时刻的实时传输协议包的正常播放时间, 建立实时传输协议 时间戳与正常 4番放时间的对应关系, 其中, k时刻为位于 j时刻之前的时刻。
6、 如权利要求 5所述的方法, 其特征在于, 在任一时间 j时, 所述第二 对应关系是: NPT ( RTP(j) ) : (RTP timestampG) - RTP timestamp(k)) I f2 + NPT ( RTP(k) );
其中: NPT ( RTPG) )是实时传输协议包 j 时刻的正常播放时间, RTP timestamp(i)是 j时刻的实时传输协议包时间戳, RTP timestamp(k)是同一次请 求响应后位于 k时刻的实时传输协议包时间戳, f2是实时传输协议流中媒体 的采样频率; NPT ( TP(k) )同一次请求响应后位于 k时刻的实时传输协议包 的正常播放时间。
7、 如权利要求 5所述的方法, 其特征在于, 所述实时传输协议包时间戳 是根据 RTSP实时流协议 PLAY response中的 Range header和 RTP-Info header 获取的。
8、 如权利要求 2所述的方法, 其特征在于, 在任一时间 j时, 所述第二 对应关系是在根据 j时刻的实时传输协议包时间戳、 离 j时刻最近的 k时刻的 实时传输协议包时间戳、 离 j时刻最近的 k时刻网络时间协议的时间、 实时传 输协议流中媒体的采样频率得出 j时刻网络时间协议的时间后,根据起始时刻 网络时间协议的时间、 j时刻网络时间协议的时间得出实时传输协议流包的正 常播放时间。
9、 如权利要求 8所述的方法, 其特征在于, 在任一时间 j时, 所述第二 对应关系是在按公式: NTP(j)-(RTP(j)-RTP(k))*n/f2 + NTP(k)得出 NTP①后, 根据 PT(RTP(j)) = NTP(j)-NTP(0)得出实时传输协议流包的 NPT时间;
其中: NTP(j)是 j时刻网络时间协议的时间, RTP(j)是 j时刻的实时传输 协议包时间戳, RTP(k)是 k时刻的实时传输协议包时间戳, NTP(k)是 k时刻 网络时间协议的时间, NTP(O) 是起始时刻网络时间协议的时间, NPT(RTP①) 是实时传输协议包 j时刻的正常播放时间, £2是实时传输协议流中媒体的采样 频率。
10、 如权利要求 8所述的方法, 其特征在于, 所述实时传输协议包时间 戳与所述网络时间协议的时间是通过实时传输控制协议发送方报告包头获取 的。 -
11、 一种不同媒体流间的同步系统, 其特征在于, 包括:
第一对应模块, 用于建立第一媒体流数据包第一时间信息与第一显示时 间的第一对应关系;
第二对应模块, 用于建立第二媒体流数据包第二时间信息与第二显示时 间的第二对应关系;
显示模块, 用于才 居所述对应关系, 在时间信息对应的第一显示时间与 第二显示时间差小于阔值时, 将笫一媒体流数据包与第二媒体流数据包同时 显示。
12、 如权利要求 11所述的同步系统, 其特征在于, 当所述第一媒体流是 传输流时, 所述第一时间信息是展现时间戳, 所述第一显示时间是正常播放 时间; 当所述第二媒体流是实时传输协议流时, 所述第二时间信息是实时传 输协议时间戳, 所述第二显示时间是正常播放时间; 在任一时间 t时, 所述第 —对应模块:
按 NPT ( t ) = ( PTS(t)-StartAU_PTS ) *n/fl建立所述第一对应关系, 其中: NPT ( t )是 t时刻的正常播放时间, PTS(t)是 t时刻的展现时间戳,
StartAU— PTS是通过在 EIT表中添加节目的起始存储单元的展现时间戳, fl 是传输流系统时钟频率;
或,
按 NPT ( t ) = ( PTS(t)-PTS ( 0 ) ) *n/fl建立所述第一对应关系, 其中: NPT ( t )是 t时刻的正常播放时间, PTS(t)是 t时刻的展现时间戳, PTS ( 0 )是节目起始存储单元的展现时间戳, fl是传输流系统时钟频率; 或,
根据唯一标识节目表的展现时间戳和节目播放相对时间的正常播放时间 对应表,按公式: PT(PTS(t))=(PTS(t) - PTS(i))*n/fl + NPT (PTS(i))得出的 PTS 对应的 RPT时间, 建立所述第一对应关系,
其中: NPT(PTS(t))是 t时刻展现时间戳的正常播放时间, PTS(t)是 t时刻 的展现时间戳, PTS(i))是离 t时刻最近的 i时刻的展现时间戳, NPT(PTS(i)) 是离 t时刻最近的 i时刻展现时间戳的正常播放时间, fl是传输流系统时钟频 率;
或,
通过在扩展分组基本流包头加入正常播放时间戳, 建立的展现时间戳与 正常播放时间的对应关系, 建立所述第一对应关系。
13、 如权利要求 11所述的同步系统, 其特征在于, 当所述第一媒体流是 传输流时, 所述第一时间信息是展现时间戳, 所述第一显示时间是正常播放 时间; 当所述第二媒体流是实时传输协议流时, 所述第二时间信息是实时传 输协议时间戳, 所述第二显示时间是正常播放时间; 在任一时间 j时, 所述第 二对应模块按 NPT( RTPQ) )=(RTP timestampO) - RTP timestamp(k)) I fl + PT ( RTP(k) )建立所述第二对应关系,
其中: NPT ( RTP①) 是实时传输协议包 j 时刻的正常播放时间, RTP timestamp(j)是 j时刻的实时传输协议包时间戳, RTP timestamp(k)是同一次请 求响应后位于 k时刻的实时传输协议包时间戳, 是实时传输协议流中媒体 的釆样频率; NPT ( RTP(k) 是同一次请求响应后位于 k时刻的实时传输协议 包的正常播放时间。
14、 如权利要求 11所述的同步系统, 其特征在于, 当所述第一媒体流是 传输流时, 所述第一时间信息是展现时间戳, 所述笫一显示时间是正常播放 时间; 当所述第二媒体流是实时传输协议流时, 所述第二时间信息是实时传 输协议时间戳, 所述第二显示时间是正常播放时间; 在任一时间 j时, 所述第 二对应模块按公式: NTP(j)=(RTP(j)-RTP(k))*n/f2 + NTP(k)得出 NTP(k)后, 根 据 NPT(RTP(i》 = NTP① -NTP(O)得出实时传输协议流包的 NPT时间, 建立所 述第二对应关系,
其中: NTP(j)是 j时刻网络时间协议的时间, RTP(j)是 j时刻的实时传输 协议包时间戳, RTP(k)为 k时刻的实时传输协议包时间戳, NTP(k)是 k时刻 网络时间协议的时间, NTP(O)是起始时刻网络时间协议的时间, NPT(RTP(j)) 是实时传输协议包 j时刻的正常播放时间, β是实时传输协议流中媒体的采样 频率。
15、 一种媒体流发送方法, 其特征在于, 包括如下步骤:
将第一媒体流、 第二媒体流发送至终端, 所述笫一媒体流和第二媒体流 中包括: 第一媒体流数据包第一时间信息与第一显示时间的第一对应关系信 息、 第二媒体流数据包第二时间信息与第二显示时间的第二对应关系信息。
16、 如权利要求 15所述的方法, 其特征在于, 所述方法具体为: 在第一媒体流中放置第一媒体流数据包第一时间信息与第一显示时间的 第一对应关系信息;
在第二媒体流中放置第二媒体流数据包第二时间信息与第二显示时间的 第二对应关系信息;
将所述含有对应关系信息的第一媒体流、 第二媒体流发送至终端。
17、 如权利要求 16所述的方法, 其特征在于, 所述的第一媒体流为传输 流,
所述第一对应关系为展现时间戳和相对时间戳之间的对应关系; 或,
所述第一对应关系为展现时间戳和绝对时间戳之间的对应关系;
所述第一时间对应关系为展现时间戳和实时传输流时间戳之间的对应关 系。
18、 如权利要求 16所述的方法, 其特征在于, 所述的第一媒体流为传输 流, 所述第一对应关系信息以以下方式之一或者其组合的方式进行放置: 所述第一对应关系信息放置在第一媒体流的分组基本流包头中; 所述第一对应关系信息放置在第一媒体流的传输流事件信息表中; 所述第一对应关系信息放置在第一媒体流新建的时间映射关系表中。
19、 如权利要求 15所述的方法, 其特征在于, 所述方法具体为: . 第一媒体流服务器传输第一媒体流数据包第一时间信息与第一显示时间 的第一对应关系信息到第二媒体流服务器;
第二媒体流服务器将第一媒体流的第一时间对应关系信息放置到第二媒 体流中;
第二媒体流服务器将第二媒体流数据包第二时间信息与第二显示时间的 第二对应关系信息放置在第二媒体流中; 将所述第一媒体流、 含有对应关系信息的第二媒体流发送至终端。
20、 权利要求 19所迷的方法, 其特征在于, 所述第一媒体流为传输流, 第二媒体流为实时传输协议流 ,
所述第一时间对应关系为展现时间戳和相对时间戳之间的对应关系; 或,
所述第一时间对应关系为展现时间戳和绝对时间戳之间的对应关系; 所述第一时间对应关系为展现时间戳和实时传输流时间戳之间的对应关 系。
21、 如权利要求 19所述的方法, 其特征在于, 所述第二媒体流为实时传 输流, 所述第一对应关系信息、 第二对应关系信息放置在实时传输协议流包 头或实时流控制包中。
22、 如权利要求 15所述的方法, 其特征在于, 所述方法具体为: 将第一媒体流数据包第一时间信息与第一显示时间的第一对应关系信息 发送至映射服务器;
放置第二媒体流数据包第二时间信息与第二显示时间的第二对应关系信 息到第二媒体流中;
所述映射服务器将第一对应关系信息发送至终端;
将第一媒体流、 含有第二对应关系信息的第二媒体流发送至终端。
23、 如权利要求 22所述的方法, 其特征在于, 所述第一媒体流为传输流, 所述第一对应关系为展现时间戳和相对时间戳之间的对应关系; 或,
所述第一对应关系为展现时间戳和绝对时间戳之间的对应关系; 或,
所述第一对应关系为展现时间戳和实时传输流时间戳之间的对应关系。
24、 如权利要求 15至 23任一所述的方法, 其特征在于, 进一步包括如 下步驟: 终端根据接收到的所述对应关系信息, 在时间信息对应的第一显示时间 与第二显示时间差小于阈值时, 对第一媒体流数据包与第二媒体流数据包进 行处理。
25、 如权利要求 24所述的方法, 其特征在于, 所述终端接收到所述对应 关系信息后, 才艮据第一对应关系, 将第一媒体流中的第一时间.信息映射成第 一显示时间; 根据第二对应关系, 将第二媒体流中的第二时间信息映射成第 二显示时间。
26、 如权利要求 24所述的方法, 其特征在于, 所述在时间信息对应的第 一显示时间与第二显示时间差小于阔值时, 对第一媒体流数据包与第二媒体 流数据包进行处理, 具体包括以下方式之一:
第一显示时间和第二显示时间相同或相差小于阔值时, 同时展现第一显 示时间标识的第一媒体流的数据包和笫二显示时间标识的第二媒体流的数据 包;
第一显示时间和第二显示时间相同或相差小于阈值时, 切换第一显示时 间标识的第一媒体流的数据包成第二显示时间标识的第二媒体流的数据包; 第一显示时间和第二显示时间相同或相差小于阈值时, 切换第二显示时 间标识的第二媒体流的数据包成第一显示时间标识的第一媒体流的数据包。
27、 一种媒体流发送系统, 包括向终端发送笫一媒体流的第一媒体流服 务器、 向终端发送第二媒体流的第二媒体流服务器, 其特征在于, 还包括对 应关系放置模块, 用于在第一媒体流服务器向终端发送的笫一媒体流、 和 /或 第二媒体流服务器向终端发送的第二媒体流中放置对应关系信息, 所述对应 关系包括: 第一媒体流数据包第一时间信息与第一显示时间的第一对应关系、 第二媒体流数据包第二时间信息与第二显示时间的第二对应关系。
28、 如权利要求 27所述的系统, 其特征在于, 所述对应关系放置模块包 括第一放置单元、 第二放置单元, 其中:
第一放置单元, 用于在第一媒体流中放置第一媒体流数据包第一时间信 息与第一显示时间的第一对应关系信息; 第二放置单元, 用于在第二媒体流中放置第二媒体流数据包第二时间信 息与第二显示时间的第二对应关系信息。
29、 如权利要求 28所述的系统, 其特征在于, 所述第一放置单元包括第 一子单元、 第二子单元、 第三子单元之一或者其组合, 其中:
第一子单元, 用于将所述第一对应关系信息放置在第一媒体流的分組基 本流 PES包头中;
第二子单元, 用于将所述第一对应关系信息放置在第一媒体流的传输流 事件信息表中; '
第三子单元, 用于将所述第一对应关系信息放置在第一媒体流新建的时 间映射关系表中。
30、 如权利要求 27所述的系统, 其特征在于, 所述对应关系放置模块包 括传输单元、 第三放置单元, 其中:
传输单元, 用于从第一媒体流服务器获取第一媒体流数据包笫一时间信 息与第一显示时间的笫一对应关系信息, 并传输至第三放置单元;
第三放置单元, 用于将第一媒体流的第一时间对应关系信息、 第二媒体 流数据包第二时间信息与第二显示时间的第二对应关系信息放置到第二媒体 流中。
31、 如权利要求 27所述的系统, 其特征在于, 所述对应关系放置模块包 括发送单元、 第二放置单元、 映射服务器, 其中:
发送单元, 用于将第一媒体流数据包第一时间信息与第一显示时间的第 一对应关系信息发送至映射服务器; '
第二放置单元, 用于在第二媒体流中放置第二媒体流数据包第二时间信 息与第二显示时间的第二对应关系信息;
映射服务器, 用于将第一对应关系信息发送至终端。
32、 如权利要求 27至 31任一所述的系统, 其特征在于, 所述终端进一 步包括对应关系处理模块, 用于根据接收到的所述对应关系, 在时间信息对 应的第一显示时间与第二显示时间差小于阔值时, 对第一媒体流数据包与第 二媒体流数据包进行处理。
33、 如权利要求 32所述的系统, 其特征在于, 所述对应关系处理模块包 括同步处理单元、 第一切换单元、 第二切换单元之一, 其中:
同步处理单元, 用于在第一显示时间和第二显示时间相同或相差小于闹 值时, 同时展现第一显示时间标识的第一媒体流的数据包和第二显示时间标 识的第二媒体流的数据包;
第一切换单元, 用于在第一显示时间和第二显示时间相同或相差小于阈 值时, 切换第一显示时间标识的第一媒体流的数据包成第二显示时间标识的 第二媒体流的数据包;
第二切换单元, 用于在第一显示时间和第二显示时间相同或相差小于阈 值时, 切换第二显示时间标识的第二媒体流的数据包成第一显示时间标识的 第一媒体流的数据包。
PCT/CN2007/003176 2006-11-09 2007-11-09 Procédé de synchronisation entre différents flux de média et un système WO2008055420A1 (fr)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007800024610A CN101371488B (zh) 2006-11-09 2007-11-09 一种不同媒体流间的同步方法及系统

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200610138588.2 2006-11-09
CNA2006101385882A CN101179484A (zh) 2006-11-09 2006-11-09 一种不同媒体流间的同步方法及系统

Publications (1)

Publication Number Publication Date
WO2008055420A1 true WO2008055420A1 (fr) 2008-05-15

Family

ID=39364180

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2007/003176 WO2008055420A1 (fr) 2006-11-09 2007-11-09 Procédé de synchronisation entre différents flux de média et un système

Country Status (2)

Country Link
CN (2) CN101179484A (zh)
WO (1) WO2008055420A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012049305A1 (en) * 2010-10-15 2012-04-19 Thomson Licensing Method for synchronizing multimedia flows and corresponding device
JP2019146188A (ja) * 2019-03-26 2019-08-29 ソニー株式会社 送信装置、送信方法、受信装置および受信方法
CN115174979A (zh) * 2022-06-20 2022-10-11 阿里巴巴(中国)有限公司 流媒体传输网络及传输控制方法、装置、设备及存储介质
EP4195673A1 (en) * 2021-12-07 2023-06-14 MediaTek Singapore Pte Ltd Synchronization of media streams

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102057687B (zh) * 2008-06-11 2013-06-12 皇家飞利浦电子股份有限公司 媒体流成分的同步
CN101465996B (zh) * 2008-12-31 2013-04-24 华为技术有限公司 一种网络电视显示时间的方法及设备和系统
CN102356619B (zh) * 2009-03-16 2016-11-09 皇家Kpn公司 已修改流同步
EP2529531B1 (en) * 2010-01-27 2019-10-09 Koninklijke KPN N.V. Method, system and device for synchronization of media streams
CN102196479B (zh) * 2010-03-10 2014-01-08 华为技术有限公司 定时提前值的共享检测方法、用户设备、基站及系统
WO2012094974A1 (zh) * 2011-01-11 2012-07-19 中兴通讯股份有限公司 一种多个媒体流同步的方法、装置及系统
CN102821338B (zh) * 2011-06-10 2015-02-25 冠捷投资有限公司 可消除异音的电路及其方法
CN102387401B (zh) * 2011-10-17 2014-08-27 上海聚力传媒技术有限公司 一种调整音视频信息的播放时间点的方法、装置及设备
KR101974077B1 (ko) * 2013-05-22 2019-08-23 한화테크윈 주식회사 Rtp 패킷을 이용한 재생 영상의 시간 표시 방법
CN103684738B (zh) * 2013-12-31 2017-06-13 曙光信息产业股份有限公司 一种防原消息干扰的方法及装置
US9560421B2 (en) * 2014-03-27 2017-01-31 Samsung Electronics Co., Ltd. Broadcast and broadband hybrid service with MMT and DASH
CN105812961B (zh) * 2014-12-31 2019-09-10 中兴通讯股份有限公司 自适应流媒体处理方法及装置
CN107517401B (zh) * 2016-06-15 2019-11-19 成都鼎桥通信技术有限公司 多媒体数据播放方法及装置
US11146611B2 (en) 2017-03-23 2021-10-12 Huawei Technologies Co., Ltd. Lip synchronization of audio and video signals for broadcast transmission
CN109756744B (zh) * 2017-11-02 2022-04-12 腾讯科技(深圳)有限公司 数据处理方法、电子设备及计算机存储介质
CN108462694A (zh) * 2018-02-02 2018-08-28 深圳广信网络传媒有限公司 基于ts流封装的动态媒体标示方法、装置、编码结构及系统
JP6828133B1 (ja) * 2019-12-27 2021-02-10 株式会社ドワンゴ コンテンツ生成装置、コンテンツ配信サーバ、コンテンツ生成方法、および、コンテンツ生成プログラム
CN111988641B (zh) * 2020-07-28 2022-07-15 上海工程技术大学 传输流复用音视频时间同步方法
CN112130485A (zh) * 2020-08-31 2020-12-25 南京理工大学 一种高速多通道同步采集装置及方法
CN114173149A (zh) * 2021-12-21 2022-03-11 杭州当虹科技股份有限公司 一种防插播的方法
WO2024032107A1 (en) * 2022-08-08 2024-02-15 Douyin Vision Co., Ltd. Method, apparatus, and medium for visual data processing
CN117676219A (zh) * 2022-08-29 2024-03-08 华为技术有限公司 一种数据传输方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1282068A (zh) * 1999-07-21 2001-01-31 汤姆森许可公司 用于压缩的音频/视频信号接收机的同步装置
WO2005115009A1 (en) * 2004-05-13 2005-12-01 Qualcomm Incorporated Synchronization of audio and video data in a wireless communication system
CN1767601A (zh) * 2005-10-21 2006-05-03 西安交通大学 一种支持多源流媒体的同步播放控制方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1282068A (zh) * 1999-07-21 2001-01-31 汤姆森许可公司 用于压缩的音频/视频信号接收机的同步装置
WO2005115009A1 (en) * 2004-05-13 2005-12-01 Qualcomm Incorporated Synchronization of audio and video data in a wireless communication system
CN1767601A (zh) * 2005-10-21 2006-05-03 西安交通大学 一种支持多源流媒体的同步播放控制方法

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012049305A1 (en) * 2010-10-15 2012-04-19 Thomson Licensing Method for synchronizing multimedia flows and corresponding device
US9729762B2 (en) 2010-10-15 2017-08-08 Thomson Licensing Method for synchronizing multimedia flows and corresponding device
KR101828639B1 (ko) 2010-10-15 2018-03-22 톰슨 라이센싱 멀티미디어 흐름을 동기화시키기 위한 방법 및 대응하는 장치
JP2019146188A (ja) * 2019-03-26 2019-08-29 ソニー株式会社 送信装置、送信方法、受信装置および受信方法
EP4195673A1 (en) * 2021-12-07 2023-06-14 MediaTek Singapore Pte Ltd Synchronization of media streams
CN115174979A (zh) * 2022-06-20 2022-10-11 阿里巴巴(中国)有限公司 流媒体传输网络及传输控制方法、装置、设备及存储介质
CN115174979B (zh) * 2022-06-20 2023-12-29 阿里巴巴(中国)有限公司 流媒体传输网络及传输控制方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN101179484A (zh) 2008-05-14
CN101371488B (zh) 2013-01-30
CN101371488A (zh) 2009-02-18

Similar Documents

Publication Publication Date Title
WO2008055420A1 (fr) Procédé de synchronisation entre différents flux de média et un système
KR101291990B1 (ko) 변경된 스트림 동기화
JP6317872B2 (ja) 異なるネットワークを介して受信したコンテンツのレンダリングを同期するデコーダ及びそれにおける方法
US7035295B2 (en) Direct RTP delivery method and system over MPEG network
EP2628297B1 (en) Method for synchronizing multimedia flows and corresponding device
US7697559B2 (en) Communication terminal, server, relay apparatus, broadcast communication system, broadcast communication method, and program
US8819714B2 (en) Ratings and quality measurements for digital broadcast viewers
CN100568971C (zh) 一种mpeg-4的传输码流到互联网流媒体联盟流的实时转换方法
US10477282B2 (en) Method and system for monitoring video with single path of video and multiple paths of audio
EP2690876A2 (en) Heterogeneous network-based linked broadcast content transmitting/receiving device and method
CN103947215B (zh) 传送媒体数据的方法和设备、接收媒体数据的设备和方法
WO2010075743A1 (zh) 一种网络电视显示时间的方法及设备
KR20100075656A (ko) Mbms 세션으로 pss 세션을 재동기화하는 시스템 및 방법
EP2479984A1 (en) Device and method for synchronizing content received from different sources
KR101112454B1 (ko) 무선 네트워크를 통한 디지털 멀티미디어 제어장치
KR102271686B1 (ko) 이종 네트워크 기반의 멀티미디어 자원 동기화 푸시 방법
JP2020074589A (ja) 送信方法
KR20130008436A (ko) Mmt 복합 전달 서비스에서 mmt 패킷 스트림 동기화를 위한 타이밍 정보 제공 방법 및 mmt 패킷 스트림 동기화 방법
AU2015204359A1 (en) Decoder and method at the decoder for synchronizing the rendering of contents received through different networks
KR200387606Y1 (ko) 무선 네트워크를 통한 디지털 멀티미디어 제어장치
Weihs et al. Convergence between IEEE 1394 and IP for real-time A/V transmission
IT et al. SUIT Doc Number SUIT_517 Project Number IST-4-028042
WO2011043706A1 (en) Stream switch using udp checksum
JP2004304271A (ja) データ送信装置およびデータ受信装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 07816788

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 200780002461.0

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 07816788

Country of ref document: EP

Kind code of ref document: A1