-
Notifications
You must be signed in to change notification settings - Fork 2
Tips: To extract cut by time
This can be easily done using the "-t" option. Take a look at the example.
$ ffmpeg -i input.fmt1 -t 30 output.fmt2
The time specified is in seconds. But the format hh.mm.ss is also supported. This command will convert the first 30 seconds of the file input.fmt2 into output.fmt2.
To trim down a video to smaller clip using start and stop times, we can use the following command.
$ ffmpeg -i input.mp4 -ss 00:00:50 -codec copy -t 50 output.mp4
Here,
-
–ss– Indicates the starting time of the video clip. In our example, starting time is the 50th second. -
-t– Indicates the total time duration.
This is very helpful when you want to cut a part from an audio or video file using starting and ending time.
Similarly, we can trim down the audio file like below.
$ ffmpeg -i audio.mp3 -ss 00:01:54 -t 00:06:53 -c copy output.mp3
$ ffcvt -f tears_of_steel_720p.mov -force -o ' -t 30'
(Note the space before -t is necessary)
or,
$ ffcvt -f tears_of_steel_720p.mov -force -- -ss 00:01:50 -t 30
Sometimes, using start and stop times instead of start time and duration is more convenient, especially when you get those times when playing the video. In such case replace the -t duration with the -to stop_time in the above step.
Note, from ffmpeg -help:
-t duration record or transcode "duration" seconds of audio/video
-to time_stop record or transcode stop time