Advertisement
Guest User

Untitled

a guest
Apr 18th, 2021
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.82 KB | None | 0 0
  1. #!/bin/bash
  2. function asdf(){
  3.     mv "$1" "$1 (backup)"
  4.     ffmpeg -i "$1 (backup)" -map 0 -map -0:a:1 -c copy "$1"
  5. }
  6.  
  7. if (( $# >= 1 ));then
  8.     export -f asdf
  9.     echo "The second audio track will be removed from the following files:"
  10.     find "$1" -iname *".mp4"
  11.     echo "Continue? [ y / n ]"
  12.     read qwer
  13.     if [[ "$qwer" == "y"* ]] || [[ "$qwer" == "Y"* ]]; then
  14.         find "$1" -iname *".mp4" -exec bash -c "asdf \"{}\"" \;
  15.     else
  16.         echo "Canceled."
  17.     fi
  18. else
  19.     echo "Usage: $0 <Destroy All Humans! dir>"
  20.     echo "This will find and remove the second audio track(the German track) from all videos in the given directory (Destroy All Humans!)."
  21.     echo "A backup of each video will be made first and appended with \"(backup)\", in case something goes wrong."
  22.     echo "You are free to delete the backups if everything is working just fine."
  23. fi
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement