slhck/ffmpeg-normalize

EXTRA_OUTPUT_OPTIONS are not parsed correctly: `-vbr` is parsed like `-v br`

homocomputeris opened this issue · 5 comments

⚠️ Please read this carefully and edit the example responses! If you do not fill out this information, your bug report may be closed without comment.

Checklist (please tick all boxes)

  • I am using the latest version of ffmpeg-normalize (run pip3 install --upgrade ffmpeg-normalize)
  • I am using the latest stable version of ffmpeg or a recent build from Git master

Expected behavior
Using

parallel ffmpeg-normalize {} -c:a libopus -b:a 48k -e '[ "-vbr", "on", "-application", "voip" ]' -o {.}.opus ::: *.mp3(N) *.ogg(N)

the -e '[ "-vbr", "on", "application", "voip" ]' is passed to ffmpeg

Actual behavior
ffmpeg-normalize thinks that -vbr is -v br

Command
The exact command you were trying to run:

parallel ffmpeg-normalize {} -c:a libopus -b:a 48k -e '[ "-vbr", "on", "-application", "voip" ]' -o {.}.opus ::: *.mp3(N) *.ogg(N)

Any output you get when running the command with the --debug flag:

usage: ffmpeg-normalize [-h] [-o OUTPUT [OUTPUT ...]] [-of OUTPUT_FOLDER] [-f]
                        [-d] [-v] [-q] [-n] [-pr] [--version]
                        [-nt {ebu,rms,peak}] [-t TARGET_LEVEL] [-p]
                        [-lrt LOUDNESS_RANGE_TARGET]
                        [--keep-loudness-range-target] [-tp TRUE_PEAK]
                        [--offset OFFSET] [--dual-mono] [--dynamic]
                        [-c:a AUDIO_CODEC] [-b:a AUDIO_BITRATE]
                        [-ar SAMPLE_RATE] [-koa] [-prf PRE_FILTER]
                        [-pof POST_FILTER] [-vn] [-c:v VIDEO_CODEC] [-sn]
                        [-mn] [-cn] [-ei EXTRA_INPUT_OPTIONS]
                        [-e EXTRA_OUTPUT_OPTIONS] [-ofmt OUTPUT_FORMAT]
                        [-ext EXTENSION]
                        input [input ...]
ffmpeg-normalize: error: argument -v/--verbose: ignored explicit argument 'br,'

Environment (please complete the following information):

  • Your operating system

macOS Vertura 13.3.1 (22E262)

  • Your Python version / distribution (python3 --version or python --version)

Python 3.11.3

  • Your ffmpeg version (ffmpeg -version)
ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/6.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil      58.  2.100 / 58.  2.100
libavcodec     60.  3.100 / 60.  3.100
libavformat    60.  3.100 / 60.  3.100
libavdevice    60.  1.100 / 60.  1.100
libavfilter     9.  3.100 /  9.  3.100
libswscale      7.  1.100 /  7.  1.100
libswresample   4. 10.100 /  4. 10.100
libpostproc    57.  1.100 / 57.  1.100
slhck commented

Does it work when you don't use parallel?

slhck commented

The reason I'm asking is that parallel and quoting is a bit unintuitive at times. It appears like the single quote argument around the extra options gets split into invididual arguments. You may have more luck defining the ffmpeg normalize call as a shell function first, or putting it into a small script.

Without parallel it works fine.

Also, I forgot to put - before application.

The reason I'm asking is that parallel and quoting is a bit unintuitive at times.

Yeah, I completely forgot about this. Thanks a lot!

In this particular case, running parallel -q worked fine.