開發環境
Windows10 x64,vs2017,ffmpeg版本:4.3.1
發生場景
使用live555 mediaServer啟動rtsp server,然后使用testRTSPClient程序拉流,ffmpeg解碼,在視頻開頭幾幀出現該警告,結果導致播放畫面閃爍,rtsp client不論使用UDP還是TCP均有該問題,接收緩存足夠大
解決方法
經Google[h264 @ 0x28819a0] Increasing reorder buffer to 1
相關問題,可以在解碼時設置-strict 1
參數,讓ffmpeg使用更高的重排序計數,代碼:
AVDictionary *dict = NULL;
av_dict_set(&dict, "strict", "1", 0);
avcodec_open2(ctx, codec, dict); // 參數 AVCodecContext *ctx, AVCodec *codec
av_dict_free(&dict);