Log in

View Full Version : Does mencoder support multithreading?


Pulstar
31st December 2008, 15:20
http://en.wikipedia.org/wiki/NDs-mPeG

I use a T7500 to convert videos into DPGs using BatchDPG, here's an example of the necessary script to generate the DPG

mencoder in.avi -o out.mpg -nosound -ovc lavc -lavcopts vcodec=mpeg1video:vrc_buf_size=327:vrc_maxrate=512:vbitrate=256:vstrict=-1 -ofps 18 -vf scale=256:192

However in the BatchDPG gui I add the argument -threads=2 but it has no effect on CPU utilisation (still @50%).. I also tried adding that in the config file to no avail. Does mencoder (SVN 27811) not support multicore yet, at least outside the realm of x264? Thanks for any help!

nm
31st December 2008, 15:54
However in the BatchDPG gui I add the argument -threads=2 but it has no effect on CPU utilisation (still @50%)..
You need to add "threads=2" to lavcopts:mencoder in.avi -o out.mpg -nosound -ovc lavc -lavcopts vcodec=mpeg1video:vrc_buf_size=327:vrc_maxrate=512:vbitrate=256:vstrict=-1:threads=2 -ofps 18 -vf scale=256:192

If that doesn't help much, try adding 1 or 2 threads more. It may be more effective to just encode two separate videos at the same time though.

Pulstar
1st January 2009, 04:52
Thanks for the reply! Unfortunately BatchDPG is discontinued otherwise I'd have asked the author to embed the 'threads' tag (apparently I can't change the string passed to mencoder.exe).

nm
1st January 2009, 12:48
Well, if you can't add parameters to lavcopts, try adding the whole "-lavcopts vcodec=mpeg1video:vrc_buf_size=327:vrc_maxrate=512:vbitrate=256:vstrict=-1:threads=2" argument. The second lavcopts should replace the first.

However, I just tried multithreaded encoding with a recent libavcodec SVN revision and there was no speed gain with your encoding parameters and output resolution. The output stream was also broken, so multithreaded encoding seems to be currently unusable. The MEncoder build included in BatchDPG might work better, but I doubt it gets any faster either.

Better to forget it or run two BatchDPG/MEncoder processes in parallel as I suggested.