Send As SMS

Friday, October 13, 2006

MediaMVP and DVDs, via VLC

I've been playing for a little while with a Hauppauge MediaMVP (running mvpmc).

Amongst several other things that I wanted it to do was to play a DVD sitting in my notebook's drive on the MVP (and thus on my TV+stereo). The device is supposed to be capable of playing DVDs directly from the VOBs (via NFS or SMB) but I was also interested in using VLC's transcoding. There is built in support for using VLC on a more powerful machine to perform various sorts of on-the-fly transcoding, but the cases in which it will do so are hard-coded and not at all user controlled. After a while, I realised that I could get VLC to make the stream available via HTTP and just connect the MVP to the HTTP stream, as long as the stream was one that the MVP's hardware could decode in real time. To find out what parameters to use I poked around inside the mvpmc source. Here is what I came up with:

$ /usr/bin/vlc --vlm-conf vlc.cfg -v -I telnet

(the "-I telnet" prevents a gui from appearing) where vlc.cfg contains:

new foo broadcast enabled
setup foo input dvd:@2:1-
setup foo output #transcode{vcodec=mp2v,vb=2048,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=http,mux=ts,dst=:5212}}
setup foo option sout-http-mime=video/mpeg
control foo play

This is pretty much a template for setting up network streams in VLC; note in particular the 2Mb/s MPEG-2 video- and 192Kb/s MPEG audio- streams in a Transport Stream (TS) container, per the MVP's hardware spec. The resulting stream is available to the MVP as http://notebook:5212/. There are some open problems, of course:

  • No DVD menus.
  • Playing starts immediately when vlc is launched, rather than waiting for the MVP to connect. There are options for VLC to provide video-on-demand, however the documented examples that I've found so far all depend on RTSP which mvpmc doesn't support.
  • Somewhere a codec is playing up, there's a lot of green as new objects enter a scene. It looks as though the green remains until the next I-frame. This is apparently not uncommon for broken codecs, but I've not yet isolated the at-fault component.
  • (Not critical) The VLC in Debian Sarge (0.8.2) doesn't appear to be able to do this. Instead I fished whatever version happened to be in sid yesterday (0.8.6).
UPDATE 2006-11-17: New improved all-in-one script:

#! /bin/sh

if [ $# -eq 0 ]
then
source=dvd:@2-
else
source="$1"
shift
fi

/usr/bin/vlc "$@" --audio-language eng -v -I telnet --vlm-conf /dev/fd/0 <<EOF
new S broadcast enabled
setup S input "$source"
setup S output #transcode{vcodec=mp2v,vb=4096,scale=1,acodec=mpga,ab=160,channels=2}:standard{access=http,mux=ts,dst=:5212}
setup S option sout-http-mime=video/mpeg
control S play
EOF