Last active
April 4, 2020 00:00
-
-
Save berndverst/6308d9427e5df935dbe331c135e82502 to your computer and use it in GitHub Desktop.
Trimming videos instantly without reencoding using FFmpeg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFILE="video.mp4" | |
OUTFILE="shortenedclip.mp4" | |
START="00:00:12.35" # Start Time in hh:mm:ss.msec format | |
DURATION="00:01:05.4" # Duration in hh:mm:ss.msec format | |
################## Alternative format ################## | |
# START="12.35" # Start time in s.msec format # | |
# DURATION="65.4" # Duration time in s.msec format # | |
######################################################## | |
ffmpeg -ss $START -i $INFILE -c copy -map 0 -t $DURATION $OUTFILE | |
# If you prefer you can also specify an end time similar to the start time | |
END="00:01:12.75" | |
ffmpeg -ss $START -i $INFILE -c copy -map 0 -to $END $OUTFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment