Applying a HandBrake
December 15th, 2011It seems every new piece of technology brings a new problem. When we decorated our living room recently we bought a new Panasonic flat screen telly and a blu-ray disc player, thereby introducing us to the wonderful world of HD TV and being able to see every hair on the polar bear in Frozen Planet (yes, I know some of the content wasn’t quite what it seemed, but that’s show business).
This was fine for live TV, but left the problem of iPlayer content. I can happily connect my laptop to the telly with an HDMI cable, but our internet connection is so rubbish that watching HD on iPlayer in real time is just a joke. And the claimed ‘download and watch later’ iPlayer feature just doesn’t do anything either.
I’ve blogged before about the wonderful get_iplayer, which lets you download iPlayer content for playback offline. But I really wanted to be able to copy the programme onto a memory stick, pop it in the USB port on the disc player, and watch it on the telly. The disc player has a USB port, so it should be easy.
I now entered that special portion of hell which is video and audio formats. Left to its own devices, get_iplayer creates .mp4 files. The disc player (a Panasonic DMP-BD75) only reads DivX and MKV files. A few half hearted attempts with ffmpeg such as ffmpeg -i myfile.mp4 myfile.mkv produced files which the disc player could read, but so compressed as to be useless. ffmpeg is a wonderfully powerful tool, but requires a doctorate in rocket science to produce anything useful.
A quick Google suggested that another open source project, HandBrake, might be more usable by mere humans. Unfortunately there isn’t a released version for the version of Ubuntu which I am running (11.10). There is however a developers snapshot, so taking I deep breath, I did:
sudo add-apt-repository ppa:stebbins/handbrake-snapshots
sudo apt-get update
sudo apt-get install handbrake-gtk
and it was installed, and I soon had my first MKV file. Of course, the disc player refused to read it. After a bit more Googling I tried changing the Video Encoding option from H.264 to MPEG-4, ran the conversion again, and to my pleasant surprise – the disc player could read it! The quality wasn’t brilliant, but once I discovered that under Video Options, setting QP:1 created the highest quality files – I had a very watchable programme.
So I’m now about to sit down and watch Heavenly Creatures, broadcast on BBC1 on Monday after I had gone to bed
The BBC iPlayer page gave the URL of the broadcast, so it was just a matter of
get-iplayer --force --overwrite --raw --type tv --vmode flashhd,flashvhigh --url "http://www.bbc.co.uk/iplayer/episode/b00783p8/"
and then using HandBrake to convert the 1.1Gb flv file to a 1.8Gb mkv file. The only downside is that the elapsed time to do all this on my laptop is actually longer than the running time of the movie
– but hey, there are plenty of other things to be getting on with!
So, kudos to the HandBrake developers. Thanks!
