h264编码后经过rtp传输,接收端接收到裸流解码,结果一半屏幕清晰一半模糊。
经过调试后,发现初始化编码器时如果不设置av_opt_set(pCodecCtx->priv_data, "tune", "zerolatency", 0);这个参数,在接收端就可以清晰的显示出来。如果设置了该参数则出现以下错误打印
[h264 @ 005f8fe0] concealing 160 DC, 160 AC, 160 MV errors in B frame
[h264 @ 005f8fe0] concealing 140 DC, 140 AC, 140 MV errors in B frame
[h264 @ 005f8fe0] concealing 160 DC, 160 AC, 160 MV errors in B frame
[h264 @ 005f8fe0] concealing 140 DC, 140 AC, 140 MV errors in P frame
[h264 @ 005f8fe0] illegal short term buffer state detected
[h264 @ 005f8fe0] concealing 160 DC, 160 AC, 160 MV errors in P frame
[h264 @ 005f8fe0] mmco: unref short failure
[h264 @ 005f8fe0] concealing 140 DC, 140 AC, 140 MV errors in B frame
[h264 @ 005f8fe0] mmco: unref short failure
[h264 @ 005f8fe0] mmco: unref short failure
[h264 @ 005f8fe0] illegal short term buffer state detected
[h264 @ 005f8fe0] concealing 160 DC, 160 AC, 160 MV errors in B frame
[h264 @ 005f8fe0] concealing 140 DC, 140 AC, 140 MV errors in B frame
[h264 @ 005f8fe0] concealing 160 DC, 160 AC, 160 MV errors in B frame
[h264 @ 005f8fe0] concealing 140 DC, 140 AC, 140 MV errors in B frame
[h264 @ 005f8fe0] concealing 160 DC, 160 AC, 160 MV errors in B frame
[h264 @ 005f8fe0] concealing 140 DC, 140 AC, 140 MV errors in P frame
[h264 @ 005f8fe0] illegal short term buffer state detected
[h264 @ 005f8fe0] concealing 160 DC, 160 AC, 160 MV errors in P frame
[h264 @ 005f8fe0] mmco: unref short failure
然后屏幕就一半屏幕清晰一半模糊。
希望帮忙指导指导下。谢谢。
补充下,本人用的ffmpeg的编解码库