beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.88k stars 1.82k forks source link

replaygain: ffmpeg fails due to invalid option #4520

Closed jhuldtgren closed 2 years ago

jhuldtgren commented 2 years ago

Trying to use replaygain with ffmpeg command fails because -o is not a valid flag to ffmpeg anymore.

beet -vv will only say that it failed, running the ffmpeg command manually will indicate -o is not valid syntax.

Problem

Running this command in verbose (-vv) mode:

beet -vv replaygain -aW id:4360
user configuration: /home/johan/.config/beets/config.yaml
data directory: /home/johan/.config/beets
plugin paths: /home/johan/.config/beets/plugins
inline: adding item field path_genre
inline: adding item field path_year
inline: adding item field path_format
inline: adding album field if_bucket
lyrics: Disabling google source: no API key configured.
Sending event: pluginload
library database: /home/johan/.config/beets/library.db
library directory: /music
Sending event: library_opened
replaygain: Analyzing 1 albums ~ command backend...
replaygain: analyzing Aara - Phthonos
replaygain: analyzing 2 files
replaygain: executing /usr/local/bin/ffmpeg -o -s s -k -d 0 /music/flac/metal/aara/2022-phthonos/01-phthonos_i.flac /music/flac/metal/aara/2022-phthonos/02-phthonos_ii.flac
replaygain: /usr/local/bin/ffmpeg exited with status 1
replaygain: ReplayGain backend `command` failed for some tracks in album Aara - Phthonos
Sending event: cli_exit

Running the above ffmpeg command manually:

/usr/local/bin/ffmpeg -o -s s -k -d 0 /music/flac/metal/aara/2022-phthonos/01-phthonos_i.flac /music/flac/metal/aara/2022-phthonos/02-phthonos_ii.flac
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with OpenBSD clang version 13.0.0
  configuration: --enable-shared --arch=amd64 --cc=cc --disable-debug --disable-indev=jack --disable-indev=oss --disable-outdev=oss --disable-outdev=sdl2 --enable-avresample --enable-fontconfig --enable-frei0r --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libopus --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-nonfree --enable-openssl --enable-libvidstab --extra-cflags='-I/usr/local/include -I/usr/X11R6/include' --extra-libs='-L/usr/local/lib -L/usr/X11R6/lib' --extra-ldsoflags= --mandir=/usr/local/man --objcc=/usr/bin/false --optflags='-O2 -pipe -Wno-redundant-decls'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Unrecognized option 'o'.
Error splitting the argument list: Option not found

Setup

Here is the replaygain section of the config:

replaygain:
    auto: no
    command: /usr/local/bin/ffmpeg
sampsyo commented 2 years ago

That's interesting! It looks like you're using the default "command" backend, which is meant for tools like mp3gain. There is also a separate ffmpeg backend, which you enable with backend: ffmpeg. Is there a chance that's what you were intending to do?

jhuldtgren commented 2 years ago

You are correct, I had missed that command was only for mp3gain, using backend: ffmpeg works. I will note though that trying to provide the full path to ffmpeg (since I had to do so for mp3gain when I was using that I assumed I'd need to for ffmpeg too) will fail. Now in my case it found ffmpeg so it still works, but wondering if it should allow full path to the tools?

$ beet -vv replaygain -aW id:4360          
user configuration: /home/johan/.config/beets/config.yaml
data directory: /home/johan/.config/beets
plugin paths: /home/johan/.config/beets/plugins
lyrics: Disabling google source: no API key configured.
inline: adding item field path_genre
inline: adding item field path_year
inline: adding item field path_format
inline: adding album field if_bucket
error: Selected ReplayGain backend /usr/local/bin/ffmpeg is not supported. Please select one of: command, gstreamer, audiotools, ffmpeg
jhuldtgren commented 2 years ago

You are correct, I had missed that command was only for mp3gain, using backend: ffmpeg works. I will note though that trying to provide the full path to ffmpeg (since I had to do so for mp3gain when I was using that I assumed I'd need to for ffmpeg too) will fail. Now in my case it found ffmpeg so it still works, but wondering if it should allow full path to the tools?

$ beet -vv replaygain -aW id:4360          
user configuration: /home/johan/.config/beets/config.yaml
data directory: /home/johan/.config/beets
plugin paths: /home/johan/.config/beets/plugins
lyrics: Disabling google source: no API key configured.
inline: adding item field path_genre
inline: adding item field path_year
inline: adding item field path_format
inline: adding album field if_bucket
error: Selected ReplayGain backend /usr/local/bin/ffmpeg is not supported. Please select one of: command, gstreamer, audiotools, ffmpeg

Ok ignore that, it works if you do it correctly :)

This does not work:

replaygain:
    auto: no
    backend: /usr/local/bin/ffmpeg

but this does:

replaygain:
    auto: no
    backend: ffmpeg
    command: /usr/local/bin/ffmpeg
wisp3rwind commented 2 years ago

Looks like this was resolved? I'm closing the issue, feel free to re-open if that's not the case.