this post was submitted on 04 Dec 2024
14 points (100.0% liked)
Free and Open Source Software
18254 readers
38 users here now
If it's free and open source and it's also software, it can be discussed here. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would try the
-to
option with a negative duration. (I'm assuming negative duration counts from the end of the file instead of the beginning.)I think this is the easiest. But,
-to
can't do negative times. You need to nest a different comment inside the FFmpeg command to to the math.I think this might work to remove 2 seconds from the end of a video
ffmpeg -ss 0 -i in.mp4 -t $(( $(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 in.mp4 |cut -d\. -f1) - 2 )) -c copy out.mp4