来自RTSP流的H.264解码错误日志 [英] H.264 decoding error log from RTSP stream

查看:491
本文介绍了来自RTSP流的H.264解码错误日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am getting the following H264 error log. This log comes while decoding an RTSP video stream with help of FFMPEG. The picture displayed is blurred after 5/6 seconds. The picture would recover it from time to time. However, it remains blurred for most of the time.

一些FFMPEG讨论论坛建议升级FFMPEG版本以避免这些日志.我更新了2015年6月19日发布的最新FFMPEG版本.日志仍然存在,图片仍然模糊.

Some FFMPEG discussion forums suggested to upgrade FFMPEG version to avoid these logs. I have updated the latest FFMPEG build of June 19, 2015.Still the log remains there and picture is still blurred.

RTSP流来自GANZ摄像机.该摄像机通过LAN连接进行连接.

EDIT 2: The RTSP stream is coming from a GANZ camera. This camera is connected through a LAN connection.

[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

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

I dumped the RTSP stream to an avi file using ffmpeg and there are no errors. C:\Users\Matlab>ffmpeg -i rtsp://192.168.1.67/gnz_media/main 123.avi

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

There are no H.264 decoding errors. Can anybody help with above decoding errors using ffmpeg api.

推荐答案

如果您使用的是UDP,则可以预期会丢失帧-这是UDP设计的一部分,这有利于提高速度而不是可靠性.对于H264格式,丢失数据包是一个严重的问题,因为给定的数据包可能取决于其前面或后面的数据包(使用差异图像而不是发送完整的新图像). 因此,使用UDP会产生很多错误,包括"RTP:错过的XXX数据包".

If you're using UDP, you can expect frames to be dropped - that's part of the UDP design, which favours speed over reliability. Missing packets is a serious problem for the H264 format as a given packet may depend on packets ahead or behind it (using a difference image instead of sending a full new image). So, using UDP will produce a lot of errors including "RTP: missed XXX packets".

通过将rtsp_transport="tcp"选项传递给avformat_open_input来切换到更可靠但更慢的TCP.示例:

Switch to the more reliable but slower TCP by passing rtsp_transport="tcp" option to avformat_open_input. Example:

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.

这将阻止丢包,从而消除视频损坏.

This will stop packets being dropped, which will remove the corruption of the video.

这篇关于来自RTSP流的H.264解码错误日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