From 56d13bcea966c877638845a39470e58ad32412a0 Mon Sep 17 00:00:00 2001 From: esche Date: Sat, 8 Jul 2023 00:14:20 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- to_opus.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/to_opus.sh b/to_opus.sh index 876d5e4..054eea2 100644 --- a/to_opus.sh +++ b/to_opus.sh @@ -18,19 +18,16 @@ print_help() { printf "Help: not implemented yet" } -delete="false" while getopts 'e:dh' flag; do case "${flag}" in e) extension+=("$OPTARG");; - d) delete="true";; + d) delete=true;; h) print_help exit 0;; *) exit 1 ;; esac done -echo "$delete" - # write array into string extension="${extension[*]}" # change separator @@ -61,10 +58,10 @@ for file in **/*.@($extension); do is_video=$(ffprobe -v error -select_streams V -show_entries stream=codec_type "$file") if [[ ${#channels[@]} -gt 1 || -n "$is_video" ]]; then ffmpeg -i "$file" -map 0 -map -0:d -map -0:t -c copy -c:a libopus $bitrate_settings-v info -hide_banner "${file%.*}.mkv" && - if [[ "$delete"=true ]]; then rm "$file"; fi + if [[ "$delete" = true ]]; then rm "$file"; fi else ffmpeg -i "$file" $bitrate_settings-v info -hide_banner "${file%.*}.opus" && - if [[ "$delete"=true ]]; then rm "$file"; fi + if [[ "$delete" = true ]]; then rm "$file"; fi fi done