Using a Humax PVR to get radio shows into mp3s

One of the best things about my Humax 9200T PVR is that it includes radio as well as television, couple that with series link and its USB connection to download to a computer and you’ve got everything you need to never miss your favourite show again. Freeview radio shows take up about 80Mb per hour, so there’s little risk you’ll fill up your hard disk with them so go nuts, you can always delete unwanted programmes later on.

Automating the process took a little bit of thought, so I’m putting it online so it’s easier for me to find next time I format my computer and forget to back it all up.

Getting the files off the PVR

If you’re still running a 32bit copy of Windows XP, then use Humax’s Media e-linker application to copy the files onto your laptop. If, however, you’re using something that isn’t 9 years old, then you’ll need the help of some community experts to download from it.

I’m discounting the method of connecting a computer directly to the Humax’s builtin hard disk because many users at home aren’t comfortable with that level of hardware modifications, so this is strictly USB file transers.

First you’ll need a copy of Andy Chappell’s Humax Media Controller. This is a command line rewrite of media e-linker and uses the open source Libusb-win32 library to do the interfacing. However, the 2007 version of this library didn’t support 64bit windows, so you’ll need Mike Dimmick’s remarkably handy updated driver and specially compiled copy of libusb0.dll to make it work with your OS and HMC.

Transcoding from .ts into .mp3

Once you’ve got the files transferred onto your computer, you will likely want to convert it into something your phone or mp3 player will cope with. It comes as MPEG2 Transport Streams (.ts.) which VLC media player copes with just fine, and you can use it to transcode it into an mp3 and attempt to put an ID3 tag or two in using a tool like id3 mass tagger

This approach works just as well for video as it does for audio but because of the size of the files involved, you really do need two seperate hard drive spindles to split the reading from the writing, otherwise you’ll be there for hours.

The script that does the work is just below. Call it either one at a time or as a

for /f %i in (*.ts) do @transcodeThis.cmd

@echo off
echo %1
set out=%1
set out=%OUT: =%
set out=%OUT:'=%
set out=%OUT:ts=mp3%
echo %OUT%

set thisfile=%out%
set thisfile=%OUT:"=%
set thisyear=%thisfile:~0,4%
set thismonth=%thisfile:~4,2%
set thisday=%thisfile:~6,2%
set thishour=%thisfile:~8,2%
set thismin=%thisfile:~10,2%
set thistitle=%thisfile:~12,-4%

start /wait f:\Progra~2\VideoLAN\VLC\vlc.exe %1 --sout=#transcode{acodec=mp3,ab=128}:standard{access=file,mux=dummy,dst=%OUT%} vlc://quit

rem ID3 v2 tag
rem f:\datafiles\pvr\id3.exe -2 -M -g "Podcast" -a "%thistitle%" -t "%thistitle% %thisyear%/%thismonth%/%thisday% %thishour%:%thismin%" -y "%thisyear%" %1
rem ID3 v1 tag
f:\datafiles\pvr\id3.exe -M -g "Speech" -a "%thistitle%" -t "%thistitle% %thisyear%/%thismonth%/%thisday% %thishour%:%thismin%" -y "%thisyear%" %out%