[FFmpeg-user] Bad keyframes when encoding to the ogg container format

Robert McIntyre rlm at mit.edu
Thu Jun 28 05:52:46 CEST 2012


I tried to encode some more videos from frames today with
the latest FFMPEG from the git repository and would like to
report that the exact problem from before is now back.


When I try to play the file generated by FFMPEG, mplayer
reports that there are "bad keyframes" and seeking in the
file is broken --- the audio and video will go out of sync.

here's an example command line.

ffmpeg version N-41901-gf15803e Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun 24 2012 19:49:41 with gcc 4.7.1
  configuration: --enable-gpl --enable-libvorbis --enable-libtheora
--prefix=/usr/local
  libavutil      51. 62.100 / 51. 62.100
  libavcodec     54. 29.100 / 54. 29.100
  libavformat    54. 11.100 / 54. 11.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     3.  0.100 /  3.  0.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[image2 @ 0xad52460] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from './test/%07d.bmp.png':
  Duration: 00:00:40.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, pal8, 318x276, 25 fps, 25 tbr, 25 tbn, 25 tbc
[wav @ 0xad59280] max_analyze_duration 5000000 reached at 5015510
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, wav, from './test.wav':
  Duration: 00:00:16.00, bitrate: 1411 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz,
stereo, s16, 1411 kb/s
[graph 0 input from stream 0:0 @ 0xadf4680] w:318 h:276 pixfmt:pal8
tb:1/60 fr:60/1 sar:0/1 sws_param:flags=2
[output stream 0:0 @ 0xad78140] No opaque field provided
[format @ 0xad85800] auto-inserting filter 'auto-inserted scaler 0'
between the filter 'Parsed_null_0' and the filter 'format'
[graph 0 input from stream 0:0 @ 0xadf4680] TB:0.016667
[auto-inserted scaler 0 @ 0xae15140] w:318 h:276 fmt:pal8 sar:0/1 ->
w:318 h:276 fmt:yuv420p sar:0/1 flags:0x4
[auto-inserted fifo 0 @ 0xaeb8560]
[output stream 0:1 @ 0xaeb87a0] auto-inserting filter 'auto-inserted
fifo 0' between the filter 'audio format for output stream 0:1' and
the filter 'output stream 0:1'
[audio format for output stream 0:1 @ 0xaeb5460] auto-inserting filter
'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and
the filter 'audio format for output stream 0:1'
[auto-inserted resampler 0 @ 0xaeb90a0] chl:stereo fmt:s16 r:44100Hz
-> chl:stereo fmt:flt r:44100Hz
Output #0, ogg, to 'test.ogg':
  Metadata:
    encoder         : Lavf54.11.100
    Stream #0:0: Video: theora, yuv420p, 318x276, q=2-31, 9000 kb/s,
25 tbn, 25 tbc
    Stream #0:1: Audio: vorbis, 44100 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (png -> libtheora)
  Stream #1:0 -> #0:1 (pcm_s16le -> libvorbis)
Press [q] to stop, [?] for help
[libvorbis @ 0xae0c320] Que input is backward in time
frame=   33 fps=0.0 q=0.0 size=       3kB time=00:00:01.32 bitrate=
20.8kbits/s dup=0 drop=42
frame=   65 fps= 65 q=0.0 size=       3kB time=00:00:02.60 bitrate=
10.5kbits/s dup=0 drop=86
frame=   96 fps= 64 q=0.0 size=       3kB time=00:00:03.84 bitrate=
7.1kbits/s dup=0 drop=131
frame=  128 fps= 64 q=0.0 size=       3kB time=00:00:05.12 bitrate=
5.4kbits/s dup=0 drop=175
frame=  159 fps= 63 q=0.0 size=      47kB time=00:00:06.36 bitrate=
60.9kbits/s dup=0 drop=218
frame=  194 fps= 64 q=0.0 size=      47kB time=00:00:07.76 bitrate=
50.1kbits/s dup=0 drop=268
frame=  231 fps= 66 q=0.0 size=     156kB time=00:00:09.24 bitrate=
138.2kbits/s dup=0 drop=320
frame=  270 fps= 67 q=0.0 size=     183kB time=00:00:10.80 bitrate=
138.6kbits/s dup=0 drop=374
frame=  310 fps= 68 q=0.0 size=     241kB time=00:00:12.40 bitrate=
159.0kbits/s dup=0 drop=430
frame=  349 fps= 69 q=0.0 size=     242kB time=00:00:13.96 bitrate=
141.9kbits/s dup=0 drop=485
frame=  388 fps= 70 q=0.0 size=     323kB time=00:00:15.52 bitrate=
170.4kbits/s dup=0 drop=540
frame=  418 fps= 70 q=0.0 Lsize=     486kB time=00:00:16.00 bitrate=
248.7kbits/s dup=0 drop=582
video:322kB audio:153kB subtitle:0 global headers:7kB muxing overhead 0.696288%


when I run mplayer on the test.ogg file created by ffmpeg, seeking
causes audio/video to go out of sync with the following error:


More information about the ffmpeg-user mailing list