来自RTSP流的H.264解码错误日志

Tar*_*riq 10 ffmpeg rtsp h.264

我收到以下H264错误日志.在FFMPEG的帮助下解码RTSP视频流时会出现此日志.5/6秒后显示的图像模糊.图片会不时恢复.但是,它在大多数情况下仍然模糊不清.

编辑:一些FFMPEG论坛建议升级FFMPEG版本以避免这些日志.我已经更新了2015年6月19日的最新FFMPEG版本.原木仍然存在,图片仍然模糊.

编辑2:RTSP流来自GANZ摄像机.本相机通过LAN连接进行连接.

[h264 @ 0abb2aa0] Cannot use next picture in error concealment
[h264 @ 0abb2aa0] concealing 1933 DC, 1933 AC, 1933 MV errors in P frame
[h264 @ 098e5c80] RTP: missed 131 packets
[h264 @ 0abb3300] error while decoding MB 66 25, bytestream (-9)
[h264 @ 0abb3300] Cannot use next picture in error concealment
[h264 @ 0abb3300] concealing 1583 DC, 1583 AC, 1583 MV errors in P frame
[h264 @ 098e5c80] RTP: missed 8 packets
[h264 @ 0b113e40] error while decoding MB 54 30, bytestream (-11)
[h264 @ 0b113e40] Cannot use next picture in error concealment
[h264 @ 0b113e40] concealing 1195 DC, 1195 AC, 1195 MV errors in P frame
[h264 @ 098e5c80] RTP: missed 118 packets
[h264 @ 0ac79960] error while decoding MB 13 20, bytestream (-13)
[h264 @ 0ac79960] Cannot use next picture in error concealment
[h264 @ 0ac79960] concealing 2036 DC, 2036 AC, 2036 MV errors in P frame
[h264 @ 098e5c80] RTP: missed 198 packets
[h264 @ 0ad4f500] error while decoding MB 21 9, bytestream (-5)
[h264 @ 0ad4f500] Cannot use next picture in error concealment
[h264 @ 0ad4f500] concealing 2908 DC, 2908 AC, 2908 MV errors in P frame
[h264 @ 098e5c80] RTP: missed 108 packets
[h264 @ 0abb3300] error while decoding MB 1 14, bytestream (-5)
[h264 @ 0abb3300] Cannot use next picture in error concealment
[h264 @ 0abb3300] concealing 2528 DC, 2528 AC, 2528 MV errors in P frame
[h264 @ 098e5c80] RTP: missed 106 packets
[h264 @ 0b1149c0] error while decoding MB 12 5, bytestream (-7)
[h264 @ 0b1149c0] Cannot use next picture in error concealment
[h264 @ 0b1149c0] concealing 3237 DC, 3237 AC, 3237 MV errors in P frame
[h264 @ 098e5c80] RTP: missed -65402 packets
[h264 @ 0b1155a0] error while decoding MB 50 38, bytestream (-7)
[h264 @ 0b1155a0] Cannot use next picture in error concealment
[h264 @ 0b1155a0] concealing 559 DC, 559 AC, 559 MV errors in P frame
[h264 @ 098e5c80] RTP: missed 150 packets
[h264 @ 0af65740] error while decoding MB 48 31, bytestream (-15)
[h264 @ 0af65740] Cannot use next picture in error concealment
[h264 @ 0af65740] concealing 1121 DC, 1121 AC, 1121 MV errors in P frame
[h264 @ 098e5c80] RTP: missed 4 packets
[h264 @ 0ac79960] error while decoding MB 35 38, bytestream (-41)
[h264 @ 0ac79960] Cannot use next picture in error concealment
[h264 @ 0ac79960] concealing 574 DC, 574 AC, 574 MV errors in P frame
Run Code Online (Sandbox Code Playgroud)

我使用ffmpeg将RTSP流转储到avi文件,并且没有错误.C:\ Users\Matlab> ffmpeg -i rtsp://192.168.1.67/gnz_media/main 123.avi

没有H.264解码错误.任何人都可以使用ffmpeg api帮助解决上述解码错误.

Phi*_*Phi 6

如果你正在使用UDP,你可以期望丢弃帧 - 这是UDP设计的一部分,它有利于速度而不是可靠性.丢失数据包对于H264格式来说是一个严重问题,因为给定数据包可能依赖于它前面或后面的数据包(使用差异图像而不是发送全新图像).因此,使用UDP会产生很多错误,包括"RTP:错过XXX数据包".

通过传递rtsp_transport="tcp"选项切换到更可靠但速度更慢的TCP av_open_input.例:

AVDictionary * opts = NULL;
av_dict_set(&opts, "rtsp_transport", "tcp", 0);
int error = avformat_open_input(&rtsp_format_context, "rtsp://your url here", NULL, &opts);
if (error < 0)
    ; // Connection error. Add your error handling here.
Run Code Online (Sandbox Code Playgroud)

这将阻止丢弃数据包,这将消除视频损坏.

  • @Phi 经过多天的广泛测试,相机没有问题,但 wifi 和流媒体能力是罪魁祸首。那或者设备本身无法处理数据吞吐量,但可能性较小。使用 TCP 不会导致帧的“拖尾”或“撕裂”,但会完全丢弃帧(即没有捕获部分帧)。使用 UDP,它会尽可能保留部分帧,但这会导致这些帧的“拖尾”或“撕裂”。我们最终使用了 UDP,因为它至少显示了部分帧而不是丢失了整个视频块。 (2认同)

小智 -4

此问题是由摄像头产生的,因此请通过GANZ技术支持升级摄像头最新固件。摄像头不支持此h.264视频压缩。