gpt4 book ai didi

ffmpeg - RTSP 流的 H.264 解码错误日志

转载 作者:行者123 更新时间:2023-12-02 06:46:01 30 4
gpt4 key购买 nike

我收到以下 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

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

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

最佳答案

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

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

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.

这将阻止数据包被丢弃,从而消除视频的损坏。

关于ffmpeg - RTSP 流的 H.264 解码错误日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30940146/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com