Last active
October 7, 2019 15:57
-
-
Save Padam87/7303685 to your computer and use it in GitHub Desktop.
Remove unnecessary audio streams from video files using ffmpeg.
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 | |
files=${1-"*.avi"}; | |
audio_stream=${2-"0:1"}; | |
video_stream=${3-"0:0"}; | |
output_dir=${4-output}; | |
echo -e "\e[0;33m"; | |
echo " Files: $files"; | |
echo "Video stream: $video_stream"; | |
echo "Audio stream: $audio_stream"; | |
echo " Output dir: $output_dir"; | |
echo -e "\e[0m"; | |
read -p "Continue? (y/n)" continue | |
case "$continue" in | |
y*) break;; | |
n*) exit;; | |
esac | |
mkdir $output_dir; | |
for f in $files; | |
do ffmpeg -i "$f" -map $video_stream -map $audio_stream -vcodec copy -acodec copy "$output_dir/$f"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@muchbetterbig 30 bucks to replace a one liner command is not a good deal if you ask me :)