Log in

View Full Version : Encoding speed - Windows vs Linux


MetaHiro
2nd April 2004, 01:58
I've got two Athlon XP systems. One an Athlon XP 2200 running Gentoo Linux and the other an Athlon XP 2700 running WinXP SP1. Now, the Linux machine has a 160GB 5400K RPM hard drive and 1.5GB of DDR PC2100 RAM on a EPoX 8k9a2+ motherboard. The motherboard is an older single channel board. The faster 2700 runs with 1GB PC2700 ram and 2 200GB and 1 250GB 7200 Hard drives. It has a dual channel nForce2 board in dual channel mode.

Now, the encoding speed i get on my Linux machine using XviD 1.0-rc3 is about 15-20fps on average using transcode + dvd::rip(using the newest of both as well as the newest xvid4conf). I use the same settings on both machines, GMC, QPel, MSP6, VHQ4, MPEG Quant, Chroma Motion, Adaptive Quant, Chroma Optimizer, etc.

The strange part is, on Windows(on the faster machine mind you) using the same settings i get about 4fps average. Can anyone tell me what the hell is going on here? I'm wondering if windows really is that much slower than linux on this, or is there some problem with transcode/dvdrip/xvid4conf that it's not enabling some settings? Anyone want to take a stab at this?

Mike456
2nd April 2004, 16:23
In many benchmarks Linux is much faster than Windows. e.g. scheduling latency, video playback. Gentoo is compiled with one of the latest gcc versions. If you have completly compiled the distribution on your pc, than you even have special optimisations for you cpu.

Then you have to think of the completly different different architecture. On Windows Systems the encoding program (e.g. VirtualDub) calls the Windows Libary and the Windows Libary calls the encoder or decoder. If you use VFAPI or avisynth than the path is even longer. As far as I know VirtualDub converts the input to RGB and back to YV12. The resize algorithm might also be slow. Virtualdub is also compiled with Visual Studio, which uses the microsoft compiler that produce quite slow code. Some Linux Programs have many optimised variants (one with SSE, the other with 3dnow, ...) of a resize algorithm and choose the fastest one for your prozessor during compilation or every time you start it.

P0l1m0rph1c
2nd April 2004, 17:41
Originally posted by Mike456
As far as I know VirtualDub converts the input to RGB and back to YV12.

Not quite correct. VirtualDub doesn't do that conversion if you select 'Fast Recompress' in Video menu.

Neo Neko
2nd April 2004, 17:48
Oddly enough even programs like virtualdub run faster under Wine via linux than they do under Windows on the same machine. Not by much though.

Sharktooth
2nd April 2004, 18:01
The difference between windows and linux cant be 4fps against 15+.
There's something misconfigured in one of your boxes.
You also told us that the windows box is equipped with faster components...
I agree linux is 5-10% faster than windows in encoding jobs but what you're experiencing is 400% !!!
It doesnt make any sense.

EDIT: please check the Turbo Mode setting on both machines.

mikeX
2nd April 2004, 20:36
Sharktooth is right, the difference is just too big...
I usually experience slower encoding speed under Linux

Something is b0rked, either what you suggested (transcode not handling certain settings correctly) or something in your windows encoding chain (colourspace conversions, unoptimized filters, etc)

About Turbo, I don't think it can make such a difference...

evade
3rd April 2004, 18:14
This piqued my curiosity so I ran a test. I did a 2 pass encode of the same source with the same settings with vdubmod under Windows XP pro and mencoder under Gentoo linux. The encodes were done on the same machine with dual boot setup and the same drive (ntfs partition for windows and xfs for linux). Anamorphic encode, No resize, no filters.

The computer used was a P4 2.6 ghz clocked to 3.1 ghz with 512mb of ddr ram and a Seagate 120 gb ATA

2 bframes
trellis
vhq 4
bitrate=1447
hvs-best quality matrix

The relevant documents are linked to below but the gist is that encoding an 85 minute movie from vobs on the HD with mencoder under Gentoo was about 9 minutes quicker.

http://69.13.241.21/REVOLUTION_OS_ForceFilm.avs
http://69.13.241.21/gknot.txt
http://69.13.241.21/mencoder_commands.txt
http://69.13.241.21/mencoder_log.txt

CruNcher
3rd April 2004, 18:42
hmm just a little hint use xvid_encraw for testing such things it's funny how you compare this with 2 completly different test schematics :D

evade
3rd April 2004, 19:29
Originally posted by CruNcher
it's funny how you compare this with 2 completly different test schematics :D

It is sort of a real life test. It is my understanding xvid_encraw doesn't produce useable output. This seemed to me like the best test to answer the question "Is it faster to encode a movie to XviD under Linux or Windows?"

The end result of either one of these tests is a cropped anamorphic avi file with ac3 audio.

CruNcher
3rd April 2004, 20:17
ah ok i thought you wanna test the encoder jep then it's my fault but i can say that another bottleneck of speed here is mpeg2dec3 under linux libmpeg2 is used i think and it's alot faster in decoding the Mpeg2 data then Mpeg2dec3 wich is based on DVD2AVI wich is based on the Reference Mpeg2 Decoder under windows, you can allready test this with NIC's Mpegdecoder wich is based on Libmpeg2 :)