https://bugzilla.gnome.org/show_bug.cgi?id=687520
Also protect encoder with a mutex.
This is using libvpx, which can support more codecs than just VP8 and will likely support future codecs.