Master and standby information source switching method based on decoder error detection

文档序号:1617300 发布日期:2020-01-10 浏览:11次 中文

阅读说明:本技术 一种基于解码器错误检测的主备信源切换方法 (Master and standby information source switching method based on decoder error detection ) 是由 朱建国 陈勇 谢亚光 于 2019-09-24 设计创作,主要内容包括:本发明公开了一种基于解码器错误检测的主备信源切换方法。它具体包括如下步骤:(1)对输入的主备两条信源进行实时解码,同时检测码流中存在的语法错误和数据丢失;(2)将码流错误进行分类统计,根据错误点的不同以及可能的影响范围,为当前帧分配不同的错误值;(3)主备解码器在输出解码帧的同时附带当前帧的错误值,向转码器上报当前信源的码流错误情况;(4)转码器对比一段时间内主备解码器上报的码流错误可能的影响范围,决定是否要切换到备信源。本发明的有益效果是:具有很高的判断准确度,保证了视频转码质量,同时对于解码器性能没有影响,对视频转码的用户体验具有很高的实际意义,极大的保证了播出质量,提升了用户体验。(The invention discloses a method for switching a main source and a standby source based on error detection of a decoder. The method specifically comprises the following steps: (1) decoding the input main and standby information sources in real time, and detecting syntax errors and data loss in the code stream; (2) classifying and counting the code stream errors, and distributing different error values for the current frame according to different error points and possible influence ranges; (3) the main and standby decoders output the decoded frame and simultaneously attach the error value of the current frame, and report the code stream error condition of the current information source to the transcoder; (4) and the transcoder compares the possible influence range of the code stream error reported by the main and standby decoders within a period of time to determine whether to switch to the standby information source. The invention has the beneficial effects that: the method has the advantages of having high judgment accuracy, ensuring the video transcoding quality, having no influence on the performance of a decoder, having high practical significance on the user experience of video transcoding, greatly ensuring the broadcasting quality and improving the user experience.)

1. A method for switching a main source and a standby source based on error detection of a decoder is characterized by comprising the following steps:

(1) decoding the input main and standby information sources in real time, and detecting syntax errors and data loss in the code stream;

(2) classifying and counting the code stream errors, and distributing different error values for the current frame according to different error points and possible influence ranges;

(3) the main and standby decoders output the decoded frame and simultaneously attach the error value of the current frame, and report the code stream error condition of the current information source to the transcoder;

(4) and the transcoder compares the possible influence range of the code stream error reported by the main and standby decoders within a period of time to determine whether to switch to the standby information source.

2. The method as claimed in claim 1, wherein in step (1), the primary and secondary decoders synchronously decode the input primary and secondary information sources respectively, and the decoders detect syntax errors and data loss in the code stream according to the video decoding standard.

3. The method as claimed in claim 1, wherein in step (2), when the decoder detects a sequence header error, it indicates that the current code stream has a fatal error, and the input data of the current entire sequence may be erroneous, so that the total number N of macro blocks of the current frame is obtained, and the error value of the current frame is set to N.

4. The method as claimed in claim 1, wherein in step (2), when the decoder detects a header error, it indicates that the current frame cannot be decoded, so that the total number N of macroblocks in the current frame is obtained, the error value of the current frame is set to N, if the current frame is directly discarded, the output will have slight sticking, and meanwhile, the following frame will refer to the current frame, the output will have long-time mosaic, so as to reduce the influence of the code stream error, the decoding of the current frame is immediately stopped, and the previous frame data is copied and outputted as the current frame.

5. The method as claimed in claim 1, wherein in step (2), when the decoder detects a macroblock error, it indicates that the current macroblock cannot be decoded, and the remaining macroblocks of the current frame cannot be correctly analyzed, so that the number M of the remaining macroblocks of the current frame that are decoded is calculated, the error value of the current frame is set to M, if the current frame is directly discarded, the output will have a slight stuck, and meanwhile, the following frame will refer to the current frame, which will result in the output having a long-time mosaic, so that to reduce the influence caused by the code stream error, the decoding of the current frame is immediately stopped, and the data at the same position as the previous frame should be copied for the data that is not decoded of the current frame.

6. The method as claimed in claim 1, wherein in step (3), since different frame types have different effects on decoding, I frames affect the whole sequence, P frames affect all frames following the current sequence P, and B frames generally affect only itself, the decoder multiplies the frame type of the current frame by different weights, and sends the error value to the transcoder along with the decoded frame.

