Last active
November 22, 2017 04:49
-
-
Save dardo82/b48698b050bf81478071bec7277008d1 to your computer and use it in GitHub Desktop.
Edit video \w 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
#!/usr/local/bin/bash | |
# Edit video with ffmpeg | |
I=$1; F=${1##*/}; B=${F%.*}; shift; T=($@) | |
for p in ${T[@]}; do P=(${p/-/ }); N=${B}_[$p].ts | |
eval "ffmpeg -i $I -ss ${P[0]} -to ${P[1]} -c copy $N"; done | |
cat $B_*.ts > $B.ts; ffmpeg -i $B.ts -c copy ${B}_edit.mp4; rm -v $B*.ts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment