5x12 pentomino tiling
«

H264 v FLV

»

Having watched the video I took yesterday get pixellated by its conversion to Flash video format I took the plunge today and got H264 support working.

This is the video in Flash video format, as originally posted on that page.

Look at the boxy pixels in the grass especially when I pan around quickly. So today I've built ffmpeg with x264 support from source by following these instructions (I had to tweak them slightly: you need "--prefix=/usr" when configuring x264).

And this is the same video in H264 format:

It's 2.8MB compared to the original's 2.1MB but for an extra 33% file size I'm getting video which is very smooth1.

I'm told that Flash 9.3 or later supports H264 format and that was released in December 2007 so most people should have it now. I'm going to put some code it to detect version anyway just to make sure.

  1. It's also 576x320 pixels or 16.2:9 so it's not quite the perfect 16:9 wide screen format which the top video is (at 576x324). That's because H264 compression works best when the height and width divide by 16. So for this sort of size of video you either go for 512x288 (which is what the BBC seem to be using and is perfect 16:9) or you slightly fudge the aspect ratio to fit with the width you want. For this site a video 576 pixels wide is just the right size, so 320 pixels high is the best fit and you really don't notice that it's 1.2% compressed in the vertical axis.

Tags: video Written 03/08/09

Comment on this article

«
You can follow these posts on Twitter at @Wibblings
»
I am currently reading:

Man of Iron by Julian Glover Blue Lightning by Ann Cleeves

(?)
Word of the Day:
gormless