Changes between Version 20 and Version 21 of Seeking


Ignore:
Timestamp:
Nov 30, 2015, 11:01:35 PM (4 years ago)
Author:
cbsrobot
Comment:

added -copyts option for seek

Legend:

Unmodified
Added
Removed
Modified
  • Seeking

    v20 v21  
    5555To extract only a small segment in the middle of a movie, it can be used in combination with `-t` which specifies the duration, like `-ss 60 -t 10` to capture from second 60 to 70. Or you can use the `-to` option to specify an out point, like `-ss 60 -to 70` to capture from second 60 to 70. `-t` and `-to` are mutually exclusive. If you use both, `-t` will be used.
    5656
    57 Note that if you specify `-ss` before `-i` only, the timestamps will be reset to zero, so `-t` and `-to` have the same effect:
     57Note that if you specify `-ss` before `-i` only, the timestamps will be reset to zero, so `-t` and `-to` have not the same effect. If you want to keep the original timestamps, add the `-copyts`option.
     58
     59The first command will cut from 00:01:00 to 00:03:00 (in the original), using the faster seek.[[BR]]
     60The second command will cut from 00:01:00 to 00:02:00, as intended, using the slower seek.[[BR]]
     61The third command will cut from 00:01:00 to 00:02:00, as intended, using the faster seek.
     62
    5863{{{
    5964ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c copy cut.mp4
    6065ffmpeg -i video.mp4 -ss 00:01:00 -to 00:02:00 -c copy cut.mp4
     66ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c copy -copyts cut.mp4
    6167}}}
    62 
    63 Here, the first command will cut from 00:01:00 to 00:03:00 (in the original), whereas the second command would cut from 00:01:00 to 00:02:00, as intended.
    6468
    6569If you cut with stream copy (`-c copy`) you need to use the [https://ffmpeg.org/ffmpeg-all.html#Format-Options -avoid_negative_ts 1] option if you want to use that segment with the [https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files#demuxer concat demuxer] .