CN111163272A - Seamless switching method for real-time stream - Google Patents
Seamless switching method for real-time stream Download PDFInfo
- Publication number
- CN111163272A CN111163272A CN201911308848.XA CN201911308848A CN111163272A CN 111163272 A CN111163272 A CN 111163272A CN 201911308848 A CN201911308848 A CN 201911308848A CN 111163272 A CN111163272 A CN 111163272A
- Authority
- CN
- China
- Prior art keywords
- switching
- timestamp
- time
- information source
- demultiplexer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
- H04N5/268—Signal distribution or switching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/443—OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/45—Management 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/462—Content 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/4622—Retrieving content or additional data from different sources, e.g. from a broadcast channel and the Internet
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Studio Circuits (AREA)
Abstract
The invention discloses a seamless switching method of real-time streams. The method specifically comprises the following steps: (1) each input information source corresponds to a demultiplexer, one demultiplexer corresponds to an audio and video decoder, and all the audio and video decoders are connected to the information source switcher; (2) setting a unified reference clock for the demultiplexer; (3) when the information source switcher switches the information source, error compensation is carried out on the output frame, and therefore seamless switching of the real-time stream is achieved. The invention has the beneficial effects that: the method can not only check the current information source condition in real time, but also seamlessly complete information source switching action, and can naturally avoid the GOP switching problem of the encoding code stream, because the data output from the audio and video decoder can directly enter the encoder for encoding.
Description
Technical Field
The invention relates to the technical field related to audio and video processing, in particular to a seamless switching method of real-time streams.
Background
In the broadcasting and television industry, in order to consider broadcasting safety, each input source is provided with two main and standby information sources, and some information sources are even three information sources of a main and standby pad. The audio and video transcoding system in the whole link must have: when one of the signal sources has problems (current interruption, data incompleteness and the like), the function of the other signal source is automatically switched to, the output stream is required to be ensured not to be interrupted for a long time, and the image quality is required to be output normally (no long-time mosaic or long-time pause).
Because the real-time stream is generally audio and video compressed data, when the information source A is switched to other information sources:
1. the demultiplexer, if switching stream data immediately, is likely to occur that the switched video data is not from the beginning of a GOP (Group of picture Group), which may cause a decoding mosaic phenomenon to occur in a rear-end video decoder.
2. If the demultiplexer does not switch the stream data immediately, it first looks for the start of GOP of the stream data and then sends the data to the video decoder, which may cause a short pause in the back end, and even a long output interruption if the GOP is long, which may cause a safety hazard.
Disclosure of Invention
The invention provides a seamless switching method of real-time stream for seamlessly completing information source switching in order to overcome the defects in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a seamless switching method of real-time streams specifically comprises the following steps:
(1) each input information source corresponds to a demultiplexer, one demultiplexer corresponds to an audio and video decoder, and all the audio and video decoders are connected to the information source switcher;
(2) setting a unified reference clock for the demultiplexer;
(3) when the information source switcher switches the information source, error compensation is carried out on the output frame, and therefore seamless switching of the real-time stream is achieved.
Based on an online audio and video transcoding system, the requirement of switching an input source in real time is required, and the operation of switching the information source is placed behind an audio and video decoder, so that the advantages of checking the current information source condition in real time and finishing the information source switching action seamlessly are achieved, and data output from the audio and video decoder can directly enter an encoder for encoding.
Preferably, in the step (2), the specific operation method is as follows: each demultiplexer has respective reference clock and timestamp management, before each demultiplexer begins to analyze input data, a uniform initial reference time is set for the demultiplexer, and the later output timestamps are offset by the uniform reference time, so that the timestamps received by each audio and video decoder can be returned to a uniform time axis, namely the analyzed audio and video timestamps need to be adjusted to a reference clock system, and the timestamps output by each information source are as follows:
Tn=(Tc–T0)+(T′n–T′0)
wherein: tn is the output audio/video timestamp, Tc is the reference clock time of the first frame, T0 is the uniform start reference time, T 'n is the input stream current timestamp, and T' 0 is the input stream first frame timestamp.
Preferably, in step (3), the specific operation method of error compensation is as follows: the timestamp after switching is larger than the timestamp before switching, and several repeated frames need to be inserted; the timestamp after switching is smaller than the timestamp before switching, and then the frames with the smaller timestamps need to be discarded; this ensures that the time stamps make a smooth continuous transition.
Preferably, for the reason that the timestamp after switching is larger than the timestamp before switching, the decoder supplements the frame to the current timestamp according to the timestamp before switching, in order to ensure that the phenomenon of directly supplementing the frame due to the very large jump of the timestamp caused by source error data needs to be set, if the jump of the timestamp exceeds the set compensation repeating frame threshold, compensation is not carried out, and switching is directly carried out; for the time stamp after switching is smaller than the time stamp before switching, the decoder directly discards the frame which is less than or equal to the time stamp before switching and more than or equal to the time stamp after switching.
The invention has the beneficial effects that: the method can not only check the current information source condition in real time, but also seamlessly complete information source switching action, and can naturally avoid the GOP switching problem of the encoding code stream.
Drawings
FIG. 1 is a method block diagram of the present invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
In the embodiment shown in fig. 1, a method for seamless switching of real-time streams specifically includes the following steps:
(1) each input information source corresponds to a demultiplexer, one demultiplexer corresponds to an audio and video decoder, and all the audio and video decoders are connected to the information source switcher;
(2) setting a unified reference clock for the demultiplexer;
because different paths of information source inputs and the demultiplexer outputs have respective timestamp information, if the reference clocks are not unified, the respective output timestamps have no reference, and the timestamps are discontinuous during switching and even jump greatly, so that the output images are jammed and even cut-off occurs. The specific operation method comprises the following steps: each demultiplexer has its own reference clock and timestamp management, before each demultiplexer begins to analyze input data, a uniform initial reference time (system time or UTC time) is set for the demultiplexer, and the subsequent output timestamps are offset by the uniform reference time, so that the timestamps received by each audio/video decoder can be returned to a uniform time axis, that is, the analyzed audio/video timestamps need to be adjusted to a reference clock system, and the timestamps output by each information source are:
Tn=(Tc–T0)+(T′n–T′0)
wherein: tn is an output audio and video time stamp, Tc is the reference clock time of a first frame, T0 is a uniform initial reference time, T 'n is an input stream current time stamp, and T' 0 is an input stream first frame time stamp;
(3) when the information source switcher switches the information source, error compensation is carried out on the output frame, and therefore seamless switching of real-time streams is achieved;
although online real-time stream input is performed, the real-time performance of each information source has weak errors, so when the information source switcher switches the information sources, the fact that switching to another information source is achieved, a timestamp output by an audio and video decoder at present is not smooth switching, certain errors exist, and the information source switcher needs to perform certain compensation processing. The specific operation method of the error compensation comprises the following steps: the timestamp after switching is larger than the timestamp before switching, and several repeated frames need to be inserted; the timestamp after switching is smaller than the timestamp before switching, and then the frames with the smaller timestamps need to be discarded; this ensures that the time stamps make a smooth continuous transition.
For the fact that the timestamp after switching is larger than the timestamp before switching, a decoder supplements a frame to the current timestamp according to the timestamp before switching, for example, the timestamp before switching is 1000 milliseconds, the timestamp of a new stream after switching is 1120 milliseconds, the frame rate of an input source is 25FPS, the time interval of each frame is 40 milliseconds, the decoder needs to repeat two frames of 1000 milliseconds, and the timestamps are 1040 milliseconds and 1080 milliseconds respectively; in order to ensure that the timestamp jumps greatly due to source error data to cause a direct frame compensation phenomenon, a compensation repeated frame threshold value needs to be set, the system is 2 seconds, and if the timestamp jumps more than the set compensation repeated frame threshold value by 2 seconds, compensation is not carried out, and direct switching is carried out.
For the timestamp after switching is smaller than the timestamp before switching, the decoder directly discards the frame less than or equal to the timestamp before switching and greater than or equal to the timestamp after switching, for example, the timestamp before switching is 1000 milliseconds, and the timestamp after switching of the new stream is 920 milliseconds, so the decoder directly discards three frames, and the timestamps are 920 milliseconds, 960 milliseconds, and 1000 milliseconds, respectively.
Based on an online audio and video transcoding system, the requirement of switching an input source in real time is required, and the operation of switching the information source is placed behind an audio and video decoder, so that the advantages of checking the current information source condition in real time and finishing the information source switching action seamlessly are achieved, and data output from the audio and video decoder can directly enter an encoder for encoding.
Claims (4)
1. A seamless switching method of real-time stream is characterized by comprising the following steps:
(1) each input information source corresponds to a demultiplexer, one demultiplexer corresponds to an audio and video decoder, and all the audio and video decoders are connected to the information source switcher;
(2) setting a unified reference clock for the demultiplexer;
(3) when the information source switcher switches the information source, error compensation is carried out on the output frame, and therefore seamless switching of the real-time stream is achieved.
2. The method according to claim 1, wherein in step (2), the specific operation method is as follows: each demultiplexer has respective reference clock and timestamp management, before each demultiplexer begins to analyze input data, a uniform initial reference time is set for the demultiplexer, and the later output timestamps are offset by the uniform reference time, so that the timestamps received by each audio and video decoder can be returned to a uniform time axis, namely the analyzed audio and video timestamps need to be adjusted to a reference clock system, and the timestamps output by each information source are as follows:
Tn=(Tc–T0)+(T′n–T′0)
wherein: tn is the output audio/video timestamp, Tc is the reference clock time of the first frame, T0 is the uniform start reference time, T 'n is the input stream current timestamp, and T' 0 is the input stream first frame timestamp.
3. The method according to claim 1 or 2, wherein in step (3), the error compensation is performed by: the timestamp after switching is larger than the timestamp before switching, and several repeated frames need to be inserted; the timestamp after switching is smaller than the timestamp before switching, and then the frames with the smaller timestamps need to be discarded; this ensures that the time stamps make a smooth continuous transition.
4. The seamless switching method of real-time stream as claimed in claim 3, wherein, for the timestamp after switching being larger than the timestamp before switching, the decoder supplements the frame to the current timestamp according to the timestamp before switching, in order to ensure that the timestamp is greatly jumped due to source error data, which results in a straight frame supplementing phenomenon, a compensation repeat frame threshold value needs to be set, if the timestamp jump exceeds the set compensation repeat frame threshold value, no compensation is made, and the switching is performed directly; for the time stamp after switching is smaller than the time stamp before switching, the decoder directly discards the frame which is less than or equal to the time stamp before switching and more than or equal to the time stamp after switching.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911308848.XA CN111163272A (en) | 2019-12-18 | 2019-12-18 | Seamless switching method for real-time stream |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911308848.XA CN111163272A (en) | 2019-12-18 | 2019-12-18 | Seamless switching method for real-time stream |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111163272A true CN111163272A (en) | 2020-05-15 |
Family
ID=70557851
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911308848.XA Pending CN111163272A (en) | 2019-12-18 | 2019-12-18 | Seamless switching method for real-time stream |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111163272A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113542840A (en) * | 2021-06-11 | 2021-10-22 | 浙江大华技术股份有限公司 | Method for adjusting display delay, electronic device and storage medium |
CN114125548A (en) * | 2022-01-26 | 2022-03-01 | 广州长嘉电子有限公司 | Satellite signal-based high-definition television program playing method, device and system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1321004A (en) * | 2000-04-25 | 2001-11-07 | 华为技术有限公司 | Method and equipment for swapping active with standby switches |
JP2007028212A (en) * | 2005-07-15 | 2007-02-01 | Canon Inc | Reproducing device and reproducing method |
US20090269031A1 (en) * | 1998-07-30 | 2009-10-29 | Tivo Inc. | Multimedia stream processing system |
CN103313125A (en) * | 2013-05-03 | 2013-09-18 | 上海东方明珠广播电视研究发展有限公司 | Transport stream-based duplex digital television signal seamless switching method and system |
CN104041125A (en) * | 2012-01-09 | 2014-09-10 | 三星电子株式会社 | Handover method and apparatus in wireless communication system |
CN104768062A (en) * | 2015-04-01 | 2015-07-08 | 上海阅维信息科技有限公司 | Real-time video stream seamless switching method |
-
2019
- 2019-12-18 CN CN201911308848.XA patent/CN111163272A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090269031A1 (en) * | 1998-07-30 | 2009-10-29 | Tivo Inc. | Multimedia stream processing system |
CN1321004A (en) * | 2000-04-25 | 2001-11-07 | 华为技术有限公司 | Method and equipment for swapping active with standby switches |
JP2007028212A (en) * | 2005-07-15 | 2007-02-01 | Canon Inc | Reproducing device and reproducing method |
CN104041125A (en) * | 2012-01-09 | 2014-09-10 | 三星电子株式会社 | Handover method and apparatus in wireless communication system |
CN103313125A (en) * | 2013-05-03 | 2013-09-18 | 上海东方明珠广播电视研究发展有限公司 | Transport stream-based duplex digital television signal seamless switching method and system |
CN104768062A (en) * | 2015-04-01 | 2015-07-08 | 上海阅维信息科技有限公司 | Real-time video stream seamless switching method |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113542840A (en) * | 2021-06-11 | 2021-10-22 | 浙江大华技术股份有限公司 | Method for adjusting display delay, electronic device and storage medium |
CN114125548A (en) * | 2022-01-26 | 2022-03-01 | 广州长嘉电子有限公司 | Satellite signal-based high-definition television program playing method, device and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CA2193109C (en) | Video compression using a signal transmission chain comprising an information bus linking encoders and decoders | |
JP2002503402A (en) | Method and apparatus for connecting compressed information streams | |
CN101529907B (en) | Device and method for reducing channel-change time | |
US20200177907A1 (en) | Video encoding apparatus, video decoding apparatus, video encoding method, and video decoding method | |
KR20090086532A (en) | Method for reducing channel change times and synchronizing audio/video content during channel change | |
US8655143B2 (en) | Supplementary buffer construction in real-time applications without increasing channel change delay | |
EP2485501B1 (en) | Fast channel change companion stream solution with bandwidth optimization | |
CN111163272A (en) | Seamless switching method for real-time stream | |
KR100294663B1 (en) | Mpeg decoder and decoding control method | |
CA2303149C (en) | Seamless splicing of compressed video programs | |
EP2124449A1 (en) | Device and method for synchronizing an interactive mark to streaming content | |
US9338480B2 (en) | Systems and methods to compensate for the effects of transmission delay | |
CN110958466A (en) | SDI signal synchronous return method based on RTMP transmission | |
CN104363411A (en) | Video playing method and video playing device in video monitoring system | |
KR20070054066A (en) | Digital video stream transmitting system adapting svc and its transmitting method | |
JP2001313936A (en) | Method and device for signal delivery | |
JP2001509354A (en) | Information stream syntax indicating the existence of a connection point | |
US9955229B2 (en) | Using scene-change transitions to output an alert indicating a functional state of a back-up video-broadcast system | |
JP6102332B2 (en) | Video stream switching system, video stream switching method and program | |
AU6114599A (en) | Data compression unit control for alignment of output signal | |
KR20060105890A (en) | Digital broadcasting reception apparatus and method therefor | |
JP2008301335A (en) | Video signal switching apparatus | |
CN115426501A (en) | Audio and video code stream time calibration method and electronic equipment | |
JP2002290384A (en) | Active/standby changeover device for digital broadcast program transmission system | |
JP4197582B2 (en) | Stream synchronization switching device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200515 |