Commit 0baeb052 authored by Stefan Westerfeld's avatar Stefan Westerfeld

videowmark: avoid displaying codec in quiet mode

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent b04da0a2
...@@ -72,11 +72,12 @@ eval set -- "$GETOPT_TEMP" ...@@ -72,11 +72,12 @@ eval set -- "$GETOPT_TEMP"
AUDIOWMARK_ARGS=() AUDIOWMARK_ARGS=()
FFMPEG_VERBOSE="-v error" FFMPEG_VERBOSE="-v error"
QUIET=""
export AV_LOG_FORCE_NOCOLOR=1 # disable colored messages from ffmpeg export AV_LOG_FORCE_NOCOLOR=1 # disable colored messages from ffmpeg
while true; do while true; do
case "$1" in case "$1" in
-v | --verbose ) FFMPEG_VERBOSE="-v info"; shift ;; -v | --verbose ) FFMPEG_VERBOSE="-v info"; shift ;;
-q | --quiet ) AUDIOWMARK_ARGS+=("-q"); shift ;; -q | --quiet ) AUDIOWMARK_ARGS+=("-q"); QUIET=1; shift ;;
--key ) AUDIOWMARK_ARGS+=("--key" "$2"); shift 2 ;; --key ) AUDIOWMARK_ARGS+=("--key" "$2"); shift 2 ;;
--strength ) AUDIOWMARK_ARGS+=("--strength" "$2"); shift 2 ;; --strength ) AUDIOWMARK_ARGS+=("--strength" "$2"); shift 2 ;;
--help ) show_help_and_exit ;; --help ) show_help_and_exit ;;
...@@ -94,7 +95,7 @@ if [ "$1" == "add" ]; then ...@@ -94,7 +95,7 @@ if [ "$1" == "add" ]; then
# get audio as wav # get audio as wav
ffmpeg $FFMPEG_VERBOSE -y -i "$2" -f wav "$orig_wav" || die "extracting audio from video failed (ffmpeg)" ffmpeg $FFMPEG_VERBOSE -y -i "$2" -f wav "$orig_wav" || die "extracting audio from video failed (ffmpeg)"
# watermark # watermark
echo >&2 "Audio Codec: $(audio_encode_options "$2")" [ -z "$QUIET" ] && echo >&2 "Audio Codec: $(audio_encode_options "$2")"
audiowmark "${AUDIOWMARK_ARGS[@]}" add "$orig_wav" "$wm_wav" "$4" || die "watermark generation failed (audiowmark)" audiowmark "${AUDIOWMARK_ARGS[@]}" add "$orig_wav" "$wm_wav" "$4" || die "watermark generation failed (audiowmark)"
# rejoin # rejoin
ffmpeg $FFMPEG_VERBOSE -y -i "$2" -i "$wm_wav" -c:v copy $(audio_encode_options "$2") -map 0:v:0 -map 1:a:0 "$3" || \ ffmpeg $FFMPEG_VERBOSE -y -i "$2" -i "$wm_wav" -c:v copy $(audio_encode_options "$2") -map 0:v:0 -map 1:a:0 "$3" || \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment