VLC for transcoding audio files in Gerbera

After years of using the unmaintained MediaTomb UPnP server, I switched to Gerbera. Gerbera builds on the MediaTomb codebase and adds new features like cover images, compiles on current distributions, and is maintained.

Our Dreambox satellite receiver is able to stream radio into the network, but only in the mpeg/ts2 format which no radio supports. I configured Gerbera to use vlc to automatically convert the TS2 streams into mp3 when a radio wants to play them, but after a software update on the home server transcoding ceased to work.

The new working configuration for Gerbera 1.2.0 and VLC 3.0.3-1-0+deb9u1:

<!-- satellitenradiostream in .wav -->
<profile name="mpeg2tomp3vlc" enabled="yes" type="external">
  <agent command="vlc" arguments="--no-dbus --aout alsa --no-interact --intf dummy --sout-mux-caching 500 %in --sout #transcode{acodec=mp3,ab=192,samplerate=44100,channels=2}:standard{access=file,mux=raw,dst=%out} vlc://quit"/>
  <buffer size="1048576" chunk-size="24000" fill-size="12000"/>

Log lines

Some parameters are the result of me trying to minimize the amount of lines that get written into the gerbera log file.

vlcpulse audio output error: PulseAudio server connection failure: Connection refused

Solution: --aout alsa.

dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

Solution: --no-dbus

What stays are the following lines:

main interface error: no suitable interface module
main libvlc error: interface "globalhotkeys,none" initialization failed
dummy interface: using the dummy interface module...
dummy mux: Open

Unfortunately, there is no way to get rid of those. Using --quiet also hides errors which is not something that I want.

That ticket #5047 also does not give me much hope that this will become any better in the future.

Written by Christian Weiske.

Comments? Please send an e-mail.