Getting stream info from MPlayer

Submitted by patrik on Mon, 2007-10-22 18:10

Goal: To get the trackinfo from an internet radio stream onto a LCD.
The first step:
To get MPlayer to write to a file we use this command:

>mplayer -playlist http://www.chronixradio.com/chronixaggression/listen/listen.pls 2>&1|tee /var/log/mplayer.log

We can look at the file:

>cat mplayer.log|grep "ICY"
ICY Info: StreamTitle='Opeth - Blackwater Park';StreamUrl='www.opeth.com';

But we get extra info we don't want.
A PHP-script and a regular expression fixes this:

<?php
$file = "/var/log/mplayer.log";
$fh = fopen($file, 'r') or die("Can't open file");

while(!feof($fh))

Extra brake light

Submitted by patrik on Wed, 2007-09-19 09:29

This is a construction to make an extra brake light to my Saab 96. As the car is old (and beautiful :) ) a normal extra brake light won't fit. Instead I use small 3mm led's mounted in the window frame. Here is the schematic:

Five Led's in serie gives a voltage drop of 10.5 volt which keeps the voltage drop in the resistors at a minimum. A zener diode and a capacitor protects the diodes.

[080412]