[FFmpeg-user] splitting on non keyframes?

Roger Pack rogerdpack2 at gmail.com
Tue Jul 10 21:21:03 CEST 2012


If I do the following:

$ ffmpeg -i sintel.mpg -vcodec copy -acodec copy -ss 90.0 starting_at_90.mpg

then

$ ffmpeg -i starting_at_90.mpg  -vframes 1 -f image2 -an snap.jpg

I get this warning message:
[mpeg2video @ 01f09860] warning: first frame is no keyframe

Is this expected?  Anybody know why this is occurring?  It seems to
occur regardless of what start time I use.  My fear is that somehow
ffmpeg is splitting wrong, or possibly inserting some garbage frames
at the beginning.
ffprobe shows i-frames for the first video packet, but it might be
obscuring some other problem, for all I know.
Thanks.
-roger-

full output:

c:\vids>ffmpeg -i sintel.mpg -vcodec copy -ss 90.1 -t 10 -acodec copy
garbage.mpg

c:\vids>c:\installs\ffmpeg-20120706-git-8293a21-win32-shared\bin\ffmpeg.exe
-i sintel.mpg -vcodec copy -ss 90.1 -t 10 -acodec copy garbage.mpg
ffmpeg version N-42288-g8293a21 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul  5 2012 20:58:08 with gcc 4.7.1
  configuration: --disable-static --enable-shared --enable-gpl
--enable-version3 --disable-w32threads --enable-runtime-cpudetect
--enable-avisynth --enable-bzlib --enable-frei0r --enable-libass
--enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libnut --enable-libopenjpeg --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs
--enable-libxvid --enable-zlib
  libavutil      51. 64.100 / 51. 64.100
  libavcodec     54. 33.100 / 54. 33.100
  libavformat    54. 15.100 / 54. 15.100
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  0.101 /  3.  0.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpeg2video @ 01d85960] ac-tex damaged at 40 7
[mpeg2video @ 01d85960] Warning MVs not available
[mpeg2video @ 01d85960] concealing 1035 DC, 1035 AC, 1035 MV errors
[mpeg @ 01d731c0] max_analyze_duration 5000000 reached at 5024000
Input #0, mpeg, from 'sintel.mpg':
  Duration: 00:14:47.58, start: 0.233367, bitrate: 4132 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480
[SAR 32:27 DAR 16:9], 7000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94
tbc
    Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s
Output #0, mpeg, to 'garbage.mpg':
  Metadata:
    encoder         : Lavf54.15.100
    Stream #0:0: Video: mpeg2video, yuv420p, 720x480 [SAR 32:27 DAR
16:9], q=2-31, 7000 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
    Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), 448 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  269 fps=0.0 q=-1.0 Lsize=    3858kB time=00:00:10.00
bitrate=3160.5kbits/s
video:3287kB audio:548kB subtitle:0 global headers:0kB muxing overhead 0.605837%

c:\vids>ffmpeg -i garbage.mpg  -vframes 1 -f image2 -an snap.jpg

c:\vids>c:\installs\ffmpeg-20120706-git-8293a21-win32-shared\bin\ffmpeg.exe
-i garbage.mpg  -vframes 1 -f image2 -an snap.jpg
ffmpeg version N-42288-g8293a21 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul  5 2012 20:58:08 with gcc 4.7.1
  configuration: --disable-static --enable-shared --enable-gpl
--enable-version3 --disable-w32threads --enable-runtime-cpudetect
--enable-avisynth --enable-bzlib --enable-frei0r --enable-libass
--enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libnut --enable-libopenjpeg --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs
--enable-libxvid --enable-zlib
  libavutil      51. 64.100 / 51. 64.100
  libavcodec     54. 33.100 / 54. 33.100
  libavformat    54. 15.100 / 54. 15.100
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  0.101 /  3.  0.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpeg @ 01e83140] max_analyze_duration 5000000 reached at 5024000
Input #0, mpeg, from 'garbage.mpg':
  Duration: 00:00:10.02, start: 1.012000, bitrate: 3153 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480
[SAR 32:27 DAR 16:9], 7000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94
tbc
    Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s
[graph 0 input from stream 0:0 @ 01f0ac00] w:720 h:480 pixfmt:yuv420p
tb:1/90000 fr:30000/1001 sar:32/27 sws_param:flags=2
[output stream 0:0 @ 01f0a840] No opaque field provided
[auto-inserted scaler 0 @ 01f0ab60] w:720 h:480 fmt:yuv420p sar:32/27
-> w:720 h:480 fmt:yuvj420p sar:32/27 flags:0x4
Output #0, image2, to 'snap.jpg':
  Metadata:
    encoder         : Lavf54.15.100
    Stream #0:0: Video: mjpeg, yuvj420p, 720x480 [SAR 32:27 DAR 16:9],
q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> mjpeg)
Press [q] to stop, [?] for help
[mpeg2video @ 01f09860] warning: first frame is no keyframe
frame=    1 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.03 bitrate=
0.0kbits/s
video:19kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.000000%

Test file:
rogerdpack.t28.net/incoming/sintel.mpg (sorry it's rather large)


More information about the ffmpeg-user mailing list