7
2
I am using below command for having 15sec - 45 sec range of music but sample.m4a file is starting from 15 sec to 60 sec. Am i using wrong syntax or why it is so ?
ffmpeg -ss 00:00:15 -t 00:00:45 -i song.m4a -acodec copy sample.m4a
7
2
I am using below command for having 15sec - 45 sec range of music but sample.m4a file is starting from 15 sec to 60 sec. Am i using wrong syntax or why it is so ?
ffmpeg -ss 00:00:15 -t 00:00:45 -i song.m4a -acodec copy sample.m4a
16
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
2
Use -to instead of -t: -to specifies the end time, -t specifies the duration...
Say you'd like to grab 30 seconds starting from 00:00:15, you can either specify the start time and the duration...
-ss 00:00:15 -t 00:00:30
... or specify the start time and end time...
-ss 00:00:15 -to 00:00:45
... Both will grab the same 30 seconds of video.
1Please make the relation between
-to
,-t:
and-t
more clear. – peterh - Reinstate Monica – 2019-11-30T13:45:00.363