Changes between Version 20 and Version 21 of Seeking
- Timestamp:
- Nov 30, 2015, 9:01:35 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Seeking
v20 v21 55 55 To 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. 56 56 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: 57 Note 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 59 The first command will cut from 00:01:00 to 00:03:00 (in the original), using the faster seek.[[BR]] 60 The second command will cut from 00:01:00 to 00:02:00, as intended, using the slower seek.[[BR]] 61 The third command will cut from 00:01:00 to 00:02:00, as intended, using the faster seek. 62 58 63 {{{ 59 64 ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c copy cut.mp4 60 65 ffmpeg -i video.mp4 -ss 00:01:00 -to 00:02:00 -c copy cut.mp4 66 ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c copy -copyts cut.mp4 61 67 }}} 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.64 68 65 69 If 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] .
