VLC daemon setup

Our Dreambox 7025+ satellite receiver is not able to play many video formats because of its slow MIPS processor. Watching non-mpeg2 videos on our TV is thus only possible via its VLC plugin enigma2-plugin-extensions-vlcplayer, which requires a VLC media player process with HTTP interface running on another machine.

Since it is lame to always start VLC on the laptop just to watch videos on TV, I chose to run a VLC daemon on our home server. I replaced the old VIA Epia 500 machine with a Thinkpad last year, so it is fast enough to do the transcoding.

Daemon setup

Using VLC as daemon on a headless machine means it should always be running, be easy to start/stop and automatically restart in case of a crash.

After setting up tinydns some weeks ago, I knew that daemontools are the right solution to turn the vlc client into a proper daemon.

VLC setup

Setting up vlc-nox on Debian squeeze (6.0.5) turned out to be a real problem, because it did not decode MPEG4 videos.

Note that packages from deb-multimedia.org are not needed!

MP4 transcoding problems

When trying to view MPEG4 videos, I got the following debug output:

stream_out_transcode stream out debug: creating video transcoding from fcc=`mp4v' to fcc=`mp2v'
main generic debug: no decoder module matching "any" could be loaded
stream_out_transcode stream out error: cannot find video decoder
stream_out_transcode stream out error: cannot create video chain
main decoder error: cannot create packetizer output (mp4v)

You need ffmpeg for it, also from backports. I got version 0.8.5-1:

$ apt-get -t squeeze-backports install ffmpeg

Unfortunately, this does not help at all - VLC does not use the ffmpeg library, libavcodec, because of a bug in Debian: vlc-nox does not include /usr/lib/vlc/plugins/codec/libavcodec_plugin.so .

I noticed that by comparing the output of a working VLC client with the "broken" one on the server:

$ LC_ALL=C vlc --list|grep avcodec
  avcodec                FFmpeg audio/video decoder
  avcodec                FFmpeg audio/video encoder
  avcodec                FFmpeg deinterlace video filter
(not working)
$ setuidgid vlcd vlc  --list|grep avcodec

Reason for avcodec not being listed is the missing plugin libavcodec_plugin.so, which is available in the normal vlc package. Since I wanted to keep the headless VLC version, I only downloaded and extracted it:

$ mkdir /tmp/deb
$ cd /tmp/deb
$ aptitude -t squeeze-backports download vlc
$ dpkg-deb -x vlc_2.0.3-1~bpo60+1_amd64.deb .
$ cp usr/lib/vlc/plugins/codec/libavcodec_plugin.so /usr/lib/vlc/plugins/codec/
$ svc -d /etc/service/vlcd
$ svc -u /etc/service/vlcd

vlc --list contains avcodec now! When playing mp4 videos, you'll get no errors anymore:

stream_out_transcode stream out debug: creating video transcoding from fcc=`mp4v' to fcc=`mp2v'
main generic debug: looking for decoder module: 27 candidates
avcodec generic debug: libavcodec initialized (interface 0x352300)
avcodec generic debug: trying to use direct rendering
avcodec generic debug: allowing 3 thread(s) for decoding
avcodec generic debug: ffmpeg codec (MPEG-4 Video) started
avcodec generic debug: using frame thread mode with 3 threads

Other error messages

main libvlc warning: cannot load module
(libva-x11.so.1: cannot open shared object file: No such file or directory)

You have to install libva-x11-1.

Written by Christian Weiske.

Comments? Please send an e-mail.