Created
July 5, 2015 15:01
-
-
Save patmandenver/691f298a31829dadb35b to your computer and use it in GitHub Desktop.
override mp4 audio with mp3 audio
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 | |
echo "hi" | |
mp4Arr=(`find $PWD -maxdepth 1 -iname "*.mp4"`) | |
#Make Fixed Directory | |
mkdir fixed | |
for i in "${mp4Arr[@]}" | |
do | |
#Remove extentions | |
filename=$(basename $i) | |
extension="${filename##*.}" | |
filename="${filename%.*}" | |
echo Converting $filename | |
#Convert! This assumes files have .mp4 and .mp3 extensions | |
ffmpeg -i $filename.mp4 -i $filename.mp3 -c copy -map 0:v:0 -map 1:a:0 -shortest fixed/$filename.mp4 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment