Applying a HandBrake

December 15th, 2011

It 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!

What can be so bad about Sustainable Development?

October 7th, 2011

Sustainable development – who could possibly be against it? Motherhood, apple pie, sustainable development. So when the Government says it wants to replace all the current town & country planning legislation with a simple framework based on a presumption in favour of sustainable development, who could possibly object?

Well, how about Friends of the Earth, The National Trust, The Wildlife Trusts, The Woodland Trust … the list is huge. So what on earth is Britains’ “Greenest Government Ever” doing wrong?

I’m on the Planning Committee for Kendal Town Council, and on their behalf I’ve been working my way through the document which has caused all the fuss – the Draft National Planning Policy Framework (NPPF). And, indeed, the ‘presumption in favour of sustainable development’ is all over the document. But the more I read, the more uneasy I became. And now I think I have discovered the reason.

The draft starts off impeccably by citing the definition of sustainable development in The Report of the Brundtland Commission, “Our Common Future”, published in 1987:

Sustainable development means development that meets the needs of the present without compromising the ability of future generations to meet their own needs

What this means in practice within the UK was agreed jointly in Five Principles published in March 2005, under the auspices of the Sustainable Development Commission (abolished by the new Government … hmm, maybe a warning there).

It in instructive to compare these Five Principles with the definitions in Paragraph 10 of the NPPF (“For the planning system delivering sustainable development means:”)

Five Principles Draft NPPF
Living Within Environmental Limits Respecting the limits of the planet’s environment, resources and biodiversity – to improve our environment and ensure that the natural resources needed for life are unimpaired and remain so for future generations Planning for Places (an environmental role) – use the planning system to protect and enhance our natural, built and historic environment, to use natural resources prudently and to mitigate and adapt to climate change, including moving to a low-carbon economy
Ensuring a Strong, Healthy and Just Society Meeting the diverse needs of all people in existing and future communities, promoting personal well-being, social cohesion and inclusion, and creating equal opportunity for all Planning for People (a social role) – use the planning system to promote strong, vibrant and healthy communities, by providing an increased supply of housing to meet the needs of present and future generations; and by creating a good quality built environment, with accessible local services that reflect the community’s needs and supports its health and well-being
Achieving a Sustainable Economy Building a strong, stable and sustainable economy which provides prosperity and opportunities for all, and in which environmental and social costs fall on those who impose them (Polluter Pays), and efficient resource use is incentivised. Planning for Prosperity (an economic role) – use the planning system to build a strong, responsive and competitive economy, by ensuring that sufficient land of the right type, and in the right places, is available to allow growth and innovation; and by identifying and coordinating development requirements, including the provision of infrastructure
Promoting Good Governance Actively promoting effective, participative systems of governance in all levels of society – engaging people’s creativity, energy, and diversity.
Using Sound Science Responsibly Ensuring policy is developed and implemented on the basis of strong scientific evidence, whilst taking into account scientific uncertainty (through the Precautionary Principle) as well as public attitudes and values.

I have used italics to highlight what I think are significant differences between the Five Principles, and the draft NPPF’s take on sustainable development. I think these go a long way to explain why the draft has got it wrong:

  • it requires an increasing supply of land for housing and for economic growth (for ever? at least 15 years – Para.24) – is that sustainable? and how will people on low incomes have an equal opportunity to live in one of these homes?
  • it completely ignores the principle of Polluter Pays – indeed, the whole tone of the document is to try and prevent any such considerations preventing building going ahead (e.g. Para 64, 70, 73, …)
  • governance: although communities who want to prepare their own Neighbourhood Plans are required to hold a local referendum, these plans are not allowed to set lower targets than the higher level Local Plans. In our part of the world the Local Plan attracted furious opposition and would never pass a local referendum
  • the draft NPPF explicitly sets out to tear up “sound science” – the learnings of the post-war years, embodied in current planning policies

I could go on, but if the Framework is built on a presumption in favour of sustainable development, and it has redefined sustainable development to meet its own preconceptions, then it’s not surprising it’s been the focus of so much opposition.

One final thought – the draft NPPF (para 53) says the purpose of development management is:

The primary objective of development management is to foster the delivery of sustainable development, not to hinder or prevent development

If it was serious about sustainable development, I believe this should be:

The primary objective of development management is to foster the delivery of sustainable development and prevent unsustainable development

A small change, but it creates a balance which is conspicuously lacking throughout the draft.

Elephants never forget – why can’t computers?

August 26th, 2011

If computers have so much memory, why are they so good at losing things? Say you are working on a great masterpiece “War and Peace Revisited” over several weeks. Why is it that every time you do ‘File -> Save’, the computer immediately forgets everything you have done, except the very latest version?

It doesn’t have to be like that. Many years ago I worked on computers running VAX/VMS. Every time you did ‘File -> Save’, the computer saved a new version of the file. So, your first attempt would be “War and Peace Revisited;1″; next time you saved, the computer created “War and Peace Revisited;2″ and so on. Most of the time, it was completely invisible. If you just did “File -> Open War and Peace Revisited”, you’d get latest version.

However, if you accidentally screwed up your working copy and saved it … all was not lost. “File -> Open War and Peace Revisited;-1″ would bring up the previous saved version; “War and Peace Revisited;-2″ the version before that, and so on. Or you could “File -> Open War and Peace Revisited;23″ to open a specific version.

This “versioning file system” was so fantastically useful, I can’t understand why it’s never caught on elsewhere, especially as disk storage is now so cheap.

These thoughts were triggered by a document I was working on today, where I wanted to show someone what had changed since I last sent them a copy some time ago. Fortunately, I’ve been running Back in Time on my laptop. This is a wonderful little utility. Every time I boot my laptop, it checks for any changed files, and takes a copy of them. Over the weeks it builds up a history, and can even restore a file which has been accidentally deleted. Today, it enabled me to get back a two week-old version of a file and compare it to the latest. Wonderful.

