Why is encoding VP8/9 so slow compared to H.264?

Recently I wanted to try out the Webm codecs VP8 and VP9 but when I ran ffmpeg to encode a H.264 MP4 file into one of the other two codecs, I realized that the encoding is (by almost an order of magnitude) slower.

A 1080p30 video from H.264 to VP9 at 3 MBit/s is being encoded at around 6-7 fps while the same video encodes at around 40 fps to H.264. I used the libvpx-vp9 codec in ffmpeg for the VP9 format. I am getting the same results for VP8 and Theora too.

Can someone explain to me why VP9 is so much slower? I tried a different machine which gave me similar resullts using Handbrake.


libvpx-vp9 is a much slower encoder than libx264 but the default settings of threads in ffmpeg (0=auto) is not effective for libvpx. Manually setting it gives a speed bump. e.g.

ffmpeg -i in.mp4 -c:v libvpx-vp9 -threads 4 out.mp4

On a 4-core machine, when encoding a 1080-30p H.264 stream, I get a bump from 3.8 fps to 10 fps.


VP9 is a more more complex codec providing better compression. Video compression/performance ratio tends to be exponentially. You should expect the VP9 replacement (AV1) to be even slower.