FFMPEG cut for time range

The -t flag sets duration.
So in case you want 15sec-45sec range you must set -t 00:00:30 (i.e. 45-15=30) and use -t parameter after filename for make it output parameter.

Full command will look like this:

ffmpeg -ss 00:00:15 -i song.m4a -t 00:00:30 -acodec copy sample.m4a

And alternatively

ffmpeg -ss 15 -i song.m4a -t 30 -acodec copy sample.m4a

Use -to instead of -t.

  1. -t specifies the duration
  2. -to specifies the end time

If you'd like to grab 30 seconds starting from 00:00:15, you can either:

1) Specify the start time and duration.

-ss 00:00:15 -t 00:00:30

2) Alternatively, specify the start time and end time.

-ss 00:00:15 -to 00:00:45

Both will grab the same 30 seconds of video.

Tags:

Ffmpeg