Treat with Jermolene

protective, soothing, anti-bacterial

Hacking VLC Media Player

with 2 comments

So, I’m at a Hothouse at BT’s Adastral Park campus, doing some work involving remote control of the VideoLan Media Player (aka VLC). VLC is an open source media player with support for a wide range of codecs, and with some fairly sophisticated features like stranscoding, streaming, and remote control via the integrated HTTP server. To use the latter, you need to start VLC with a special switch from the command line:

"/Applications/VLC.app/Contents/MacOS/VLC" --extraintf=http

Once you’ve done that, you’ll be able to interact with the player through this web interface:

http://localhost:8080/index.html

VLC Web Interface

The HTTP interface also permits VLC to be controlled with simple HTTP requests. For example:

curl -g "http://localhost:8080/requests/status.xml?command=pl_stop"
curl -g "http://localhost:8080/requests/status.xml?command=pl_play"

The HTTP interface also serves static web pages, and includes a fairly rich-but-unusual macro/templating system for creating dynamic pages like the remote control interface above.

UPDATE: More useful URIs

/requests/playlist.xml - Retrieve current playlist in XML format
/requests/status.xml?command=pl_empty - Clear current playlist
/requests/status.xml?command=in_enqueue&input=<uri> - Add URI to playlist (example)
/requests/status.xml?command=in_play&input=<uri> - Add URI to playlist and start playing
Advertisements

Written by jermolene

July 8, 2009 at 4:45 pm

Posted in bt, development, opensource

2 Responses

Subscribe to comments with RSS.

  1. where’s the hacking ?

    latcho

    March 6, 2010 at 10:33 pm

  2. Thank you… You helped me in figuring out how to control VLC playback from my own app.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: