Video: Blender's new short film and ffmpeg vp9 test

| | | | |

About a month ago the Blender folks released a new film project named Cosmos Laundromat.

Two days ago the ffmpeg folks released version 2.8. I saw one of the changes was that for webm they are now defaulting to using the vp9 video codec and the opus audio codec. Previous releases defaulted to webm with vp8 and ogg.

I've been following vp9 for a few years now... and every once in a while I'd try the libvpx tools and ffmpeg's support for vp9... but it was never quite there yet for non-experts (me). With this release, I say that vp9 is very, very close to viable. The only problem is that the encoding speed still leaves a lot to be desired. For the best results, two pass encoding is required. Using a number of 1080p video sources in h.264 format (all of the Blender films downloaded from YouTube) and a contemporary Intel i7 CPU, I get a little over 100 Frames Per Second (FPS) on pass 1 and between 7 - 9 FPS on pass 2. With a video that is ~24 FPS (all my source videos) it takes a little over 3x realtime to encode them. Well, more because of the two passes. The more popular codecs in ffmpeg are better than real time including vp8/ogg-based webm. Of course those numbers are all highly variable depending on the source material and the hardware you run it on... but you get the idea.

Ok, so encoding speed isn't so great. I'm sure that will get better over time. I'd expect it to be cut in half sometime over the next couple of years... if we are lucky... that and faster hardware... and perhaps GPU encoding support in newer hardware.

But anyway, enough about the encoding speed, how is the quality? Well, see for yourself. I think it truly lives up to the 1/2 the filesize for the same quality compared to vp8/ogg or h.264. I embed Cosmos Laundromat above then directly link to additional ones below if you want more. vp9/opus webm files should play in contemporary versions of Firefox, Google Chrome, Microsoft IE if you have some plugin installed (haven't tried it) and supposedly coming soon to Microsoft's Edge browser in Windows 10. Safari? Probably never. Play in your browser or right-click download and play with your preferred media player.

Don't blame any download / playback retrieval slowness on vp9... it's probably a lack of bandwidth on the server side... so be patient and pause it until some is buffered. Moving around the playhead should work fairly well unless bandwidth is an issue.

Full screen that if you want. Doesn't that look great? It's 720 x 302 resolution with 400 kbit video and 96 kbit audio. That's why all of the files have 496k in the name. So that's like 62KB / second transfer. Pretty good quality huh?

More vp9 re-encodes with ffmepg 2.8:

2006-Elephants_Dream-496k.webm (38.4MB, 10:53)
2008-Big_Buck_Bunny-496k.webm (31.8 MB, 9:56)
2010-Sintel-496k.webm (52.9 MB, 14:48)
2012-Tears_of_Steel-496k.webm (43.3 MB, 12:14)
2013-Caminandes-Gran_Dillama-496k.webm (8.7 MB, 2:26)

Want to know how it works on Hollywood / live action movies? Here's the trailer for the upcoming film, "The Martian". I don't think I'll get into any trouble for posting a trailer, right? Again, 720 x 405 @ 496 kbit. The black bars were in the original and I didn't remove them.

2015-The_Martian-Trailer-496k.webm (11.5 MB, 3:17)

Want to give vp9 a try? I doubt many distros have packages for ffmpeg 2.8 yet but you can download the static .tar.xz from ffmpeg's site and run it on most Linux distros. That's what I did. I'll leave finding the URL up to the reader because it will certainly change.

So far as encoding goes, I didn't do anything fancy. Just something like:

ffmpeg28 -y -i source.mp4 -f webm -vf scale=720:-1 -b:v 400k -an -pass 1 output.webm.pass1 ;
ffmpeg28 -y -i source.mp4 -f webm -vf scale=720:-1 -b:v 400k -b:a 96k -pass 2 output.webm

I took the static ffmpeg binary and plopped it in ~/bin/ffmpeg28 so I could easily tell it apart from the stock ffmpeg binary. Enjoy!