strip_track_except: add a new script
This commit is contained in:
parent
e6bd94c27d
commit
ec5f7d9379
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
colorprint() {
|
||||||
|
echo -e "\e[31m${1}\e[0m"
|
||||||
|
}
|
||||||
|
SCRIPT_NAME=$(basename "$0")
|
||||||
|
test -z "${1}" && echo "File not specified or doesn't exist, aborting. Usage: $SCRIPT_NAME \$FILENAME \$LANGUAGE_TO_KEEP" && exit 1
|
||||||
|
FILENAME=$1
|
||||||
|
# default language to keep is second parameter, or japanese if unspecified
|
||||||
|
LANGUAGE_TO_KEEP="${2:-jpn}"
|
||||||
|
echo -n "Processing "
|
||||||
|
colorprint "$FILENAME"
|
||||||
|
FILENAME_WITHOUT_EXT=${FILENAME%.*}
|
||||||
|
ffmpeg -i "$FILENAME" -map 0:v -map 0:a:m:language:${LANGUAGE_TO_KEEP} -map 0:s -c copy "${FILENAME_WITHOUT_EXT}.converted.mkv"
|
Loading…
Reference in New Issue