[FFmpeg-trac] #3442(avcodec:open): h264 decoder decodes complete GOP wrong / skips one GOP if stream does not start with SPS/PPS
FFmpeg
trac at avcodec.org
Sat Mar 8 10:15:16 CET 2014
#3442: h264 decoder decodes complete GOP wrong / skips one GOP if stream does not
start with SPS/PPS
-------------------------------------+-----------------------------------
Reporter: munderl | Owner:
Type: defect | Status: open
Priority: normal | Component: avcodec
Version: git-master | Resolution:
Keywords: h264 mpegts | Blocked By:
Blocking: | Reproduced by developer: 1
Analyzed by developer: 0 |
-------------------------------------+-----------------------------------
Changes (by cehoyos):
* status: new => open
* reproduced: 0 => 1
Comment:
http://thread.gmane.org/gmane.comp.video.mplayer.user/70768
I don't think this is a regression, there are different ways to reproduce
the problem, I tested the following two command lines:
{{{
$ ffmpeg -skip_initial_bytes 0 -r 10 -i stream.lavf.264 -qscale 2 out1.avi
ffmpeg version N-61165-g742d860 Copyright (c) 2000-2014 the FFmpeg
developers
built on Mar 8 2014 09:01:38 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl
libavutil 52. 66.101 / 52. 66.101
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.101 / 55. 33.101
libavdevice 55. 11.100 / 55. 11.100
libavfilter 4. 3.100 / 4. 3.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
[h264 @ 0x1e0d960] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x1e0d960] decode_slice_header error
[h264 @ 0x1e0d960] no frame!
[h264 @ 0x1e0d960] mmco: unref short failure
Last message repeated 1 times
[h264 @ 0x1e0d960] number of reference frames (0+4) exceeds max (3;
probably corrupt input), discarding one
Input #0, h264, from 'stream.lavf.264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709), 1920x1080 [SAR
1:1 DAR 16:9], 25.25 fps, 25 tbr, 1200k tbn, 50 tbc
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out1.avi':
Metadata:
ISFT : Lavf55.33.101
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR
1:1 DAR 16:9], q=2-31, 200 kb/s, 10 tbn, 10 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg4)
Press [q] to stop, [?] for help
[h264 @ 0x1e60100] Found reference and non-reference fields in the same
frame, which is not implemented. Update your FFmpeg version to the newest
one from Git. If the problem still occurs, it means that your file has a
feature which has not been implemented.
[h264 @ 0x1e60100] If you want to help, upload a sample of this file to
ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel
mailing list.
[h264 @ 0x1e60100] decode_slice_header error
[h264 @ 0x1e60860] reference picture missing during reorder
[h264 @ 0x1e60860] Missing reference picture, default is 2147483647
[h264 @ 0x1e61720] mmco: unref short failure
[h264 @ 0x1dfd0c0] reference picture missing during reorder
[h264 @ 0x1dfd0c0] Missing reference picture, default is 65300
[h264 @ 0x1e60100] mmco: unref short failure
[h264 @ 0x1dfd0c0] mmco: unref short failure
[h264 @ 0x1e62d40] error while decoding MB 70 42, bytestream -33
frame= 13 fps=0.0 q=2.0 Lsize= 1294kB time=00:00:01.30
bitrate=8154.5kbits/s
video:1288kB audio:0kB subtitle:0 data:0 global headers:0kB muxing
overhead 0.461020%
}}}
{{{
$ ffmpeg -skip_initial_bytes 20 -r 10 -i stream.lavf.264 -qscale 2
out2.avi
ffmpeg version N-61165-g742d860 Copyright (c) 2000-2014 the FFmpeg
developers
built on Mar 8 2014 09:01:38 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl
libavutil 52. 66.101 / 52. 66.101
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.101 / 55. 33.101
libavdevice 55. 11.100 / 55. 11.100
libavfilter 4. 3.100 / 4. 3.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
[h264 @ 0x254c960] mmco: unref short failure
Last message repeated 1 times
[h264 @ 0x254c960] number of reference frames (0+4) exceeds max (3;
probably corrupt input), discarding one
Input #0, h264, from 'stream.lavf.264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709), 1920x1080 [SAR
1:1 DAR 16:9], 25.25 fps, 25 tbr, 1200k tbn, 50 tbc
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out2.avi':
Metadata:
ISFT : Lavf55.33.101
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR
1:1 DAR 16:9], q=2-31, 200 kb/s, 10 tbn, 10 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg4)
Press [q] to stop, [?] for help
[h264 @ 0x36f56c0] mmco: unref short failure
Last message repeated 1 times
[h264 @ 0x36f56c0] number of reference frames (0+4) exceeds max (3;
probably corrupt input), discarding one
[h264 @ 0x391db80] error while decoding MB 70 42, bytestream -33
frame= 45 fps=0.0 q=2.0 Lsize= 4006kB time=00:00:04.50
bitrate=7291.9kbits/s
video:3999kB audio:0kB subtitle:0 data:0 global headers:0kB muxing
overhead 0.167724%
}}}
Skipping the first 20 bytes produces more output frames, adding {{{-flags2
+showall}}} to the first command line shows that the frames are omitted
because they are visually broken. The same frames do not look broken if
the first 20 bytes are skipped as in the second command line.
I added {{{-r 10}}} to make the effect more visible in the output files,
it is not necessary though.
Using {{{-skip_initial_bytes 20}}} leads to bit-exact decoding wrt the
reference decoder.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/3442#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list