用FFmpeg解析rtsp时,出现画面失真,且有以下提示:
[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
在解析rtsp时,默认使用udp接收,容易出现丢包,错包的情况,因此可以修改为是用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.
摘至stackoverflow:http://stackoverflow.com/questions/30940146/h-264-decoding-error-log-from-rtsp-stream
在使用FFmpeg解析rtsp流时遇到画面失真问题,这通常由于默认通过UDP接收数据导致的丢包或错包。为解决此问题,建议切换到TCP接收方式来提高数据传输的可靠性。参考自Stack Overflow的相关讨论。
1万+

被折叠的 条评论
为什么被折叠?



