Created
March 12, 2023 14:08
-
-
Save mrsarm/fcf772fa33209d247e98beb487e121cd to your computer and use it in GitHub Desktop.
Convert what ever video file to a compatible MP4 file that works on most devices.
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
#!/usr/bin/env bash | |
if [ "$1" == "-h" -o "$1" == "--help" -o "$#" == "0" ] | |
then | |
echo "Convert what ever video file to a compatible MP4 file" | |
echo "that works on most devices." | |
echo | |
echo "Usage: video2mp4.sh [FILE]" | |
exit | |
fi | |
FILE="$1" | |
ffmpeg -i "${FILE}" \ | |
-c:v libx264 \ | |
-crf 24 \ | |
-pix_fmt yuv420p \ | |
-tune film \ | |
-c:a aac \ | |
-b:a 128k \ | |
-ar 44100 \ | |
-vol 300 \ | |
-strict -2 \ | |
-speed fastest \ | |
"${FILE%.*}-converted.mp4" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another option is just use VLC > "Media" menu > "Convert / Save...".