Created
October 16, 2018 19:38
-
-
Save armando-basile/98618aec0450d81ce75bb1371cf6a79c to your computer and use it in GitHub Desktop.
bash script to use ffmpeg to merge MTS files and encode with x264
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
#!/bin/bash | |
# merge more mts file | |
actualdir="`pwd`" | |
if [ -z "$1" ]; then | |
echo -e "Nessun argomento trovato !!!\nDevi specificare la path della cartella degli MTS da unire\n" | |
fi | |
cd "$1" | |
FILES=`ls -1 *.MTS` | |
FILESVAR="" | |
# concatenamento dei nomi dei file MTS | |
for i in $FILES ; do | |
FILESVAR="$FILESVAR$i|" | |
done | |
# creazione del comando | |
ffmpeg -i "concat:$FILESVAR" -vf yadif -vcodec libx264 -preset slow -crf 19 -acodec aac -ab 320k -cutoff 22050 -sn out.mkv | |
# solo merge usa invece | |
#ffmpeg -i "concat:$FILESVAR" -vcodec copy -acodec aac -ab 320k -cutoff 22050 -sn out.mp4 | |
# ritorno alla cartella di origine | |
cd $actualdir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment