[FFmpeg-user] Video corruption when transcoding on new computer

Michael Kohne mhkohne at moberg.com
Mon Jun 8 17:01:20 EEST 2020


We use ffmpeg to transcode video from an H.264 video stream from an IP
camera to an mpeg4 AVI file.

On our old system (Core i7-4765T, CentOS 6, with a locally built 3.16.60
kernel. 4 cores + hyperthreading) we had no problems. Upon switching to a
new system (with a Core i7-6600U, still CentOS 6, with a locally built
4.9.215 kernel 2 cores + hyperthreading) we're getting video corruption in
the output file.

The lower portion of the output video smears for a while, then get reset
several seconds later.
If I crank the video size and bitrate down, the problems show up less
frequently or go away altogether.

If I just ffmplay from the camera I never see any problems.

I'm working with ffmpeg 4.2.3 that I built myself.

When I was running this test, I ran top showing per-cpu usage, and none of
the 4 cores was above 55%.

Any idea how to fix this?  Or at least clues as to how to track down the
exact issue? I suspect I don't really understand what's going on.

Is there any options I could use that would give us better output? I mean
like, dropping frames instead of smearing?

Thanks for any hints.

Command:
/usr/bin/time nice -n -13 /data/SHR5246/ffmpeg/ffmpeg-orig/ffmpeg -t 60
-loglevel info -rtsp_transport udp -i rtsp://192.168.249.58/media/video1 -y
-codec:v mpeg4 -f avi output1.avi > ffmpeg.info.out 2>&1


Log snippet:
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
  configuration: --prefix=/data/SHR5246/ffmpeg/build
--extra-cflags=-I/data/SHR5246/ffmpeg/build/include
--extra-ldflags=-L/data/SHR5246/ffmpeg/build/lib --extra-libs='-lm -ldl
-lpthread -lrt' --enable-gpl --enable-nonfree --disable-libfdk_aac
--enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264
--enable-libfreetype --enable-libspeex --enable-libtheora --cpu=i686
--enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[rtsp @ 0xb432380] max delay reached. need to consume packet
[rtsp @ 0xb432380] RTP: missed 82 packets
Invalid UE golomb code
[h264 @ 0xb435280] cbp too large (3199971767) at 12 50
[h264 @ 0xb435280] error while decoding MB 12 50
[h264 @ 0xb435280] concealing 2197 DC, 2197 AC, 2197 MV errors in P frame
Input #0, rtsp, from 'rtsp://192.168.249.58/media/video1':
  Metadata:
    title           : SONY RTSP Server
  Duration: N/A, start: 0.033333, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 1920x1080,
30 tbr, 90k tbn, 180k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
Invalid UE golomb code
[h264 @ 0xb5ab980] cbp too large (3199971767) at 12 50
[h264 @ 0xb5ab980] error while decoding MB 12 50
[h264 @ 0xb5ab980] concealing 2197 DC, 2197 AC, 2197 MV errors in P frame
Output #0, avi, to 'output1.avi':
  Metadata:
    INAM            : SONY RTSP Server
    ISFT            : Lavf58.29.100
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080,
q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.54.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
rtsp://192.168.249.58/media/video1: corrupt decoded frame in stream 0
[rtsp @ 0xb432380] max delay reached. need to consume packet
[rtsp @ 0xb432380] RTP: missed 206 packets
[h264 @ 0xb472140] corrupted macroblock 82 60 (total_coeff=-1)
[h264 @ 0xb472140] error while decoding MB 82 60
[h264 @ 0xb472140] concealing 927 DC, 927 AC, 927 MV errors in P frame
frame=   30 fps=0.0 q=31.0 size=     262kB time=00:00:01.56
bitrate=1367.7kbits/s speed=3.11x
rtsp://192.168.249.58/media/video1: corrupt decoded frame in stream 0
frame=   35 fps= 34 q=31.0 size=     262kB time=00:00:02.36 bitrate=
905.4kbits/s speed=2.29x
frame=   46 fps= 30 q=31.0 size=     262kB time=00:00:02.83 bitrate=
756.3kbits/s speed=1.82x
[rtsp @ 0xb432380] max delay reached. need to consume packet
[rtsp @ 0xb432380] RTP: missed 48 packets
[rtsp @ 0xb432380] max delay reached. need to consume packet
[rtsp @ 0xb432380] RTP: missed 1 packets
[h264 @ 0xb472140] out of range intra chroma pred mode
[h264 @ 0xb472140] error while decoding MB 77 31
[h264 @ 0xb472140] concealing 4412 DC, 4412 AC, 4412 MV errors in I frame
rtsp://192.168.249.58/media/video1: corrupt decoded frame in stream 0
frame=   58 fps= 28 q=31.0 size=     518kB time=00:00:03.40
bitrate=1247.0kbits/s speed=1.65x
frame=   70 fps= 27 q=31.0 size=     518kB time=00:00:03.93
bitrate=1077.9kbits/s speed=1.52x
[rtsp @ 0xb432380] max delay reached. need to consume packet
[rtsp @ 0xb432380] RTP: missed 5 packets
<snip>

The full log output:
https://drive.google.com/file/d/1Jjz0enwQm6BYiYviwVzAiaSe2Ki0r3n-/view?usp=sharing

A screenshot showing the smearing (17 seconds in):
https://drive.google.com/file/d/1H2VUngyZZ33Wm46FOMKZ2njKZLfw7Rqu/view?usp=sharing

The video file:
https://drive.google.com/file/d/1IMFbdiCfRFhvm5pEvztZXdeS_KYsUTYj/view?usp=sharing



With best regards

Michael Kohne

SR. SOFTWARE ENGINEER

Office +1.215.283.0860 x208 | www.moberg.com

-- 


Now a member of
















More information about the ffmpeg-user mailing list