slhck / ffmpeg-normalize

Audio Normalization for Python/ffmpeg
MIT License
1.28k stars 118 forks source link

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

Closed homocomputeris closed 1 year ago

homocomputeris commented 1 year ago

:warning: 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)

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):

slhck commented 1 year ago

Does it work when you don't use parallel?

slhck commented 1 year ago

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.

homocomputeris commented 1 year ago

Without parallel it works fine.

Also, I forgot to put - before application.

homocomputeris commented 1 year ago

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!

homocomputeris commented 1 year ago

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