[FFmpeg-trac] #2245(undetermined:closed): Speed difference when using -ss on similar MKVs when extracting frame image

FFmpeg trac at avcodec.org
Thu Feb 7 14:44:22 CET 2013


#2245: Speed difference when using -ss on similar MKVs when extracting frame image
-------------------------------------+-------------------------------------
             Reporter:  eelco        |                    Owner:
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:  h264 mkv     |               Resolution:  invalid
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by eelco):

 Interesting. I hadn’t looked at that yet. I saw that the “slow” sample
 also has a keyframe at ~10.5 seconds and seeking to 11 seconds is indeed
 fast. However, when I try the same on the original file, it is still slow.
 (I created the slow file using the -t option and using the copy codec.)

 I’ve created a new sample with dd that ''does'' have the same problem as
 the original file though.

 This is the keyframe information:

 {{{
 > ./ffprobe -of compact -show_frames ~/Desktop/ffmpeg-ss-bug/2245-slow-ss-
 dd.mkv | grep 'video|key_frame=1'
 ... (still the same ffmpeg version)
 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
 }}}

 Since there is a keyframe at 10.427, I’d expect getting the image at 11
 seconds would be pretty fast, but it isn’t:

 {{{
 time ./ffmpeg "-ss" "11" "-i" ~/Desktop/ffmpeg-ss-bug/2245-slow-ss-dd.mkv
 "-f" "image2" "-vframes" "1" /dev/null
 ffmpeg version N-49666-g4745194 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Feb  7 2013 10:22:14 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.101 / 54. 91.101
   libavformat    54. 61.104 / 54. 61.104
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 35.101 /  3. 35.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/2245
 -slow-ss-dd.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.61.104
     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.14 real         6.04 user         0.10 sys
 }}}

 I’ve uploaded the file to the FTP.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2245#comment:3>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list