diff --git a/to_opus.sh b/to_opus.sh index c06c518..c418a0f 100644 --- a/to_opus.sh +++ b/to_opus.sh @@ -18,9 +18,10 @@ print_help() { printf "Help: not implemented yet" } -while getopts 'e:' flag; do +while getopts 'e:dh' flag; do case "${flag}" in e) extension+=("$OPTARG");; + d) delete="true";; h) print_help exit 0;; *) exit 1 ;; @@ -40,14 +41,11 @@ for file in **/*.@($extension); do readarray -t channels <<<"$(ffprobe -v error -select_streams a -show_entries stream=channels -of compact=p=0:nk=1 "$file")" # array over the bitrates of all streams readarray -t bitrates <<<"$(ffprobe -v error -select_streams a -show_entries stream=bit_rate -of compact=p=0:nk=1 "$file")" - # number of audiostreams - audiostreams=${#channels[@]} # set a channel dependend bitrate for every audio stream # https://wiki.xiph.org/Opus_Recommended_Settings # to use ffmpegs default just comment out this block - bitrate_settings="" - for ((index=0; index