HTML5 vs. Flash Video Playback

While I was playing around with my audio/video tag swapping code, it struck me how lousy my test video looked in the Flash player in full-screen mode.

Cropped zoomed video from Flash video player
Cropped zoomed video from Flash video player

And for comparison:

Cropped zoomed video from HTML5 full-screen
Cropped zoomed video from HTML5 full-screen

The original video is 480×270 (it’s a tiny file!) and it’s being zoomed to 1680×1050 in both cases. The FLVPlayback component is set to maintain aspect ratio, and the underlying Flash player is on high quality with scale set to noscale. It’s a pretty stunning difference — Flash is using cheap “nearest neighbor” scaling while HTML5 is using the more expensive (but, with GPU acceleration, effectively free) bicubic scaling. WTF?

It turns out that JWPlayer doesn’t have this problem. Why? Well it uses fullScreenTakeover to enable hardware acceleration. I’d use the same approach but it gets back to puppeting the video control skin, which I can’t figure out how to do. (The basic problem is that the video playback controls aren’t standard controls, and exactly how the FLVPlayback component works them is undocumented.)

Aside: note that Safari somehow manages to play hardware-accelerated h264 with perfect scaling in normal windows (not to mention on Windows). It doesn’t need to go fullscreen. If you think that’s because Apple uses private APIs, then check out Google Chrome, which manages the same trick (on Windows as well). And Flash has the same problem on Windows. So with Flash it’s “fullscreen mode” or “I’m sowwy but using hardware acceleration is too hard to implement”.

I’d love to just use JWPlayer, but it doesn’t support MP3, which gets me back to square one.

So I’m stuck with crappy (software) video scaling because (1) I can’t use Flash’s all-or-nothing full-screen video mode, which I can’t use because (2) Flash’s video playback controls are non-standard and how they work is not documented, and I had to go down this stupid route because (3) FLVPlayback doesn’t cope with audio files, and (4) the Sound and SoundChannel classes are completely different in architecture from FLVPlayback. In short, Flash sucks.