[FFmpeg-user] ffmpeg drops frames when decoding corrupted H264 bitstream

Jernej Trnkoczy jernej.trnko at gmail.com
Wed Jan 2 10:29:30 CET 2013


Hi Carl,
The original (not corrupted) sample file can be found here -
http://dl.dropbox.com/u/12694214/ballroom_0.h264 . I investigated the
bitstream - thre results are here:
http://dl.dropbox.com/u/12694214/ballroom_0_parsedNALs.txt . If I decode
this file with ffmpeg command "ffmpeg -f h264 -i ./ballroom_0.h264
./ballroom_0_decoded.yuv" I get uncompressed .yuv file with 250 frames.

Then I delete the 6th, 18th, 30th and last NAL unit (three B-frame-NALs and
one P-frame-NAL) from the original .h264 file and get the corrupted file
which can be found here -
http://dl.dropbox.com/u/12694214/ballroom_0-corrupted.h264. The analysis of
the bitstream shows that these four NALs are indeed missing -
http://dl.dropbox.com/u/12694214/ballroom_0-corrupted_parsedNALs.txt . If I
decode this corrupted file with ffmpeg command "ffmpeg -f h264 -i
./ballroom_0-corrupted.h264 ./ballroom_0-corrupted_decoded.yuv" I get
uncompressed .yuv file with 246 frames. The frames that correspond to
individual missing NAL units were obviously dropped. The console output
does not report any errors:

jernejt at jernejt-ThinkStation-E30:~/Poizkusi/AVCkodiranjeZffmpeg$ ffmpeg -f
h264 -i ./ballroom_0-corrupted.h264
./ballroom_0-corrupted_decoded.yuvffmpeg version git-2012-12-27-b3f3fe3
Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 27 2012 14:15:25 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-gpl --enable-libass --enable-libfaac
--enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-librtmp --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264
--enable-nonfree --enable-version3
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 81.100 / 54. 81.100
  libavformat    54. 50.102 / 54. 50.102
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.101 /  3. 30.101
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[h264 @ 0xaf39fe0] max_analyze_duration 5000000 reached at 5000000
[h264 @ 0xaf39fe0] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from './ballroom_0-corrupted.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p, 640x480, 25 fps, 25 tbr,
1200k tbn, 50 tbc
Output #0, rawvideo, to './ballroom_0-corrupted_decoded.yuv':
  Metadata:
    encoder         : Lavf54.50.102
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480,
q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
Press [q] to stop, [?] for help
frame=  221 fps=0.0 q=0.0 size=   99450kB time=00:00:08.84
bitrate=92160.0kbits/frame=  246 fps=0.0 q=0.0 Lsize=  110700kB
time=00:00:09.84 bitrate=92160.0kbits/s
video:110700kB audio:0kB subtitle:0 global headers:0kB muxing overhead
0.000000%
jernejt at jernejt-ThinkStation-E30:~/Poizkusi/AVCkodiranjeZffmpeg$



I think that normally decoder should conceal the missing frames - but
ffmpeg just drops them. Can you please help with this issue!

Cheers;
Jernej Trnkoczy


On Fri, Dec 28, 2012 at 2:34 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Jernej Trnkoczy <jernej.trnko <at> gmail.com> writes:
>
> > I am decoding a corrupted H.264 bitstream with ffmpeg.
> > There are some NAL units missing in this bitstream.
>
> Command line and complete, uncut console output missing
> and I suspect a sample will be needed, too.
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list