自己用QT写的程序,在PC上采集视频编码RTP打包发送。如果发送给自己,然后用VLC播放的话是可以正常显示的(尽管延迟会不断增大,这个问题再待解决),但是用自己编的软件确无法正常显示,能看到一瞬间有部分画面正常,然后一会画面就糊掉了。
同样的代码, 我在树莓派上,用OPENMAX硬件加速编码,然后同样的打包方式发送,发送给树莓派自己或者给PC,都能正常地显示。
不知道这个是哪部分出了原因?到底是FFMPEG编码部分出问题,还是接收的代码有问题??
结果如图。。。
然后程序会不断报类似如下错误
[h264 @ 17653080] Cannot use next picture in error concealment
[h264 @ 17653080] concealing 1040 DC, 1040 AC, 1040 MV errors in P frame
[h264 @ 17653080] Cannot use next picture in error concealment
[h264 @ 17653080] concealing 1000 DC, 1000 AC, 1000 MV errors in P frame
[h264 @ 17653080] Cannot use next picture in error concealment
[h264 @ 17653080] concealing 1040 DC, 1040 AC, 1040 MV errors in P frame
[h264 @ 17653080] Cannot use next picture in error concealment
[h264 @ 17653080] concealing 1040 DC, 1040 AC, 1040 MV errors in P frame
[h264 @ 17653080] Cannot use next picture in error concealment
[h264 @ 17653080] concealing 1040 DC, 1040 AC, 1040 MV errors in P frame
[h264 @ 17653080] Cannot use next picture in error concealment
[h264 @ 17653080] concealing 1040 DC, 1040 AC, 1040 MV errors in P frame
[h264 @ 17653080] Cannot use next picture in error concealment
[h264 @ 17653080] concealing 1000 DC, 1000 AC, 1000 MV errors in P frame
[h264 @ 17653080] Cannot use next picture in error concealment
[h264 @ 17653080] concealing 1040 DC, 1040 AC, 1040 MV errors in P frame
[h264 @ 17653080] Cannot use next picture in error concealment
有可能是图像的分辨率配置导致的问题
楼主这个问题解决了么?
应该是你的接收端没有将RTP包拆出来后组成一个NALU或完整的一帧就送去解码,参考这篇文章:https://blog.csdn.net/zhoubotong2012/article/details/103002257
将单帧数据包容量加大试试
AVDictionary* options = NULL;
av_dict_set(&options, "rtsp_transport", "tcp", 0);
av_dict_set(&options, "bufsize", "131072", 0); // "131072" 默认大小是65536 ,这里可以将它扩大10倍看看,我扩大的2倍也可以
if(avformat_open_input(&pFormatCtx, filepath, NULL, &options)!=0)