[FFmpeg-devel] [patch] remove spurious "missing picture in access unit" at end of h.264 decode

Phil Rutschman phil.rutschman
Thu Jul 30 02:45:49 CEST 2009


When decoding an H.264 stream I observe the following:

$ ~/src/ffmpeg-latest-quicktest/ffmpeg -i black.h264 -vcodec copy -f rawvideo -y /dev/null
FFmpeg version git-9d70cd0, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration:
  libavutil     50. 3. 0 / 50. 3. 0
  libavcodec    52.32. 0 / 52.32. 0
  libavformat   52.36. 0 / 52.36. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 7. 1 /  0. 7. 1
  built on Jul 29 2009 17:20:31, gcc: 4.3.2
[h264 @ 0x2753690]missing picture in access unit

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/1001) -> 23.98 (48000/2002)
Input #0, h264, from 'black.h264':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: h264, yuv420p, 128x128 [PAR 1:1 DAR 1:1], 23.98 tbr, 1200k tbn, 47.95 tbc
Output #0, rawvideo, to '/dev/null':
    Stream #0.0: Video: 0x0000, yuv420p, 128x128 [PAR 1:1 DAR 1:1], q=2-31, 90k tbn, 23.98 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
[NULL @ 0x2753690]missing picture in access unit
frame=    1 fps=  0 q=-1.0 Lsize=       0kB time=0.04 bitrate=   0.2kbits/s
video:1kB audio:0kB global headers:0kB muxing overhead -99.822380%


The "missing picture in access unit" message is at the end of parse_nal_units in libavcodec/h264_parser.c (line 232 as I write this). Although I induce this in my example using a 1-frame file, I have observed this happen with most if not all h.264 streams I've tested. The cause is that h264_parse calls parse_nal_units even when the result of ff_combine_frame indicates there is no data left.

The attached patch prints this message only if parse_nal_units is called with a buf_size other than 0. This preserves the warning when it's an indication of a problem with the screen but eliminates it from the common case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: missing-picture-in-access-unit.patch
Type: application/octet-stream
Size: 496 bytes
Desc: missing-picture-in-access-unit.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090729/69d6fcbe/attachment.obj>



More information about the ffmpeg-devel mailing list