7. The method as claimed in claim 1, wherein in step (4), the transcoder counts the error reported by the primary and secondary decoders within 10 seconds, and immediately switches to the secondary source if the primary source is always reporting a decoding error and the secondary source has no error; if the standby information source always reports decoding errors and the main information source has no errors, switching is not needed; if the main and standby information sources report decoding errors, comparing the total error values M0 and N0 of the main and standby information sources within the time of 10 seconds, in order to avoid repeated switching of the main and standby information sources by the transcoder, the total error conditions M1 and N1 of the main and standby information sources within previous 2 minutes at the current time point need to be counted, if M0-N0 > thr0, and M1-N1 > thr1, switching to the standby information sources is carried out, and thr0 and thr1 are threshold values preset according to the size of an image.

Technical Field

The invention relates to the technical field of video transcoding, in particular to a master and standby information source switching method based on error detection of a decoder.

Background

With the development of internet technology, more and more websites can meet the watching requirements of audiences to the maximum extent through the integration of live network programs. The live video is characterized by real-time performance, so that the requirements on the picture quality and the continuity of the live video are high, and input information source faults or interfered packet loss are inevitable. The picture seen by the user will be displayed with a cockton mosaic, which results in missing important information, and this is often unacceptable. In order to enable a live video to have better continuity and picture quality, currently, a live service background mostly adopts a deployment mode of a main information source and a standby information source, two input information sources transcode simultaneously, and when one information source fails, the other information source can be seamlessly switched to so as to ensure the playing stability of the live video.

Specifically, a management server in a background of the live broadcast service receives a unified channel signal from different satellite receivers or other transcoders as a main source and a standby source, but a general transcoding server only considers switching to the standby source when the main source is interrupted.

In the actual online real-time transcoding situation, due to the fact that the situation of packet loss may exist in the front-end input information source, the output of the transcoder is subjected to screen splash and mosaic or frame loss and blocking, and user experience is seriously affected. In order to prevent sudden interruption of the signal sources in the live transcoding, a mode of simultaneously inputting the main signal source and the standby signal source is adopted to ensure the stability of the input signal sources. But normally the transcoder will switch to the alternate source only when the primary source is interrupted. When the main information source loses packets, the general transcoder can not directly switch the information source, so that the output code stream has mosaic, and the user experience is greatly influenced.

Disclosure of Invention

The invention provides a method for switching a main source and a standby source based on error detection of a decoder, which is used for ensuring the broadcasting quality and overcoming the defects in the prior art.

In order to achieve the purpose, the invention adopts the following technical scheme:

a method for switching a main source and a standby source based on error detection of a decoder specifically comprises the following steps:

(1) decoding the input main and standby information sources in real time, and detecting syntax errors and data loss in the code stream;

(2) classifying and counting the code stream errors, and distributing different error values for the current frame according to different error points and possible influence ranges;

(3) the main and standby decoders output the decoded frame and simultaneously attach the error value of the current frame, and report the code stream error condition of the current information source to the transcoder;

(4) and the transcoder compares the possible influence range of the code stream error reported by the main and standby decoders within a period of time to determine whether to switch to the standby information source.

The invention dynamically selects the information source with better and more stable quality to transcode and then push the transcoded information source to the user by detecting any code stream error of the main and standby information sources in real time, has high judgment accuracy, can find the signal abnormality of the main information source in time, switches to the standby information source in time, ensures the video transcoding quality, has no influence on the performance of a decoder, has high practical significance on the user experience of the video transcoding, greatly ensures the broadcasting quality, and improves the user experience.

Preferably, in step (1), the primary and secondary decoders respectively perform real-time synchronous decoding on the input primary and secondary information sources, and simultaneously detect syntax errors and data loss existing in the code stream according to the video decoding standard specification.

Preferably, in step (2), when the decoder detects a sequence header error, it indicates that the current code stream has a fatal error, and the input data of the current whole sequence may be erroneous, so the total number N of macroblocks of the current frame is obtained, and the error value of the current frame is set to N.

Preferably, in step (2), when the decoder detects an image header error, it indicates that the current frame cannot be decoded, so that the total number N of macroblocks of the current frame is obtained, the error value of the current frame is set to N, if the current frame is directly discarded, output may have slight jamming, and meanwhile, a following frame may refer to the current frame, output may have long-time mosaic, so that to reduce the influence caused by a code stream error, decoding of the current frame is stopped immediately, and a previous frame of data is copied and output as the current frame.

Preferably, in step (2), when the decoder detects a macroblock error, it indicates that the current macroblock cannot be decoded, and meanwhile, the remaining macroblocks of the current frame cannot be correctly analyzed, so that the number M of the remaining decoded macroblocks of the current frame is calculated, the error value of the current frame is set to M, if the current frame is directly discarded, output may have slight jamming, and meanwhile, a subsequent frame may refer to the current frame, output may have long-time mosaic, so to reduce the influence caused by a code stream error, decoding of the current frame is stopped immediately, and data at the same position as the previous frame should be copied for the data that is not decoded at the current frame.

Preferably, in step (3), since different frame types have different effects on decoding, I frames affect the whole sequence, P frames affect all frames following the current sequence P, and B frames generally affect only itself, the decoder multiplies the frame type of the current frame by different weights and sends error values to the transcoder along with the decoded frame.

