[MPlayer-users] Single threaded mencoder on a Dual Core machine
Corey Hickey
bugfood-ml at fatooh.org
Wed Apr 19 20:03:35 CEST 2006
Meino Christian Cramer wrote:
> Hi,
>
> as far as I know, mencoder isn't able to use both cores of a modern
> Dual Core CPU like an AMD64 X2 since it is single threaded.
>
> What I know for sure is, that only 50% load is on my CPU, when
> mencoder is working on a video. Or in other words: The encoding
> process will take twice the time....
>
> Since I am doing two-pass-encoding, I had an idea which may be
> completly nonsens (or not...I dont know the internals of the encoding
> process...):
>
> Would this script (or simmiliar) work:
>
> #!/bin/sh
> mencoder ...... -o /dev/null .... -vf pass=1 <infile>;
> sleep 60
> mencoder ...... -o <outfile> .... -vf pass=1 <infile>;
>
> ...starting the second process to utilize the second core with a
> delay to not to get in collsion with the "result stream" of the
> forst process...
>
> Only an idea !
>
> Would something like that work ?
It's a good idea, but no, it won't work. Two-pass encoding has to
analyze the entire file before starting the second pass -- often latter
portions of the file need drastically different bitrate and the best way
to make such allocations is to have data from the entire file. Thus,
while it could be possible to design an encoder that works the way you
describe, it wouldn't work as well as the current method.
Lavc, xvid, and x264 each support multithreaded encoding. I won't go
into how well each implementation works except to say that none of them
will give you 2x performance on a dual core machine. The only way to do
that is to have two encoders working on separate files -- each file
takes just as long as before, but you can encode twice as many.
-Corey
More information about the MPlayer-users
mailing list