Thursday, March 18, 2010

Video Encoding

So, encoding video with Handbrake - or, really, encoding video at all - seems to be more about hard drive throughput than anything else. It seems an odd assessment since I can physically see all of my processor cores maxing out on video encodes. Naturally the processor appeared to be the bottleneck. However, in all of the tests I have run on encoding video, hard drive bandwidth seems to be enormously important. Here's some quick facts:

My personal computer has 2 new Sata and 1 Pata drive in it. I put my source files on the 500GB Sata drive [read: rip to] and encode files to the 250GB Sata drive. Both drives are purportedly capable of 3Gb/s [roughly 375MB/s] sustained transfer rate. My computer runs Vista Ultimate. It has 4GB RAM. It averages about 80 fps on encodes. When encoding from a Sata to the 200GB Pata I get the same result, ~80fps.

My wife's computer is a bit slower than mine processor-wise. It has 3 Sata drives. I put the source files on a Raid 0 drive comprised of 2 WD Raptors [10,000 RPM as opposed to the typical 7200 RPM] and encode to a single 500GB Sata drive. Intuitively, this indicates the source throughput on my wife's computer would be far greater than on my own. The only other differences are: Windows 7 Home Premium & slower processor. Still 4GB of RAM. Despite the significantly slower processor, her computer blows mine away by averaging about 120 fps on encodes. That's 50% faster despite the slower processor.

My initial assessment was that Windows 7 made all the difference. I am prepared to alter that a bit.

Just for a fun test, I decided to do an encode on our fileserver to test the impact of hard drive throughput. The fileserver has an even slower processor than the two previously mentioned. [the numbers: mine @ 3.1Ghz x 4 cores - wife's @ 2.8 Ghz x 4 cores - fileserver @ 2.5 Ghz x 3 cores]. When working with source files on a Raid 1+0 Sata drive encoding to a single 500GB Sata drive the fileserver achieves about 70 fps on encodes. The fileserver also runs Windows 7 Home Premium. It also has 4GB RAM.

The test, then, involved putting 2 Pata drives into the file server. They both run off the same EIDE channel - master to slave - and they are both the newest models of Pata available. They are old, sure, since Pata was phased out long ago, but they aren't subpar for Pata drives. Using one as source and the other one as destination with everything else being equal, I tested an encode on the fileserver and achieved only a 30 fps average on encodes. That's less than half speed with the only difference being the use of Pata drives instead of Sata drives.

Just as a note, during the encode the processor still reported maximum utilization on all three cores despite the significantly slower encode speed. This has led me to the conclusion that the hard drive makes an enormous amount of difference in the encode process.

It gets even worse.

Repeating the encode on the fileserver using only a single Pata drive [as source and destination], the encode dropped to a 17 fps average. Repeating the encode again using only a single Sata drive, the encode dropped to a 50 fps average. So what's my conclusion? Multiple hard drives = enormously better for encoding video. Pata hard drives = the devil. Sata hard drives = amazing. Raid source drives = *cue angelic music*

So am I rescinding my earlier statement that Windows 7 is way faster than Vista? Not yet. I will test everything again once my computer is upgraded to W7HomePre to see what the real difference is.

No comments:

Post a Comment