Last active
September 4, 2020 13:16
-
-
Save leganz/235b687249536afc35cef2b80d89d281 to your computer and use it in GitHub Desktop.
Convert m2t files in a folder to mp4
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
#!/bin/bash | |
SEARCH_DIR=$1; | |
echo "start converting all m2t video files in ${SEARCH_DIR}" | |
for entry in "$SEARCH_DIR"/* | |
do | |
if [[ ${entry: -4} == ".M2T" ]] | |
then | |
echo "start converting: ${entry}" | |
filename="${entry%.*}" | |
if [[ ! -e ${filename}.mp4 ]]; then | |
ffmpeg -i $entry -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" ${filename}.mp4 | |
fi | |
fi | |
done | |
echo "finished converting m2t files..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment