Control VLC playback from command line

Working on two computers requires some control from command line (CLI). Glad that VLC implemented command line control.

I just found a solution at http://stackoverflow.com/a/9047708/289404 and made some command scripts in my home directory bin (~/bin).

Scripts that I use can be seen at https://gist.github.com/mikaelz/71055bbf5fc1aaf34ae7

Control VLC via CLI

Advertisements

VLC HTTP interface

Before starting the HTTP interface you should edit /etc/vlc/lua/http/.hosts to allow your computer to access the interface/

$ sudo vi /etc/vlc/lua/http/.hosts

Or you could simply echo the IP address of the desired computer:

$ sudo su
# echo ‘192.168.2.4’ >> /etc/vlc/lua/http/.hosts

Now you can start VLC with the HTTP interface:

$ cvlc -I http

By default for VLC media player 2.0.8 Twoflower (revision 2.0.8a-0-g68cf50b) on a Ubuntu server 12.04 the LUA interface starts up:

[http] lua interface: Lua HTTP interface

The resource files for the interface are in the /usr/share/vlc/lua/http/ directory. There is a tutorial for building custom pages at https://wiki.videolan.org/Documentation:Building_Pages_for_the_HTTP_Interface/

Finally start up your favourit browser and type the IP address of the host where vlc is running. Default port is 8080, so in my case a get the interface at http://192.168.2.2:8080/

VLC HTTP interface
VLC HTTP interface

 

More info at https://wiki.videolan.org/Documentation:Alternative_Interfaces/