Friday, 27 August 2010

h264 is not Free

With news of the sudden royalty free amendment to the h264 license by the MPEG LA sweeping the web, it's easy to forget that this actually changes very little, indeed. You now won't ever be charged for viewing free video on the Internet.

You will still be charged for distributing an h264 encoder or decoder.

This means that if you're someone like the Mozilla group, you can't include h264 support for the HTML5 <video> tag without paying hefty royalties for the privilege. You might wonder what the problem is: surely it's right that one company licenses the right to distribute the technology of another? No. Not when it comes to the Web and the standards that underpin it (such as HTML5). Paying a royalty to take part in the Web defeats the entire point of an open internet, where ideas can be freely exchanged using the promise that the base standards are available to everyone on a royalty-free basis.

There's some sanity on this 'sweeping change' from the MPEG LA at Create Digital Motion.

H264 is not the only codec out there. You can distribute the encoders, decoders and content with WebM/VP8 and Ogg/Theora without restriction.

Use 'em.

Wednesday, 25 August 2010

Being an Ex-Catholic Atheist at a Catholic Funeral

My gran died last Thursday. At 88 years old and of frail health, her increasingly common mental lapses meant that it wasn't unexpected when it happened, but nothing quite prepares you for that phonecall.

Her funeral was today, attended by the two generations behind her—probably the best turnout at a family gathering for many years. Religiously, my family is traditionally Catholic, at least in name. We traditionally only see the inside of a church at funerals, with weddings being secular affairs and not much interest in baptising our children. Still, if you were to ask my sisters, aunts, uncles or cousins what religious affiliation they belong to, it'd be Catholic.

As far as I know, I'm the only openly declared atheist. Before going on, the reason I left the church is simply because I couldn't reconcile my beliefs about how to live a good life with what I was reading and being taught. I have no stories about abusive priests, psychological trauma induced by images of hell, or any of the stuff that commonly makes it into the Reasons to Hate the Catholic Church™.

So the ceremony itself was a little weird. Having gone through Catholic education, I knew exactly what to say at what times, and when to stand, sit or kneel. It's slightly odd that I remembered the prayers: they must have been burned into my brain when I was a boy.

But, aside from standing and sitting and that shaking of hangs thing they do prior to communion, I didn't do any of it. I didn't recite or respond to the prayers, sing hymns, bless myself with water, bow my head or press my hands together in front of me. While the priest was asking people to honour god, I was instead remembering my gran.

When I was paying attention to what the priest was saying, the thing that generally struck me was the occasional reminder that we're born sinners, achieving grace only through Christ. There was even a dig at non-believers in the reading from the book of 'Wisdom', where we are collectively labelled as 'fools' for believing that death is the end of a persons life.

As a foolish non-believer, what I found very odd was the tinkling of bells by the altar boy when the priest blessed and raised the bread and wine, a process which—according to believers—transubstantiates them into the actual body of blood of Jesus Christ. The communion itself seemed similarly strange, with people treating these little, mass-produced flecks of unleavened bread with such incredible solemnity. Knowing that most of the congregation in front of him probably hadn't communed in years, and bearing in mind the Catholic no-no about taking communion with a sin-stained soul, the priest offered blessings to those who remembered enough of the dogma to stay away because of that.

With with mass almost at its end, all that remained was to sprinkle 'holy' water over the coffin and wreath it with smoke from burning incense. This done, the coffin was taken to the cemetery and interred alongside my granddad, laid to rest seventeen years earlier.

After all this, what I'm most shocked with is myself. For quite an extended period of time, I believed this stuff. I took part in the rites and rituals, saw value in the prayers and songs and material paraphernalia. And it wasn't even that long ago: I was a practising Catholic up until about ten years ago, a lapsed one for about five years after that, finally moving on to agnosticism and finally atheism over the course of the following two or three years. Not coincidentally, all of this happened alongside actually reading the bible, learning about its origins, learning about other religions, and seeing the harm inflicted by the church thanks to its views on contraception, sex education, and homosexuals.

How times change.

Saturday, 21 August 2010

Net-Connected Consoles with Hard Drives Deliver Poor Quality Games

A while ago, I bought Uncharted 2 for the PS3. Unfortunately, with the arrival of my daughter into the world, it was one of those titles that barely got loaded at first.

Today, I put the disk into the console, and then BAM!, several hundred megabytes of updates are required before I can play the game. It would appear that there have been one or two bugs in the shipped version.

Which got me wondering: why, with the console's predecessors, was this never an issue? The answer is kinda obvious: you've got a network, a hard drive and a very competitive market. With previous generations of console, you had to make damn sure that what you burned onto that CD for shipping was a quality product. Your update channel amounted to a return of the physical medium for a fixed copy. Not very attractive. Now, however, you can ship with any half-arsed, bug-ridden product and patch it later.

One thing that console games used to have over their PC siblings was that they just worked. Stick the disk in and go. No configuring audio and video drivers, no checking the specs of your machine against the overly optimistic listings on the side of the box (only to find out that the screen shots on the packaging must have been taken from some next-generation video hardware), and no patching shoddy software with updates to fix problems that should never have made it through testing.

EDIT: apparently, a couple of hundred megabytes of patches aren't enough. It took only a half hour of playing (in the raid on the museum in Instanbul) to be bitten by this glitch:

uc2-bug.jpg

Sunday, 1 August 2010

Encoding x264 Video for the iPod Touch with mencoder