Preferably, in the step (4), the transcoder counts error conditions reported by the main and standby decoders within 10 seconds, and if the main source always reports decoding errors and the standby source has no errors, the transcoder is switched to the standby source immediately; if the standby information source always reports decoding errors and the main information source has no errors, switching is not needed; if the main and standby information sources report decoding errors, comparing the total error values M0 and N0 of the main and standby information sources within the time of 10 seconds, in order to avoid repeated switching of the main and standby information sources by the transcoder, the total error conditions M1 and N1 of the main and standby information sources within previous 2 minutes at the current time point need to be counted, if M0-N0 > thr0, and M1-N1 > thr1, switching to the standby information sources is carried out, and thr0 and thr1 are threshold values preset according to the size of an image.

The invention has the beneficial effects that: the method has the advantages that the judgment accuracy is high, the signal abnormality of the main information source can be found in time, the standby information source can be switched in time, the video transcoding quality is guaranteed, the performance of a decoder is not affected, the method has high practical significance on the user experience of video transcoding, the broadcasting quality is greatly guaranteed, and the user experience is improved.

Drawings

FIG. 1 is a schematic of the process 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 switching between a main source and a standby source based on error detection of a decoder specifically includes the following steps:

(1) decoding the input main and standby information sources in real time, and detecting syntax errors and data loss in the code stream; the main decoder and the standby decoder respectively carry out real-time synchronous decoding on the input main source and the standby source, and simultaneously, the decoders detect syntax errors and data loss in code streams according to the video decoding standard;

(2) classifying and counting the code stream errors, and distributing different error values for the current frame according to different error points and possible influence ranges;

when a decoder detects a sequence head error, it indicates that a fatal error exists in a current code stream, and input data of a current whole sequence may be in error, so that the total number N of macro blocks of a current frame is obtained, and the error value of the current frame is set to be N;

when the decoder detects that the image header is wrong, the current frame cannot be decoded, so that the total number N of macro blocks of the current frame is obtained, the error value of the current frame is set to be N, if the current frame is directly discarded, the output is slightly blocked, and meanwhile, the following frame refers to the current frame, the output is subjected to long-time mosaic, so that the decoding of the current frame is stopped immediately, and the last frame data is copied to be output as the current frame in order to reduce the influence caused by code stream errors;

when a decoder detects a macro block error, the current macro block cannot be decoded, and meanwhile, the residual macro blocks of the current frame cannot be correctly analyzed, so that the number M of the residual macro blocks of the current frame, which are decoded, is calculated, the error value of the current frame is set to be M, if the current frame is directly discarded, output is slightly blocked, and meanwhile, a later frame refers to the current frame, output is subjected to long-time mosaic, so that the decoding of the current frame is immediately stopped, and data at the same position of the previous frame is copied for the data of the current frame which is not decoded;

(3) the main and standby decoders output the decoded frame and simultaneously attach the error value of the current frame, and report the code stream error condition of the current information source to the transcoder; because different frame types have different influences on decoding, the I frame can influence the whole sequence, the P frame can influence all frames behind the current sequence P, and the B frame can only influence the B frame, so that the decoder multiplies different weights according to the frame type of the current frame, the weight of the I frame is 5, the weight of the P frame is 3, the weight of the B frame is 1, and then an error value is sent to the transcoder along with the decoded frame;

(4) the transcoder compares the possible influence range of the code stream error reported by the main and standby decoders within a period of time to determine whether to switch to the standby information source;

the transcoder counts error conditions reported by a main decoder and a standby decoder within 10 seconds, and if the main information source always reports decoding errors and the standby information source has no errors, the transcoder is switched to the standby information source immediately; if the standby information source always reports decoding errors and the main information source has no errors, switching is not needed; if the main and standby information sources report decoding errors, comparing the total error values M0 and N0 of the main and standby information sources within the time of 10 seconds, in order to avoid repeated switching of the main and standby information sources by the transcoder, the total error conditions M1 and N1 of the main and standby information sources within previous 2 minutes at the current time point need to be counted, if M0-N0 > thr0, and M1-N1 > thr1, switching to the standby information sources is carried out, and thr0 and thr1 are threshold values preset according to the size of an image.

The invention dynamically selects the information source with better and more stable quality to transcode and then push the transcoded information source to the user by detecting any code stream error of the main and standby information sources in real time, has high judgment accuracy, can find the signal abnormality of the main information source in time, switches to the standby information source in time, ensures the video transcoding quality, has no influence on the performance of a decoder, has high practical significance on the user experience of the video transcoding, greatly ensures the broadcasting quality, and improves the user experience. The invention can obviously improve the video quality under the condition that the main and standby information sources have abnormal fluctuation.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种视频编解码方法、装置及终端设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类