[FFmpeg-user] Capturing raw H264 data. Need to convert to YUV with ffmpeg

Joseph Rosensweig jrosensw at gmail.com
Mon Oct 29 21:40:29 CET 2012


It looks like I just need to drop some payload data and then append the
frames.  The h264 format is pretty simple, its 0x000001 delimited between
NAL packets.  After making some changes the decode works for me:

$ ffmpeg -f h264 -i ~/h264_filter_test/test.h264 test.yuv
ffmpeg version N-45839-g2d11ee4 Copyright (c) 2000-2012 the FFmpeg
developers
  built on Oct 21 2012 21:42:09 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  configuration: --disable-doc --disable-htmlpages --disable-manpages
--disable-podpages --disable-txtpages --disable-ffplay --disable-ffprobe
--disable-ffserver --prefix=/source/opal_latest_ffmpeg --enable-libx264
--enable-gpl --extra-ldflags=-L/source/opal_latest_ffmpeg/lib
--extra-cflags=-I/source/opal_latest_ffmpeg/include --enable-shared
--enable-pic
  libavutil      51. 76.101 / 51. 76.101
  libavcodec     54. 68.100 / 54. 68.100
  libavformat    54. 33.100 / 54. 33.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 20.102 /  3. 20.102
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[h264 @ 0x1a12260] max_analyze_duration 5000000 reached at 5000000
[h264 @ 0x1a12260] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from '/home/jdr/h264_filter_test/test.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p, 1280x720 [SAR 1:1 DAR
16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
File 'test.yuv' already exists. Overwrite ? [y/N] y
Output #0, rawvideo, to 'test.yuv':
  Metadata:
    encoder         : Lavf54.33.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 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
[h264 @ 0x1a10100] concealing 73 DC, 73 AC, 73 MV errors in P frame
[h264 @ 0x1a10b00] concealing 1442 DC, 1442 AC, 1442 MV errors in P frame
[h264 @ 0x1a20220] concealing 1840 DC, 1840 AC, 1840 MV errors in P frame
[h264 @ 0x1a20220] concealing 2640 DC, 2640 AC, 2640 MV errors in I frame
[h264 @ 0x1a0f800] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x1a0f800] concealing 239 DC, 239 AC, 239 MV errors in P frame
[h264 @ 0x1a0fc80] concealing 1840 DC, 1840 AC, 1840 MV errors in P frame
[h264 @ 0x1a20220] concealing 960 DC, 960 AC, 960 MV errors in P frame
[h264 @ 0x1a0f3a0] concealing 566 DC, 566 AC, 566 MV errors in P frame
[h264 @ 0x1a10100] concealing 811 DC, 811 AC, 811 MV errors in P frame
[h264 @ 0x1a10b00] concealing 349 DC, 349 AC, 349 MV errors in P frame
frame=  386 fps=0.0 q=0.0 Lsize=  521100kB time=00:00:15.44
bitrate=276480.0kbits/s
video:521100kB audio:0kB subtitle:0 global headers:0kB muxing overhead
0.000000%

   I'm assuming those errors all indicate encoder errors?  I can't seem to
find any documentation explaining this "concealing" message.  Anyone care
to explain it =D?

On Mon, Oct 29, 2012 at 3:43 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Joseph Rosensweig <jrosensw <at> gmail.com> writes:
>
> > Does anybody know where I can find documentation or
> > information on what FFMPEG looks for in a raw h264 file?
>
> (I believe the answer is: "For a valid startcode.")
>
> > I'm assuming that I need something to indicate the start
> > and end of frames, maybe the dimensions, etc.  But not
> > sure where to find info on this...
>
> You have to provide a format that is called "Annex B", it
> is the same format the reference decoder expects.
>
> >     Here is my full uncut console output:
> >
> > $ ffmpeg -r 30 -s 1280x720 -i test.h264 test.yuv
>
> You cannot provide a size for 1280x720, the dimensions
> are stored within the file.
> (Similar is true for the framerate.)
>
> You could try -f h264 instead, if it works, please
> provide the sample!
>
> > FFmpeg version git-2d162e3, Copyright (c) 2000-2011 the FFmpeg developers
> >   built on Apr  4 2012 11:34:44 with gcc 4.4.3
> >   configuration: --enable-gpl --enable-libx264
> > --extra-ldflags=-L/source/VideoGatewayAlpha/externals/SDK/lib
> > --extra-cflags=-I/source/VideoGatewayAlpha/externals/SDK/include
> > --enable-shared --enable-pic
> >   libavutil    50. 36. 0 / 50. 36. 0
> >   libavcore     0. 16. 1 /  0. 16. 1
> >   libavcodec   52.108. 0 / 52.108. 0
> >   libavformat  52. 94. 0 / 52. 94. 0
> >   libavdevice  52.  2. 3 / 52.  2. 3
> >   libavfilter   1. 74. 0 /  1. 74. 0
> >   libswscale    0. 12. 0 /  0. 12. 0
> > test.h264: Invalid data found when processing input
>
> You could test if the reference decoder accepts the file, if
> yes, a sample would be very welcome!
>
> 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