Log in

View Full Version : Cutting from debut to x seconds before the end with ffmpeg


Music Fan
4th September 2016, 19:34
Hi,
I'd like to know if there is a way to cut videos keeping everything before a certain point located x seconds before the end, whatever the duration of the video.
The function -sseof allows to keep the end, from a certain point located x seconds before the end, but can't keep anything before.

It would be useful to make a batch (I know how to make a batch) to cut the end credits of lots of episodes with different durations (admitting end credits always have the same duration).

I found this which uses ffprobe ;
https://superuser.com/questions/657492/cut-last-30-seconds-off-ends-of-videos-using-ffmpeg-in-a-batch-file-in-windows
but I wonder if something simpler would be possible with only ffmpeg, for example by linking the functions -to and -sseof, but I don't know how to do this.

The idea is to make something like this ;
C:\ffmpeg\ffmpeg.exe "-to; -sseof -30" -i "P:\my video.mkv" -c copy "F:\my shorter video.mkv"
The problematic part is "-to; -sseof -30" which doesn't work.