Video corruption when transcoding on new computer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Video corruption when transcoding on new computer

FFmpeg-users mailing list
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














_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Video corruption when transcoding on new computer

Carl Eugen Hoyos-2
Am Mo., 8. Juni 2020 um 16:31 Uhr schrieb Michael Kohne via
ffmpeg-user <[hidden email]>:

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

Please test current FFmpeg git head, the only version
supported on this mailing list.

Unrelated: --enable-nonfree has only disadvantages for you,
no advantages. --enable-runtime-cpudetect is the default
and does not do what you think it does, remove it. If the
extra-ldflags are needed, this could indicate a bug that I
would like to know more about.

And please test with file input.

Oh, and please test with a sane compiler version, yours
is antique (and if there is an issue, your compiler is a
likely reason).

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Video corruption when transcoding on new computer

FFmpeg-users mailing list
Thank you.
My apologies for not going to the latest before posting here. I should know
this by now. I even have targets in the makefile for building the git
version.

nonfree - left from an experiment with AAC, perhaps? Definitely needed to
go.
cpudetect - not sure why I thought I need it. Perhaps because I specified
the cpu? I've also removed that because...it's not helping if I'm runtime
detecting.

I'm pretty sure the extra-ldflags have to do with strange layout choices in
my build tree.
If you properly install the libraries into your system, I don't think that
it is needed. I don't do so because I'm afraid of interfering with other
system components.
Yes, that does mean we have bigger problems (so many problems).

Switching to the latest code seems to have fixed the issue, so I can
continue for now and get past this.
After I get this bit finished up, I'll be going on to switching in new
compilers.
(The reason we use these is an entire backward compatibility cluster****
that I don't want to talk about. We're getting better, but not quickly.).

Again, thank you for your help.



With best regards

Michael Kohne

SR. SOFTWARE ENGINEER

Office +1.215.283.0860 x208 | www.moberg.com


On Mon, Jun 8, 2020 at 2:34 PM Carl Eugen Hoyos <[hidden email]> wrote:

> Am Mo., 8. Juni 2020 um 16:31 Uhr schrieb Michael Kohne via
> ffmpeg-user <[hidden email]>:
>
> > I'm working with ffmpeg 4.2.3 that I built myself.
>
> Please test current FFmpeg git head, the only version
> supported on this mailing list.
>
> Unrelated: --enable-nonfree has only disadvantages for you,
> no advantages. --enable-runtime-cpudetect is the default
> and does not do what you think it does, remove it. If the
> extra-ldflags are needed, this could indicate a bug that I
> would like to know more about.
>
> And please test with file input.
>
> Oh, and please test with a sane compiler version, yours
> is antique (and if there is an issue, your compiler is a
> likely reason).
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

--


Now a member of














_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Video corruption when transcoding on new computer

Carl Eugen Hoyos-2
Am Di., 9. Juni 2020 um 16:01 Uhr schrieb Michael Kohne via
ffmpeg-user <[hidden email]>:

> I'm pretty sure the extra-ldflags have to do with strange layout
> choices in my build tree.
> If you properly install the libraries into your system, I don't think that
> it is needed. I don't do so because I'm afraid of interfering with other
> system components.

Sorry, my mistake: I wanted to mention that if the --extra-libs from
your configure line are really needed that I would be curious because
there may be bugs I'd like to fix.
The --extra-ldflags may of course be necessary and make sense.

Please find out what top-posting means and avoid it here, Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".