But why isn’t this built in to every computer operating system?

Summer time …

July 3rd, 2011

Yesterday we had our first day of blue skies and unbroken sunshine since May 1st, and our solar PV system installed last November recorded a new high for a day’s energy generated – 25.67kWh, beating the May 1st figure of 24.08kWh. What’s interesting is that the peak power in the middle of the day in May was slightly higher than June, but the extra hours of daylight in June made the total energy generated in the day higher.

Yes, I’m afraid there is a real danger of becoming this sad if you get one of these systems installed….

Travellers’ tales from Palestine

June 27th, 2011

I recently came across two accounts of American tourists in Palestine – the first one filled me with despair; the second one with hope. See what affect they have on you.

The first was an account of a “mission” to Israel by Americans For A Safe Israel (AFSI) (do watch the embedded video). I should explain that AFSI’s definition of ‘Israel’ includes the territory which the international community recognises as Palestine. AFSI members enjoy a conducted tour of Israeli settlements in Palestine (which are illegal under international law). They take a particular joy in visiting settlements which even the Israeli government views as illegal. As an example of using tourism to reinforce prejudice, it’s hard to beat – “… our feeling of love and support and strength for the land of Israel just grows with every trip that we take. Two-thirds of the people who travel with me are people who have been with me before. They come again and again because we form very close ties with the people.” The highlight of the tour is when “AFSI members will get some hands-on training in rifle practice under the tutelage of the Mishmeret Yesha rapid response team.” Possibly a case of people who slay together, stay together?

The second tells the story of a visit by another group of American Jews, but this time the group was keen to hear both sides of the story. As the report relates, this took them to some unusual destinations: “perhaps what was most impressive about the trip was the group’s shocking request to have home stays at a Palestinian refugee camp. For two nights, nineteen Jews stayed in four Palestinian homes in Deheisheh Refugee Camp.” The result was amazing: “The fact that these were Jews and Muslims in a place torn by nationality, religion and conflict did not stop them from overcoming stereotypes and becoming friends. They looked beyond religion and nationality and connected on the basic level of human relations.”

It appears that travel can indeed broaden the mind, but it can also reinforce existing prejudices. You pays your money…

FiT for purpose?

June 8th, 2011

Actual versus design generationWe’ve just submitted the quarterly meter reading of the electricity produced by our solar PV system so we can receive our Feed In Tariff (FiT) payments. The good news is that – thanks to a sunny April – the system is on track to meet its design output for the year.

The bad news is that each payment takes six weeks to process! Why? according to Good Energy:

When companies claim the FIT from Ofgem on behalf of customers, it is called the ‘Levelisation Process’. This occurs quarterly and requires all electricity suppliers to pay an amount into a central fund. The amount they pay is determined by their share of the electricity supply market. Once Ofgem (the regulator) has received information from each supplier, including the total FIT claim they are making for their generator customers and the amount of electricity they supply, it calculates how much each supplier must pay to meet the total amount of FITs being claimed. Ofgem then instructs the suppliers to pay their share into the central fund. Once received, this money is then redistributed to the suppliers according to the FIT claims they submitted (on behalf of their customers), then the supplier makes the FIT payments to those customers.

This is something the government wants to encourage … just think what the bureaucracy would be if they wanted to discourage it …

What’s in a name?

June 2nd, 2011

During my time working in IT in big corporates, I would occasionally come across places where the use of open source software was ‘against company policy’ for one reason or another. I refrained from asking them to investigate their firewalls, routers, digital cameras, printers, photocopiers, etc. etc., but I did occasionally ask them which webservers they used. There was a good chance that IBM shops would be using IBM Websphere Server, and Oracle shops OHS (Oracle HTTP server). Both of these are of course re-badged versions of the Apache Software Foundation’s Apache HTTP Server – “the Apache webserver” – one of the flagships of the open source world.

Indeed, the ASF has achieved two amazing success stories – it produces the world’s most popular webserver, despite competition from commercial giants likes Microsoft; and it has succeeded in straddling the gulf between the open source communities and commercial software houses without upsetting either camp. For this reason, the announcement yesterday by Oracle (with a little help from IBM) that it was putting forward OpenOffice.org for adoption by the ASF is a fascinating development.

History lesson: Oracle acquired the OpenOffice.org software as part of its acquisition of Sun Microsystems. Within a few months, the volunteer community (which had been such a feature of OpenOffice.org) upped sticks and announced the formation of The Document Foundation as a home for the continuing OpenOffice.org project – which they had to rebrand as LibreOffice as Oracle had hung on to the OpenOffice.org trademark. TDF has succeeded in establishing credibility, releasing new versions of LibreOffice, and raising substantial funds in an appeal to supporters.

So, this latest move by Oracle could be seen as a move to wrong foot the volunteers in TDF. Alternatively, it could be seen an eminently sensible step for them to take. If OpenOffice.org passes the ASF adoption process, then there will be no question about whether it is a ‘genuine open source project’. You can’t get much more open source street cred than ASF branding. Oracle and IBM can continue to release commercial derivatives of OOo for their customers (as they do with the Apache Web Server), and might even persuade Red Flag to join the party. And the ASF can make the leap from the world’s server rooms to the world’s desktops.

But what about the folks at The Document Foundation? they have invested huge amounts of time and energy in establishing their new baby. It would not be easy to get back into bed with Oracle and IBM, as their initial response suggests. But maybe it’s time to set aside history, set aside the personality issues on all sides, take a deep breath, and decide which route is most likely to create great software that can continue to challenge Microsoft on the desktops of the world.