[Libav-user] Seeking during trimming command takes quite a while

Simon Daniels simondaniels23 at gmail.com
Mon Jan 30 19:28:53 CET 2012


Hello,

I'm using the -ss and -t flags to trim a section of video out of a
longer original one. As an example, if the video is 60 minutes long,
and I want minutes 50-52, ffmpeg takes quite a while to get to that
point. I'll see something like the following (I know my -ss flag
values don't exactly match my example)

Users-MacBook-Pro:ffmpeg-0.10 user$ ./ffmpeg -i "Long GOPRO.MP4"
-vcodec copy -acodec copy -ss 0:05:10 -t 0:00:30 "output1.mp4"
ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan 30 2012 11:07:22 with llvm_gcc 4.2.1 (Based on Apple
Inc. build 5658) (LLVM build 2336.1.00)
  configuration: --enable-static --disable-shared --disable-outdev=sdl
--enable-runtime-cpudetect --disable-bzlib --disable-libfreetype
--disable-libopenjpeg --enable-zlib --arch=x86_64
--sysroot=/Developer/SDKs/MacOSX10.7.sdk --extra-cflags='-isysroot
/Developer/SDKs/MacOSX10.7.sdk -DMACOSX_DEPLOYMENT_TARGET=10.5
-mmacosx-version-min=10.5'
  libavutil      51. 34.101 / 51. 34.101
  libavcodec     53. 60.100 / 53. 60.100
  libavformat    53. 31.100 / 53. 31.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 60.100 /  2. 60.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Long GOPRO.MP4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 2011-07-09 14:44:04
  Duration: 00:34:39.07, start: 0.000000, bitrate: 15151 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], 15008 kb/s, 59.94 fps, 59.94 tbr, 90k
tbn, 119.88 tbc
    Metadata:
      creation_time   : 2011-07-09 14:44:04
      handler_name    : 	GoPro AVC
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz,
stereo, s16, 128 kb/s
    Metadata:
      creation_time   : 2011-07-09 14:44:04
      handler_name    : 	GoPro AAC
Output #0, mp4, to 'output1.mp4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 2011-07-09 14:44:04
    encoder         : Lavf53.31.100
    Stream #0:0(eng): Video: h264 (![0][0][0] / 0x0021), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], q=2-31, 15008 kb/s, 59.94 fps, 90k tbn,
90k tbc
    Metadata:
      creation_time   : 2011-07-09 14:44:04
      handler_name    : 	GoPro AVC
    Stream #0:1(eng): Audio: aac (@[0][0][0] / 0x0040), 48000 Hz,
stereo, 128 kb/s
    Metadata:
      creation_time   : 2011-07-09 14:44:04
      handler_name    : 	GoPro AAC
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=    0 fps=  0 q=-1.0 q=-1.0 q=-1.0 size=       0kB
time=00:00:00.00 bitrate=   0
frame=  212 fps= 25 q=-1.0 q=-1.0 q=-1.0 size=    6632kB
time=00:00:00.00 bitrate=   0
frame=  482 fps= 53 q=-1.0 q=-1.0 q=-1.0 size=   14892kB
time=00:00:00.00 bitrate=   0
frame=  781 fps= 81 q=-1.0 q=-1.0 q=-1.0 size=   24175kB
time=00:00:03.30 bitrate=5989
...


My complaint is that ffmpeg will spew out "frame=    0 fps=  0 q=-1.0
q=-1.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=   0" for
several minutes until it reaches the point at which it should start
trimming. The farther the point of trimming, the longer it takes to
seek to that point.

Is there any way to speed this up? If I play the video manually, I can
jump to minute 50 instantly by dragging the playhead. Therefore, why
does ffmpeg take so long to get there?

Thanks in advance!

Simon


More information about the Libav-user mailing list