srs icon indicating copy to clipboard operation
srs copied to clipboard

rtmp转hls生成ts的时候判断是annexb还是ibmf 有可能判断错误,导致生成的ts播放花屏

Open xiaoninger opened this issue 4 years ago • 2 comments

srs_avc_startswith_annexb 判断遇到 000001的就认为是 annexb格式,有可能是 ibmf格式,只是长度碰巧也是,列如 00000122 可能是 ibmf格式,长度为290字节

xiaoninger avatar Jul 08 '19 01:07 xiaoninger

Make sense.

winlinvip avatar Dec 01 '20 03:12 winlinvip

Have you ever encountered the annexb format in rtmp? Is it possible to use the annexb format only when consecutive n frames are annexb? Are there any other better methods? I feel like no matter what we do, there will always be a possibility of misjudgment.

TRANS_BY_GPT3

Antony-An avatar May 16 '22 11:05 Antony-An

SRS 5.0, add a new configuration to specify guessing IMBF first:

vhost __defaultVhost__ {
    publish {
        # When parsing SPS/PPS, whether try ANNEXB first. If not, try IBMF first, then ANNEXB.
        # default: on
        try_annexb_first on;
    }
}

Today, a friend encountered a screen flickering issue, and it was found that there was an extra byte in the TS, causing an abnormal GOP.

image

TRANS_BY_GPT3

winlinvip avatar Sep 01 '22 11:09 winlinvip