Created
March 29, 2020 00:02
-
-
Save nramsbottom/a4c9d0732b5823d2c0f9a634774f737f to your computer and use it in GitHub Desktop.
Rebuild MP4
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 | |
# this is a script that was made to extract the video and *second* audio stream | |
# from an all the mp4 files in the current directory and rebuild them to contain | |
# just the video and the second audio stream | |
for filename in *.avi; do | |
ffmpeg -y -i "$filename" -an -vcodec copy video.mp4 | |
ffmpeg -y -i "$filename" -map 0:2 -vn -acodec copy audio.mp3 | |
mv "$filename" "$filename.old" | |
ffmpeg -i video.mp4 -i audio.mp3 -vcodec copy -acodec copy "$filename" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment