Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/kasper9n/my-bash-scripts. My personal bash scripts
Something went wrong. Try again.
621 B · 30 lines
at master
12345678910111213141516171819202122232425262728293031#! /bin/bash
help() { echo "`color 2 Usage:` remove-audio <file>" echo ""}
FILE="$1"
if [[ "$#" < 1 ]]; then help; exit 0; fi
if [[ "$FILE" == "--help" || "$FILE" == "-h" ]]; then help; exit 0fi
FILE_WITHOUT_EXT="${FILE%.*}"FILE_EXT="${FILE##*.}"
COUNT=1NEW_FILE="$FILE_WITHOUT_EXT without audio.$FILE_EXT"while [[ -f "$NEW_FILE" ]]; do if [[ -f "$NEW_FILE" ]]; then NEW_FILE="$FILE_WITHOUT_EXT without audio ($COUNT).$FILE_EXT" (( COUNT++ )) else break fidone
ffmpeg -i "$FILE" -c copy -an "$NEW_FILE" || { echo `color 1 Error:` Conversion failed; exit 1; }