[FFmpeg-trac] #2263(undetermined:new): MKV: keyframe not used when using -ss on input?

FFmpeg trac at avcodec.org
Tue Feb 12 15:50:27 CET 2013


#2263: MKV: keyframe not used when using -ss on input?
-------------------------------------+-------------------------------------
             Reporter:  eelco        |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:  mkv h264     |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 I have an MKV file for which using -ss is very slow. It plays fine in
 players like VLC and MplayerX.

 Normally, FFmpeg jumps to the keyframe before the seeking point and starts
 decoding from there. With this file, it seems to start at the beginning.

 The sample file included is the first 15MB of a larger file. Seeking to a
 later point in the file is even slower.

 ffprobe information (note there is a keyframe at 10.427)
 {{{
 > ./ffprobe -of compact -show_frames ~/Desktop/ffmpeg-ss-bug/slow-ss.mkv |
 grep 'video|key_frame=1'
 ffprobe version N-49823-g7ff1a4b Copyright (c) 2007-2013 the FFmpeg
 developers
   built on Feb 12 2013 15:45:24 with llvm-gcc 4.2.1 (LLVM build
 2336.11.00)
   configuration: --prefix=/Users/eelco/Projects/Beamer/FFmpeg/build
 --enable-gpl --enable-version3 --enable-libx264 --disable-shared --enable-
 static --enable-libtheora --enable-libvorbis --enable-libvo-aacenc
 --disable-doc --extra-cflags='-DMACOSX_DEPLOYMENT_TARGET=10.6 -isysroot
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
 -mmacosx-version-min=10.6
 -I/Users/eelco/Projects/Beamer/FFmpeg/build/include' --extra-
 ldflags='-isysroot
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
 -mmacosx-version-min=10.6 -L/Users/eelco/Projects/Beamer/FFmpeg/build/lib'
   libavutil      52. 17.101 / 52. 17.101
   libavcodec     54. 91.102 / 54. 91.102
   libavformat    54. 62.100 / 54. 62.100
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 37.101 /  3. 37.101
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, matroska,webm, from '/Users/eelco/Desktop/ffmpeg-ss-bug/slow-
 ss.mkv':
   Metadata:
     creation_time   : 2012-12-09 16:32:15
   Duration: 01:33:24.19, start: 0.000000, bitrate: 21 kb/s
     Chapter #0.0: start 0.000000, end 316.316000
     Metadata:
       title           : 00:00:00.000
     Chapter #0.1: start 316.316000, end 651.985000
     Metadata:
       title           : 00:05:16.316
     Chapter #0.2: start 651.985000, end 1186.310000
     Metadata:
       title           : 00:10:51.985
     Chapter #0.3: start 1186.310000, end 1669.835000
     Metadata:
       title           : 00:19:46.310
     Chapter #0.4: start 1669.835000, end 1970.552000
     Metadata:
       title           : 00:27:49.835
     Chapter #0.5: start 1970.552000, end 2434.974000
     Metadata:
       title           : 00:32:50.552
     Chapter #0.6: start 2434.974000, end 2811.976000
     Metadata:
       title           : 00:40:34.974
     Chapter #0.7: start 2811.976000, end 3120.534000
     Metadata:
       title           : 00:46:51.976
     Chapter #0.8: start 3120.534000, end 3535.157000
     Metadata:
       title           : 00:52:00.534
     Chapter #0.9: start 3535.157000, end 3623.411000
     Metadata:
       title           : 00:58:55.157
     Chapter #0.10: start 3623.411000, end 3859.314000
     Metadata:
       title           : 01:00:23.411
     Chapter #0.11: start 3859.314000, end 4259.672000
     Metadata:
       title           : 01:04:19.314
     Chapter #0.12: start 4259.672000, end 4530.317000
     Metadata:
       title           : 01:10:59.672
     Chapter #0.13: start 4530.317000, end 4869.782000
     Metadata:
       title           : 01:15:30.317
     Chapter #0.14: start 4869.782000, end 4968.630000
     Metadata:
       title           : 01:21:09.782
     Chapter #0.15: start 4968.630000, end 5604.192000
     Metadata:
       title           : 01:22:48.630
     Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080, SAR 1:1 DAR
 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
     Stream #0:1(eng): Audio: truehd, 48000 Hz, 7.1, s32
     Metadata:
       title           : English TRUE-HD
     Stream #0:2(swe): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
 (default)
     Metadata:
       title           : Swedish AC3
     Stream #0:3(swe): Subtitle: dvd_subtitle (default)
     Metadata:
       title           : Swedish
     Stream #0:4(eng): Subtitle: dvd_subtitle
     Metadata:
       title           : English
 frame|media_type=video|key_frame=1|pkt_pts=0|pkt_pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|pkt_duration=N/A|pkt_duration_time=N/A|pkt_pos=6670|pkt_size=148182|width=1920|height=1080|pix_fmt=yuv420p|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|reference=3
 frame|media_type=video|key_frame=1|pkt_pts=10427|pkt_pts_time=10.427000|pkt_dts=10427|pkt_dts_time=10.427000|pkt_duration=41|pkt_duration_time=0.041000|pkt_pos=13743718|pkt_size=99527|width=1920|height=1080|pix_fmt=yuv420p|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=250|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|reference=3
 [matroska,webm @ 0x101806600] Read error
 }}}

 timing of -ss (about 6-8x slower than other MKVs)
 {{{
 > time ./ffmpeg "-ss" "11" "-i" ~/Desktop/ffmpeg-ss-bug/slow-ss.mkv  "-f"
 "image2" "-vframes" "1" /dev/null
 ffmpeg version N-49823-g7ff1a4b Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Feb 12 2013 15:45:24 with llvm-gcc 4.2.1 (LLVM build
 2336.11.00)
   configuration: --prefix=/Users/eelco/Projects/Beamer/FFmpeg/build
 --enable-gpl --enable-version3 --enable-libx264 --disable-shared --enable-
 static --enable-libtheora --enable-libvorbis --enable-libvo-aacenc
 --disable-doc --extra-cflags='-DMACOSX_DEPLOYMENT_TARGET=10.6 -isysroot
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
 -mmacosx-version-min=10.6
 -I/Users/eelco/Projects/Beamer/FFmpeg/build/include' --extra-
 ldflags='-isysroot
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
 -mmacosx-version-min=10.6 -L/Users/eelco/Projects/Beamer/FFmpeg/build/lib'
   libavutil      52. 17.101 / 52. 17.101
   libavcodec     54. 91.102 / 54. 91.102
   libavformat    54. 62.100 / 54. 62.100
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 37.101 /  3. 37.101
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, matroska,webm, from '/Users/eelco/Desktop/ffmpeg-ss-bug/slow-
 ss.mkv':
   Metadata:
     creation_time   : 2012-12-09 16:32:15
   Duration: 01:33:24.19, start: 0.000000, bitrate: 21 kb/s
     Chapter #0.0: start 0.000000, end 316.316000
     Metadata:
       title           : 00:00:00.000
     Chapter #0.1: start 316.316000, end 651.985000
     Metadata:
       title           : 00:05:16.316
     Chapter #0.2: start 651.985000, end 1186.310000
     Metadata:
       title           : 00:10:51.985
     Chapter #0.3: start 1186.310000, end 1669.835000
     Metadata:
       title           : 00:19:46.310
     Chapter #0.4: start 1669.835000, end 1970.552000
     Metadata:
       title           : 00:27:49.835
     Chapter #0.5: start 1970.552000, end 2434.974000
     Metadata:
       title           : 00:32:50.552
     Chapter #0.6: start 2434.974000, end 2811.976000
     Metadata:
       title           : 00:40:34.974
     Chapter #0.7: start 2811.976000, end 3120.534000
     Metadata:
       title           : 00:46:51.976
     Chapter #0.8: start 3120.534000, end 3535.157000
     Metadata:
       title           : 00:52:00.534
     Chapter #0.9: start 3535.157000, end 3623.411000
     Metadata:
       title           : 00:58:55.157
     Chapter #0.10: start 3623.411000, end 3859.314000
     Metadata:
       title           : 01:00:23.411
     Chapter #0.11: start 3859.314000, end 4259.672000
     Metadata:
       title           : 01:04:19.314
     Chapter #0.12: start 4259.672000, end 4530.317000
     Metadata:
       title           : 01:10:59.672
     Chapter #0.13: start 4530.317000, end 4869.782000
     Metadata:
       title           : 01:15:30.317
     Chapter #0.14: start 4869.782000, end 4968.630000
     Metadata:
       title           : 01:21:09.782
     Chapter #0.15: start 4968.630000, end 5604.192000
     Metadata:
       title           : 01:22:48.630
     Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080, SAR 1:1 DAR
 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
     Stream #0:1(eng): Audio: truehd, 48000 Hz, 7.1, s32
     Metadata:
       title           : English TRUE-HD
     Stream #0:2(swe): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
 (default)
     Metadata:
       title           : Swedish AC3
     Stream #0:3(swe): Subtitle: dvd_subtitle (default)
     Metadata:
       title           : Swedish
     Stream #0:4(eng): Subtitle: dvd_subtitle
     Metadata:
       title           : English
 Output #0, image2, to '/dev/null':
   Metadata:
     encoder         : Lavf54.62.100
     Chapter #0.0: start 0.000000, end 305.316000
     Metadata:
       title           : 00:00:00.000
     Chapter #0.1: start 305.316000, end 640.985000
     Metadata:
       title           : 00:05:16.316
     Chapter #0.2: start 640.985000, end 1175.310000
     Metadata:
       title           : 00:10:51.985
     Chapter #0.3: start 1175.310000, end 1658.835000
     Metadata:
       title           : 00:19:46.310
     Chapter #0.4: start 1658.835000, end 1959.552000
     Metadata:
       title           : 00:27:49.835
     Chapter #0.5: start 1959.552000, end 2423.974000
     Metadata:
       title           : 00:32:50.552
     Chapter #0.6: start 2423.974000, end 2800.976000
     Metadata:
       title           : 00:40:34.974
     Chapter #0.7: start 2800.976000, end 3109.534000
     Metadata:
       title           : 00:46:51.976
     Chapter #0.8: start 3109.534000, end 3524.157000
     Metadata:
       title           : 00:52:00.534
     Chapter #0.9: start 3524.157000, end 3612.411000
     Metadata:
       title           : 00:58:55.157
     Chapter #0.10: start 3612.411000, end 3848.314000
     Metadata:
       title           : 01:00:23.411
     Chapter #0.11: start 3848.314000, end 4248.672000
     Metadata:
       title           : 01:04:19.314
     Chapter #0.12: start 4248.672000, end 4519.317000
     Metadata:
       title           : 01:10:59.672
     Chapter #0.13: start 4519.317000, end 4858.782000
     Metadata:
       title           : 01:15:30.317
     Chapter #0.14: start 4858.782000, end 4957.630000
     Metadata:
       title           : 01:21:09.782
     Chapter #0.15: start 4957.630000, end 5593.192000
     Metadata:
       title           : 01:22:48.630
     Stream #0:0(eng): Video: mjpeg, yuvj420p, 1920x1080 [SAR 1:1 DAR
 16:9], q=2-31, 200 kb/s, 90k tbn, 23.98 tbc (default)
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> mjpeg)
 Press [q] to stop, [?] for help
 frame=    1 fps=0.5 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A dup=0
 drop=262
 video:47kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 -100.045473%
         2.20 real         6.15 user         0.13 sys
 }}}

 See also #2245.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2263>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list