Last active
October 21, 2020 20:23
-
-
Save petscheit/534b595009501a231ca85e4facd7b0dd to your computer and use it in GitHub Desktop.
This file contains 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
# ------------------------------------------------------------------------- | |
# convert .mov file into segments of .mp4 files. I use it to create 60 sec video for my insta cooking channel with one command | |
# vsplit "original.mov" segment_span_in_seconds # "$(( 1*59 ))" | |
# this is inefficient but it works and I don't want to dig deeper into ffmpeg | |
# ------------------------------------------------------------------------- | |
vsplit() { | |
SRC="$1" | |
ffmpeg -i "$SRC" -qscale 0 output.mp4 | |
ffmpeg -i output.mp4 -c:v libx264 -crf 22 -map 0 -segment_time ${2} -g 9 \ | |
-sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*9)" \ | |
-reset_timestamps 1 -f segment "segment_%03d.mp4" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment