Changes between Version 13 and Version 14 of Seeking


Ignore:
Timestamp:
May 27, 2014, 11:54:39 PM (5 years ago)
Author:
llogan
Comment:

trivial nits; removed "multiple cuts at once" since it provided no info but only an external link

Legend:

Unmodified
Added
Removed
Modified
  • Seeking

    v13 v14  
    1515[[Image(out.jpg)]]
    1616
    17 This example will produce one image frame (out1.jpg) at the third minute from the beginning of the movie. The input will be parsed '''using keyframes''', which is '''very fast'''. As of FFmpeg 2.1, when transcoding with ffmpeg (i.e. not streamcopying), -ss is now accurate even when used as an input option. Previous behavior can be restored with the -noaccurate_seek option.
     17This example will produce one image frame (out1.jpg) at the third minute from the beginning of the movie. The input will be parsed '''using keyframes''', which is '''very fast'''. As of FFmpeg 2.1, when transcoding with `ffmpeg` (i.e. not [https://ffmpeg.org/ffmpeg.html#Stream-copy stream copying]), `-ss` is now accurate even when used as an input option. Previous behavior can be restored with the `-noaccurate_seek` option.
    1818
    1919= Slow seeking =
     
    4141[[Image(out.jpg)]]
    4242
    43 As of FFmpeg 2.1, combined seeking is still possible but I have yet to find a valid use case for it since -ss as an input option is now both fast and accurate.
     43As of FFmpeg 2.1, combined seeking is still possible but I have yet to find a valid use case for it since `-ss` as an input option is now both fast and accurate.
    4444
    4545This approach uses keyframes to seek until 00:02:30, and then seeks frame-by-frame until it reaches 00:03:00 (00:02:30 + 00:00:30)
     
    6363Here, 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.
    6464
    65 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] .
     65If 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] .
    6666
    6767Example:
     
    7070}}}
    7171
    72 == Timestamp syntax ==
     72== Time unit syntax ==
    7373
    74 Note that you can use two different formats, 00:02:30 or 150, i.e. `[HH:MM:SS]` or just seconds. They mean the same thing.  Also, if you use a fraction, like `02:30.05` this is interpreted as "5 100ths of a second" not as frame 5. For instance, `02:30.5` would be 2 minutes, 30 seconds, and a half a second.
     74Note that you can use two different time unit formats: sexagesimal (`HOURS:MM:SS.MICROSECONDS`, as in `01:23:45.678`), or in seconds. If a fraction is used, such as `02:30.05`, this is interpreted as "5 100ths of a second", not as frame 5. For instance, `02:30.5` would be 2 minutes, 30 seconds, and a half a second, which would be the same as using `150.5` in seconds.
    7575
    7676== Doing a bitstream copy gives me a broken file? ==
    7777
    78 If you use `-ss` with `-c:v copy`, the resulting bitstream might end up being choppy, not playable, or out of sync with the audio stream, since ffmpeg is forced to only use/split on i-frames.
    79 
    80 == Multiple cuts at once ==
    81 
    82 You can do do multiple splits with the same file as well, see [http://stackoverflow.com/questions/5651654/ffmpeg-how-to-split-video-efficiently How to split video efficiently], which may or may not save you time/CPU.
     78If you use `-ss` with `-c:v copy`, the resulting bitstream might end up being choppy, not playable, or out of sync with the audio stream, since `ffmpeg` is forced to only use/split on i-frames.