Streaming with VLC

Submitted bypatrik onTue, 2008-01-15 01:18

VLC can be used to stream media, transcode it and work as a bridge. Some examples:

su patrik -c "vlc -I dummy --sout '#transcode{acodec=mpga,ab=128,aenc=ffmpeg}:standard{access=mmsh,mux=ogg,dst=}'"

Recieve with:
'vlc mmsh://' or Windows Media Player.

Send via http:
su patrik -c "vlc -I dummy --sout '#transcode{acodec=mpga,ab=128,aenc=ffmpeg}:standard{access=http,mux=ogg,dst=}'"


PHP-USBLCD direct communication

Submitted bypatrik onMon, 2008-01-07 01:31

It's possible to use a Matrix Orbital USB-LCD (or a home made clone) with PHP and Linux without LCDProc or other software.
We'll need to know some commands to send to the LCD, these can be found in the manual.

The home made LCD's code and schematic is here.

The device uses the cdc-acm module and can be found as /dev/ttyACMn, where n is 0, 1 or some other number. This can be used to print to the LCD display:

//Open connection

PHP and LCDProc

Submitted bypatrik onSat, 2008-01-05 20:09

PHP-CLI code to show messages on an LCD with LCDProc.

Neither this code or my home-made USB-LCD works well with LCDProc, the results are unpredictive. It is possible to use the display without LCDProc, more about that soon.

//Code to communicate with LCDProc from PHP
//Lacks some error detection but works alright
//©Patrik Hermansson 2008

//Open a connection to LCDd

[PHP]Get song info from

Submitted bypatrik onSat, 2008-01-05 19:57

//This code uses to fetch info about
// what the metal web radio station is playing right now.
//©Patrik Hermansson 2008

//URL to fetch
$url = "";
//Fetch the web page
$str = file_get_contents($url);

//Remove and tags, leave the content

//Get the song info
preg_match('/Artist:([^<]*)Up Next/i', $content, $matches);
$songInfo = trim($matches[1]);

//Split at two or more spaces or newlines