From e759f8c3cda19a5911b71fcf3836b80764c46c54 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Sat, 5 Aug 2023 17:48:49 -0400 Subject: [PATCH] Add some missing -y -stats -loglevel params to various ffmpeg commands --- dotfiles/bin/change-video-volume | 2 +- dotfiles/bin/convert-video-avi-to-mp4 | 2 +- dotfiles/bin/fix-audio-in-one-channel | 2 +- dotfiles/bin/join-video | 2 +- dotfiles/bin/join-video-fast | 2 +- dotfiles/bin/normalize-video-volume | 2 +- dotfiles/bin/remove-audio-from-video | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dotfiles/bin/change-video-volume b/dotfiles/bin/change-video-volume index 96557bc..e40a2e0 100644 --- a/dotfiles/bin/change-video-volume +++ b/dotfiles/bin/change-video-volume @@ -51,7 +51,7 @@ fi printf "\n${YELLOW}${BOLD}Modifying audio volume in $filename.$extension | output: $output | delta: $delta_db${NORMAL}\n" # Since we're re-encoding the audio we have to specify a codec to use. -cmd="ffmpeg -i \"$filename.$extension\" -af \"volume=${delta_db}dB\" -c:v copy -c:a aac -map 0 \"$output\"" +cmd="ffmpeg -y -stats -loglevel level+error -i \"$filename.$extension\" -af \"volume=${delta_db}dB\" -c:v copy -c:a aac -map 0 \"$output\"" printf "\n${BOLD}Running: $cmd\n\n${NORMAL}" eval $cmd diff --git a/dotfiles/bin/convert-video-avi-to-mp4 b/dotfiles/bin/convert-video-avi-to-mp4 index bbbe574..6905681 100644 --- a/dotfiles/bin/convert-video-avi-to-mp4 +++ b/dotfiles/bin/convert-video-avi-to-mp4 @@ -47,5 +47,5 @@ else fi printf "\n${YELLOW}${BOLD}Encoding '$filename.$extension' with target bitrate $bitrate | output: $output${NORMAL}\n" -ffmpeg -i "$filename.$extension" -c:a aac -c:v mpeg4 -b:v $bitrate "$output" +ffmpeg -y -stats -loglevel level+error -i "$filename.$extension" -c:a aac -c:v mpeg4 -b:v $bitrate "$output" printf "\n${GREEN}${BOLD}Done encoding '$filename.$extension' to '$output'${NORMAL}\n\n" diff --git a/dotfiles/bin/fix-audio-in-one-channel b/dotfiles/bin/fix-audio-in-one-channel index c795523..6912b1d 100644 --- a/dotfiles/bin/fix-audio-in-one-channel +++ b/dotfiles/bin/fix-audio-in-one-channel @@ -45,7 +45,7 @@ fi printf "\n${YELLOW}${BOLD}Repairing audio in $filename.$extension | output: $output${NORMAL}\n" -ffmpeg -i "$filename.$extension" -c:v copy -ac 1 -map 0 "$output" +ffmpeg -y -stats -loglevel level+error -i "$filename.$extension" -c:v copy -ac 1 -map 0 "$output" printf "\n${GREEN}${BOLD}Done repairing audio in $filename.$extension | output: $output${NORMAL}\n\n" diff --git a/dotfiles/bin/join-video b/dotfiles/bin/join-video index 7bd094c..a58dab9 100644 --- a/dotfiles/bin/join-video +++ b/dotfiles/bin/join-video @@ -37,7 +37,7 @@ output="${output_name}.mp4" printf "\n${YELLOW}${BOLD}Joining contents of '$filename'| output: $output${NORMAL}\n" -ffmpeg -f concat -safe 0 -accurate_seek -i "$filename.$extension" -c:v libx264 -c:a copy "$output" +ffmpeg -y -stats -loglevel level+error -f concat -safe 0 -accurate_seek -i "$filename.$extension" -c:v libx264 -c:a copy "$output" printf "\n${GREEN}${BOLD}Finished joining${NORMAL}\n\n" diff --git a/dotfiles/bin/join-video-fast b/dotfiles/bin/join-video-fast index 3928dd7..bbfc24c 100644 --- a/dotfiles/bin/join-video-fast +++ b/dotfiles/bin/join-video-fast @@ -40,7 +40,7 @@ output="${output_name}.mp4" printf "\n${YELLOW}${BOLD}Joining contents of '$filename'| output: $output${NORMAL}\n" -ffmpeg -f concat -safe 0 -i "$filename" -c copy "$output" +ffmpeg -y -stats -loglevel level+error -f concat -safe 0 -i "$filename" -c copy "$output" printf "\n${GREEN}${BOLD}Finished joining${NORMAL}\n\n" diff --git a/dotfiles/bin/normalize-video-volume b/dotfiles/bin/normalize-video-volume index 0628636..d5168fa 100644 --- a/dotfiles/bin/normalize-video-volume +++ b/dotfiles/bin/normalize-video-volume @@ -68,7 +68,7 @@ it=`grep \"input_thresh\" $temp_file | cut -d: -f2 | tr -cd [:digit:].-` to=`grep \"target_offset\" $temp_file | cut -d: -f2 | tr -cd [:digit:].-` # 2nd pass: -cmd="ffmpeg -i \"$filename.$extension\" -c:v copy -pass 2 -filter:a loudnorm=linear=true:I=-16:LRA=11:tp=-1.5:measured_I=$ii:measured_LRA=$ilra:measured_tp=$itp:measured_thresh=$it:offset=$to:print_format=summary -map 0 \"$output\"" +cmd="ffmpeg -y -stats -loglevel level+error -i \"$filename.$extension\" -c:v copy -pass 2 -filter:a loudnorm=linear=true:I=-16:LRA=11:tp=-1.5:measured_I=$ii:measured_LRA=$ilra:measured_tp=$itp:measured_thresh=$it:offset=$to:print_format=summary -map 0 \"$output\"" printf "${BOLD}Re-encoding audio:\n$cmd\n\n${NORMAL}" eval $cmd diff --git a/dotfiles/bin/remove-audio-from-video b/dotfiles/bin/remove-audio-from-video index 94d3c57..d20446b 100644 --- a/dotfiles/bin/remove-audio-from-video +++ b/dotfiles/bin/remove-audio-from-video @@ -43,7 +43,7 @@ fi printf "\n${YELLOW}${BOLD}Removing audio from '$filename.$extension' | output: '$output'${NORMAL}\n" # -an removes the audio. -ffmpeg -i "$filename.$extension" -c:v copy -an -map 0 "$output" +ffmpeg -y -stats -loglevel level+error -i "$filename.$extension" -c:v copy -an -map 0 "$output" printf "\n${GREEN}${BOLD}Done removing audio from '$filename.$extension' | output: '$output'${NORMAL}\n\n"