Realplayer streaming BBC to mp3 files

Posted by blackrat on August 02, 2007

The BBC listen again facility allows you to play back audio broadcasts up to seven days after they originally air. That’s fine, unless you listen to most of your radio in the car, or away from your computer.

OK. So you can listen live, as long as you are in the UK, but sometimes I would like to listen to the last 3 episodes of Perelandra, and possibly find out what’s going on in Lionel Nimrod’s Inexplicable World, while on a plane, or driving around Seattle.

This is where Mplayer, and the title of this blog entry come in.

The basic premise is to use mplayer to stream an entry to the harddrive in PCM format (wav), convert from wav to mp3 and drop in onto an mp3 file.

The following snippet from a larger script demonstrates the basic principle.


#Input:      $1 url
#               $2 name of file to record to (excluding extension)
#
mplayer -prefer-ipv4 -bandwidth 99999999 -vc null -vo null -ao pcm:fast -ao pcm:file=$2.wav $1
lame $2.wav $2.mp3
rm $2.wav

With a high bandwidth, it takes roughly a minute to download and encode a programme. Renaming or naming files are pretty tedious to do however, so I started to look at listing programmes, such as bleb and the BBC’s own backstage listings in order to automate the process. Continue reading…

PVR Progress

Posted by blackrat on September 07, 2006

I’ve decided that MythTV is still too bitty for the average user to set up and keep running. This is a shame, since it is obvious that a lot of time and effort has gone into building it, designing the plugin architecture etc.. I’m going to persevere with MythTV for the live home system for now, but I’ve decided to build an alternative - “The Borg Box”.

Mplayer and Xine are easy to use and have good LIRC support (remote controls are desirable in the McKibbin household), so this will start as a manager and wrapper for those rather than trying to implement all of their functionality. Weather I use occasionally, but doesn’t warrant the effort I would spend on it for a first pass, so I’ve decided to implement something similar to MythVideo first. As most code I write is cross platform, and development takes place equally on my Mac notebook and my office Debian machine, it was pot luck to see where I was going to start on this.

Mac notebook won, since I was waiting for a MythTV listings update, and wanted to be near the backend. Since I use MPlayer on the Mac, I decided to see how difficult it would be to pick up a file from the MythVideo database and play it.

MythTV stores all of its configuration data in a MySQL database called mythconverg. I picked up the username/password combination from ~/.mythtv/mysql.txt; logged in and started to examine the data. The MythTV box has been running for some time now and I’ve managed to accumulate a number of AVI files. Native Myth storage is in an MPG ring buffer, and conversion to XVID AVI’s is pretty well documented elsewhere, but if there are enough comments, I’ll produce more detail on how to do this.

All of the MythVideo converted files are referenced in the videometadata table, and you can pick up the path of the video episode from “filename”. All NFS mounted paths are the same across all of my computers, so I could run the file directly using the “open” command on the Mac. All that was really required was to set up access permissions to allow any computer on my network to access the database. A quick re-compile on a Debian machine, with the “xine -pqhf -n” instruction replacing “open” and it was running in Debian under X.

So I now have a program that will pick a random file from the MythTV database and play it on either Max or Debbie. Good enough for one night. I’m looking at making the final “Borg Box” commercial, once I have full integration.
Not that I would ship it on a Pentium II, but The Eden + Hauppauge combination works well, and Debian machines built on this platform may become my chosen distribution.

Hardware Purchases

Posted by blackrat on July 25, 2006

I decided, after some examination of systems and costs, to explore two options. MythTV on Via EPIA boards and, mainly because I like the footprint, the mini Mac as clients. So the system running currently is:

  1. MythTV backend running on an EPIA M1000 with a 400 GB drive
  2. MythTV frontend running on an EPIA M1000 with a 2.5″ laptop boot drive
  3. Two MAC mini’s (Intel) currently running Apple’s frontend, but in the process of being converted to MythTV frontends.

PVR

Posted by blackrat on March 05, 2006

About a year ago, I started looking into systems for home video and other media systems. The aim was to have a consumer friendly box to replace a plethora of others including DVD/CD player/recorder, DAB radio, VHS deck and possibly enable telephony (VoIP). The options: buy a consumer box, find an existing open-source or commercial solution, build a HTPC running Windows/Linux/Other, etc.

This category will chart recent and past progress and may serve somewhat as a warning how not to do this.