ffmpeg解碼h264 Increasing reorder buffer


開發環境

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);

參考

  1. https://github.com/FFMS/ffms2/issues/301
  2. https://trac.ffmpeg.org/ticket/5439


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM