Wednesday, July 23, 2014

FFMPEG, Webm, libvpx, and Multithreading / Multiple Core Usage

Okay, so I've been developing a little web app to quickly share videos, and it's located here, if you want to check it out.

I am writing this very quickly, as I am already way passed the time I should be in bed from trying to figure this out! My boss won't be happy tomorrow.

Anyways,

Essentially, if you are trying to get ffmpeg to use multiple cores when converting to webm, and cannot for the life of yourself, figure out why it won't, then read this!

When using -threads <num of threads> you MUST put it right after -codec or wherever you declare your codec.

For example...

The following command will not work!

ffmpeg -threads 5 -i blah.mp4 -c:v libvpx -quality good blah.webm

but if you put the -threads 5 AFTER -cv libvpx it will use all your cores!

ffmpeg -i blah.mp4 -c:v libvpx -threads 5 -quality good blah.webm

I have no idea why this is the case, but I'm sure as hell happy it works.



Thanks to Jernej Virag from the comments on this post for finding this!

2 comments: