Created
December 28, 2011 12:09
-
-
Save cstroie/1527749 to your computer and use it in GitHub Desktop.
MMCH comverter 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 | |
D="output" | |
mkdir -p "$D" | |
if [ ! "$1" ] | |
then | |
echo "Usage: $0 <file>" | |
exit 1 | |
fi | |
I="$1" | |
B="${I##*/}" | |
N="${B%.*}" | |
X="${B##*.}" | |
A="$D/$N.wav" | |
T="$D/$N.$X" | |
O="$D/$N.mp4" | |
# Extract audio | |
ffmpeg -i "$I" "$A" | |
# Normalize audio | |
normalize-audio "$A" | |
# Create temporary video | |
ffmpeg -i "$I" -i "$A" -acodec copy -vcodec copy "$T" | |
# Encode the output video | |
HandBrakeCLI -e x264 -S 175 -2 -E faac -B 160 -X 640 -5 -i "$T" -o "$O" | |
# Remove temporary files | |
rm "$A" "$T" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment