Friday, May 25, 2012

Android Remote Control for VLC

This is part of my continuing adventure setting up MythTV at home. (You can find related posts by clicking the MythTV label in the tag cloud on the lower right portion of the page.)  Having set up MythTV, I copied over backups I'd made of my Windows Media Center recordings.  It turns out that they are recorded in a somewhat proprietary format (.dvr-ms file extension).  I'm sure you are as shocked as I am that Microsoft would deviate from the file format standards adopted by, oh, the rest of the world.  At any rate, it is theoretically possible to transcode those files into something like MPEG format, but after one failed attempt I decided not to bother.  These are TV shows I intend to watch once and then delete, and VideoLAN's VLC player, which is available and multiple platforms and a standard part of many (most?) Linux distributions, handles .dvr-ms files nicely.

I've used VLC (frequently) on PCs, but always when I was sitting at the keyboard watching a (typically short) video.  Watching a TV show means sitting at a distance from my TV (and keyboard), so I needed a way to control VLC from a distance.  (It was either that or watch the commercials.)  Enter Remote for VLC, a free VLC remote control app by Peter Baldwin, available for Android devices (such as my Toshiba Thrive tablet) from Google Play (formerly known as the Android store).  There are several VLC remote control apps on Google Play, but this one has one of the highest customer satisfaction ratings, has a very well done interface, and is free.

I have a Wi-Fi network in my house, including the computer running MythTV and VLC, and of course including the tablet.  My version of VLC is "2.0.1 Twoflower".  There are setup instructions for the app online, and I found general instructions for enabling VLC's web interface several places, but not of them exactly matched my setup, so I though I would post my steps here in case they might help someone else.

First, you have to enable the built-in web interface to VLC.  In VLC, click Tools > Preferences, and at the bottom left set Show settings to All.  Expand Interface and select Main interfaces.  Put a check next to Web.  (This is the first place where I had to deviate -- slightly -- from posted help, which mentioned "http".)  Now exit VLC.

Find VLC's .hosts file and open it in your favorite editor.  On my Mythbuntu box, the path is /usr/share/vlc/lua/http/.hosts.  On the PC I'm using right now (Linux Mint), the path is /etc/vlc/http/.hosts, but both /usr/share/vlc/lua/http/.hosts and /usr/share/vlc/http/.hosts symlink to it.  So you may have to do a little detective work, bearing in mind that file names that start with a period are hidden by default (so use ls -a, click ctrl-H in Nautilus, or do whatever is analogous in your file manager of choice).

The troubleshooting instructions say, somewhat vaguely, that you should edit this file after you find it.  Specifically, you need to enable whatever address or range of addresses will be used by your remote control device.  My Wi-Fi network uses non-routable addresses in the 192.168.whatever.whatever range.  So I found the line containing the mask 192.168.0.0/16 and uncommented it by removing the initial hash (#) character, then saved the file.  The file contains masks for all standard private network ranges, so you just need to know what range covers the address your device will be using.  If you will be using a device that is not on the same network as the PC running VLC, you will need to add a line enabling the specific address of the remote device (and make sure the device can communicate with the PC, i.e., that you don't have a firewall that will block the remote device).

Once you have saved the modified .hosts file, start VLC.  (VLC needs to be running so that the remote device can see the built-in web service.)  Make sure your Android device is connected to the network, and start Remote for VLC.  It will scan for VLC servers and, hopefully, find yours and add it to its internal list.  You can tap the menu button in the upper right and select Settings to verify that it is connected and see whether it found your VLC server.

With that, you should be good to go. Have fun exploring the controls.

4 comments:

  1. Thanks a ton. I got very confused trying to work out how to get it all set up, the official instructions weren't helpful at all. This walk-through is exactly what I needed.

    Cheers!

    ReplyDelete
    Replies
    1. Glad someone got some mileage out of it.

      Delete
  2. thaaaannkkkk you .. works great .....

    ReplyDelete

If this is your first time commenting on the blog, please read the Ground Rules for Comments. In particular, if you want to ask an operations research-related question not relevant to this post, consider asking it on OR-Exchange.