Log in

View Full Version : Xvid and multicore?


iCookie
18th August 2008, 12:43
How do I make xvid function properly with multicore CPUs?
I tried Xvid 1.1.3, which grayed out the option called "number of threads". So instead I installed version 1.2 from http://www.koepi.info/ and I was able to edit the "number of threads"-parameter, so I set it to 2.

But Xvid is still only using 50-60% CPU? How can I make it use 100% of the CPU? (Both cores)

PS: I am using VirtualDub to encode.

Dark Shikari
18th August 2008, 15:06
You don't. Xvid's threading is quite inefficient; not only does it not use nearly all of your processor, bit it uses X% more CPU for Y% more performance, where X > Y.

cmw
18th August 2008, 18:19
Actually you can make it use almost the entire CPU by using a multithreaded AVS file to begin with. So you do SetMTMode(2,2) in your AVS script and for xvid you use 2 threads aswell, that should make it considerably faster, at least it worked for me that way. If this doesn't work, try set your threads to 3 (it's probably using threaded input now).

Ranguvar
18th August 2008, 21:31
And you can increase the number of cores beyond the number you have for more CPU usage (though, note, this may well not increase speed).

Lenny_Nero
19th August 2008, 20:36
The speed, setup and quality of the space on your hard drives are the main (seems to me) limiting factor once you get into the multi core/CPU areas with Xvid encoding, and as I expect the same with all video encoding.

I have posted, a few times before the info that shows, even on my dual core boxes, that a well defragged hard drive[s] with a largish (the bigger the better) lump of free space goes much faster than (as you would expect) a smaller fragmented space splattered across the drive[s].

Also the best way to have the drives setup is the OS on one controller, the 'TO encoder' drive on a second, and the 'FROM encoder' on yet another, something that is much easer to do with todays SATA controllers. My older file server has 5 IDE (PATA) controllers on it, and a single master and slave/cable setup on it is the worst place to have the TO and FROM drives and slows down everything so showing a much lower CPU use.

This post from the MT Xvid thread has a picture showing (http://forum.doom9.org/showthread.php?p=1048660#post1048660) the CPU usage from my encode box in my sig, and how IMO I get the best, it can drop down to ~60% (or worse) if I run all the encoding to and from the OS hard drive, more in this thread/post. (http://forum.doom9.org/showthread.php?p=1011713#post1011713)

Groucho2004
19th August 2008, 23:06
The speed, setup and quality of the space on your hard drives are the main (seems to me) limiting factor once you get into the multi core/CPU areas with Xvid encoding, and as I expect the same with all video encoding.

I have posted, a few times before the info that shows, even on my dual core boxes, that a well defragged hard drive[s] with a largish (the bigger the better) lump of free space goes much faster than (as you would expect) a smaller fragmented space splattered across the drive[s].

Also the best way to have the drives setup is the OS on one controller, the 'TO encoder' drive on a second, and the 'FROM encoder' on yet another, something that is much easer to do with todays SATA controllers. My older file server has 5 IDE (PATA) controllers on it, and a single master and slave/cable setup on it is the worst place to have the TO and FROM drives and slows down everything so showing a much lower CPU use.

This post from the MT Xvid thread has a picture showing (http://forum.doom9.org/showthread.php?p=1048660#post1048660) the CPU usage from my encode box in my sig, and how IMO I get the best, it can drop down to ~60% (or worse) if I run all the encoding to and from the OS hard drive, more in this thread/post. (http://forum.doom9.org/showthread.php?p=1011713#post1011713)

When do people learn that CPU usage does not equal encoding speed?
Let me give you an example:
On my 3 GHz Core 2 Duo I get on average 60-70 fps on the second Xvid pass (VirtualDubMod).
When I do a direct stream copy on an avi file, I get about 5000 - 7000 fps.

What does that tell you about the influence of hard drive speed?

Ranguvar
20th August 2008, 03:54
Hard drives do not, will not impact speed, unless you have a god-awful slow one, or are doing something with super-high bitrates (think 100MB/s+), uncompressed video, or very high resolution lossless...