Update, 18-Aug-2012: I've changed to using an ffmpeg/mplayer combo to do this, as it's much more reliable and stable. See my new post for a breakdown.

I tend to view a lot of video content on my first-generation iPod Touch. It's great for travelling, with its these-days-paltry 16GB capacity able to store well over a dozen half hour episodes of whatever I'm following at the time.

While there are some wonderful graphical encoders out there (HandBrake springs to mind), what I was looking for was something I could script. I know that HandBrake has a command line interface, but I prefer mencoder's support for embedded subtitle streams, which is something I use often.

If you're on a fairly recent SVN of mplayer (say >= r31363), you'll find that mencoder now supports a profile in x264encopts. This is important! The default is high, which the iPod explicitly doesn't support. What you need is baseline, leading to something like this:















mencoder INPUT-FILE -o OUTPUT_FILE
 -vf scale=480:-10,harddup# resize the video to whichever height is suitable for the max 480px width
 -sws 9# Choose a really good scaler (lanczos)
 -of lavf# use lavf for output
 -lavfopts format=mp4# specifically, mp4
 -oac faac# AAC audio for output
 -faacopts mpeg=4:object=2:raw:br=128# Audio coding parmeters
 -mc 0 -noskip# Really work at keeping A/V sync
 -ovc x264# x264 video
 -x264encopts nocabac: bframes=0: level_idc=30: global_header: threads=auto: subq=5: frameref=6: partitions=all: trellis=1: chroma_me: me=umh: bitrate=768: profile=baselineVideo coding parameters. Note the baseline
 -aid 0 -sid 0# Audio and subtitle tracks
 -subfont-text-scale 4# Better subtitle scaling for an iPod sized device



(or, for a more cut n' paste friendly version:

mencoder INPUT-FILE -o OUTPUT-FILE -vf scale=480:-10,harddup -sws 9 -of lavf -lavfopts format=mp4 -oac faac -faacopts mpeg=4:object=2:raw:br=128 -mc 0 -noskip -ovc x264 -x264encopts nocabac:level_idc=30:bframes=0:global_header:threads=auto:subq=5:frameref=6:partitions=all:trellis=1:chroma_me:me=umh:bitrate=768:profile=baseline -aid 0 -sid 0 -subfont-text-scale 4)

This transcodes the source in a single pass. Lots of people strongly advocate two-pass encoding, but really, I find the quality of a single pass encode good enough for the iPod screen. There's no denying that two-pass is higher quality, but the extra time to encode disposable content just isn't worth it in my opinion.

Saturday, 5 June 2010

Netgear's Broken Firmwares

I bought a Netgear DG834G from Amazon earlier this week. It arrived on Friday, and promptly replaced the crash-tastic BT Home Hub that preceded it. Having been using Netgear products for years, I quickly set up and secured my wireless LAN, made a couple of DHCP reservations for servers on my home network, forwarded ports for various services from the Internet to those servers, hooked up to my DynDNS account, and was content. Then I noticed that the forwarded ports weren't forwarding: my web and mail servers were inaccessible. Much tinkering later, and I decide that the unit is defective, and arrange to return it to Amazon (who, it must be said, have a superbly streamlined returns process).

But I still didn't want to go back to the BT Home Hub—the frequent crashes were just too frustrating. So I dig out an old Netgear router that I found in The Pile in the bits n' pieces cupboard, and find that it still works. And hey, port forwarding even works!

Feeling good about it, I let the old kit do its thing, stable and reliable. So why not treat it to a firmware upgrade? I grab the latest (v1.03.22) from the Netgear product page, re-flash the unit, and port forwarding stops working! Crawling around some forums, I find that I'm not alone. It would appear that Netgear have broken something as fundamental as port forwarding in their recent firmwares!

Incredulous, I download v1.02.19. Still doesn't work (and almost bricks my unit in the re-flashing process). By now more than a little annoyed, I resort to v1.02.13, which I think was the original version. And you know what? It works.

Not all upgrades are upgrades, it would seem.

Wednesday, 5 May 2010

h264 shenanigans

Engadget has an excellent article that attempts to clarify the muddy waters of licensing and patents surrounding the h264 video codec. One of the snippets from the article, important enough that they list it in a side-box, is "using H.264 to distribute free internet video to end users doesn't cost a thing, and won't cost anything until at least 2015. After that, it's up in the air, and that's a bridge we'll have to cross when we come to it — there's a chance the MPEG-LA could start charging a royalty for free video in five years."

Two parts of that sentence should cause any sane person cause for concern:


...won't cost anything until at least 2015.

That's only five years away. Just enough time to generate an awful lot of content that would take a lot of effort to get away from.

After that, it's up in the air...

That's not exactly something to be happy about. There's no point making extensive use on h264 and then hoping that it'll turn out ok, especially when there are perfectly workable alternatives.



The article does do a good job of dispelling a lot of the scaremongering that's been going on, but what's left is still distinctly unpleasant.

Tuesday, 4 May 2010

Labour Promote Political Sabotage

Now that it's blindingly obvious that the UK Labour Party is going to lose the General Election later this week, they've resorted to abusing the voting system in order to prevent their long term rivals, the Conservatives, from winning a complete victory. In areas where the Liberal Democrats are a larger threat to the Tories than Labour themselves, the advice is to vote Lib Dem in order to prevent them gaining the seat.

Does anyone else think that the system is broken?