Skip to content

Webm (vp9)

Mark Van den Borre edited this page Nov 12, 2016 · 13 revisions

Debian stable versus testing

Debian stable has libvpx 1.3.0. This is single threaded, with very little optimisations.

Debian testing has libvpx 1.6.0. This comes with multithreading enabled (since 1.4.0), with significant other optimisations too.

See https://chromium.googlesource.com/webm/libvpx/ for more info. Performance with multithreading and some basic optimisations goes upfrom 0.1x to 0.3x...

##Ffmpeg or amazon? https://aws.amazon.com/about-aws/whats-new/2016/04/amazon-elastic-transcoder-adds-support-for-vp9/

##Real life testing Fed ffmpeg a 720p60 mp4 FOSDEM 2016 talk video (nageru):

ffmpeg -i sample_720p60_mp4_aac_mono.mp4 -tile-columns 2 -threads 4 -speed 4 720pmono.webm 0.412x
ffmpeg -i sample_720p60_mp4_aac_mono.mp4 -r 25 -tile-columns 2 -threads 4 -speed 4 720p25.webm 0.763x
ffmpeg -i sample_720p60_mp4_aac_mono.mp4 -r 25 -tile-columns 2 -threads 4 -speed 4 -crf 63 720p25_crf63.webm 1.22x
ffmpeg -i sample_720p60_mp4_aac_mono.mp4 -r 25 -tile-columns 2 -threads 4 -speed 4 -crf 50 720p25_crf50.webm 0.99x

Substantial gains in both quality and speed may be made by making sure the input is 25 fps instead of anything higher. If we have to compromise on this, 50 fps is always more advisable than 60 because of the uneven frame dropping.

Other interesting options for vp9 include -frame-parallel 1 (improves decoding speed considerably).

##Optimisations ###Software optimisations Vp9 encoding is dog slow by default. As of 201509 only marginal tile based multithreading gains and no frame based multithreading in the libvpx vp9 encoder. See https://blogs.gnome.org/rbultje/2015/09/28/vp9-encodingdecoding-performance-vs-hevch-264/ and https://www.phoronix.com/forums/forum/software/desktop-linux/825879-how-vp9-video-encode-decode-compares-to-h-264-h-265. ###Hardware optimisations Hardware vp9 encoding IR is available, but AFAIK nothing like cc6x with hardware acceleration for ffmpeg? http://www.webmproject.org/hardware/vp9/bige/ https://sites.google.com/a/webmproject.org/wiki/hardware/socs The Mali G71 "Egil" GPU supports VP9 encoding. Released 201606 http://www.anandtech.com/show/10428/arm-announces-mali-egil-video-processor. Not really a solution for our problem :-(

##Ffmpeg

< ChocolateArmpits> new line of intel processors support hardware encoding
< ChocolateArmpits> Simple slicing won't work as you can't just simply combine encoded frames afterwards
< ChocolateArmpits> I mean parts of a frame
< furq> the intel vp9 stuff is only partially accelerated afaik
< furq> but you can use sliced multithreading with libvpx
< furq> markvandenborre: use -tile-columns and -threads
< furq> -tile-columns 2 -threads 4 is recommended for 720p and 1080p according to an old mailing list post
< furq> you lose a bit of encoding efficiency but it should be much faster (which shouldn't be difficult)
< furq> markvandenborre: there's also -speed which is something like x264 -preset
< furq> -speed 4 is the fastest, 0 is the slowest
< ChocolateArmpits> Do these options while increasing speed not throw the video quality down to the stone age?
< furq> they sure do
< furq> well, -speed does
< furq> sliced multithreading isn't that bad
< furq> -speed 4 actually looks pretty much fine with -crf
< furq> i'm guessing this is going to be mostly static shots of guys standing awkwardly near laptops
< furq> explaining why enlightenment 17 is actually good and not bad like you thought it was
< furq> if you can get tile-columns working then i'd expect you to get 25fps at 720p
Clone this wiki locally