This thread is to invite experts and the interested to share notes on the popular x264 v2 stress test. For those unfamiliar, it's the preferred test for the Haswell Overclocking Guide [With Statistics] because it has the distinct advantages of:
Note: x264 was only recently repackaged as v2, which is much more focused than the original (thanks, angelotti!). A smaller better stresser and results are different. So be careful when reading results - it's important to say that you're using v2.
Also if you didn't know: The i7-4770K does notably better than i5-4670K due to how the 4770K does AVX (video encoding) better. So don't feel bad if your 4670K's fps isn't so hot. If you don't edit video.
As I've been using x264, I've wondered about several aspects of it. That's what this thread is for:
x264 v2 as a benchmark
This comes from the fps (frames per second) number and is exactly proportional to the time for each loop. Elapsed time is shown to the hundredths of a second in the console. fps is always 2121 (the number of frames) divided by elapsed time. fps itself is only good to three significant figures (sig figs, e.g., 3.18 fps), but you can get it to five sig figs if you calculate it using the hundredths of elapsed seconds.
This number is clearly subject to influences like any other benchmark would be (it drops if much else is running). You can also see other subtle effects; e.g. on my i5-4670K at 4.4 Ghhz (cache and RAM at 1:1), a loop finishes about 6 seconds (1%) faster if I run it on an SSD, not HDD. (It's CPU intensive, not disk intensive, but still sensitive enough to show some effect.) (My rig is in my sig and you can see more details in the "screencap" link above.)
Also FWIW, the first loop seems to take slightly longer than subsequent ones. Maybe I'm just imagining.
Anyway, your fps number is a quick benchmark you can use. You can make it more precise if you use hundredths of a second. Also see below for how to output capture this to a file, so you have it if you crash.
x264 also quotes another number which only seems to depend on the number-of-threads option, for me:
Unlike fps, it's not influenced by anything else running that I've noticed. Even if I bring fps to its knees, these numbers stay exactly as shown. It must be calculated relative to the actual CPU time allocated or some such, not elapsed time per se.
x264 itself makes "ENCODE.MKV" each time it loops. This file is 398,103,597 bytes for me, but this doesn't make any sense relative to the kb/s rates versus how long it ran (e.g. 667 seconds).
Perhaps someone who knows what it's actually doing (unlike me lol) can step in here. Can the kb/s number be used as a benchmark? Perhaps at least for threads?
What's x264 doing underneath the hood?
Of course, it's encoding a video. But can someone say more? In particular, what parts of one's system does it use beside CPU?
Does anything at all besides CPU matter much?
"Modding" the x264 package
I say "modding" a little tongue in cheek, because I'm only talking about extremely minor changes to DOS code, or whatever.
Still, I have found changes to its batch file like this to work better for me. New lines start with [NEW] and must be removed before running this:
Code:
... most of the code is the same from here.
With the [NEW] lines, a Directory listing of .log files is captured to a .txt, then displayed in the console when you start a new x264 session:
Code:
... which can be very helpful if your session crashed (in which case, it doesn't write out the .rtf in the usual batch file). Note how the "copy 1 to 2" type of code keeps the last 3 directory .TXTs of .logs around, just in case. Also, a dummy run1pass2loop0.log is output to capture start time. I attached my revised batch file, if anyone wants to see. I also removed some of the extra lines displayed to console, so it's a little tighter output. And hardcoded my fixed choices (16 threads, Normal priority).
There are sure to be other simple but useful modifications to the x264 batch file. Such as if the fps itself (hopefully, good to several more decimals), or time in seconds to the hundredths of a second, could be output to text files so they could be viewed later, like I showed above. It'd be really sweet if it could be summarized across however many loops have run so far. If anyone actually wants to make an EXE handler for the x264 package, a lot could be done for logging. (Don't forget to output incrementally since you might crash when OCing.)
In case anyone doesn't know, you can use BlueScreenView from Nirsoft to easily see when you crashed, and what the code was. Together with the text directories, you can still see how many loops you did, how fast, even if it crashes sometime in the middle of the night.
Ok, that's enough typing for now. If you have more insight on x264 v2, please speak up!
Thanks for helping make this place great - RK7
x264StabilityTest64bitlogthatalsocaptureslogsto.txt 2k .txt file
- being a real operation (doing actual video editing / processing); it's not artificial / synthetic,
- it is highly stressful; it is clearly worse (causes more instability) than, e.g., Prime95 for me and others,
- while at the same time being a very cool stressor; it causes more instability, but at lower temps, which makes it more relevant to real-world work (many want to know the temps to which real work would push their CPU, not artificially high temps)
- it only needs a few EXEs from a zip; it is highly portable and doesn't install anything. You can easily run it on HDD instead of SSD (to prevent SSD "wear")
- finally, it has its own little built-in benchmark for immediate feedback
Note: x264 was only recently repackaged as v2, which is much more focused than the original (thanks, angelotti!). A smaller better stresser and results are different. So be careful when reading results - it's important to say that you're using v2.
Also if you didn't know: The i7-4770K does notably better than i5-4670K due to how the 4770K does AVX (video encoding) better. So don't feel bad if your 4670K's fps isn't so hot. If you don't edit video.

As I've been using x264, I've wondered about several aspects of it. That's what this thread is for:
- How good a benchmark is it
- What exactly is it doing
- Modding the package
x264 v2 as a benchmark
This comes from the fps (frames per second) number and is exactly proportional to the time for each loop. Elapsed time is shown to the hundredths of a second in the console. fps is always 2121 (the number of frames) divided by elapsed time. fps itself is only good to three significant figures (sig figs, e.g., 3.18 fps), but you can get it to five sig figs if you calculate it using the hundredths of elapsed seconds.
This number is clearly subject to influences like any other benchmark would be (it drops if much else is running). You can also see other subtle effects; e.g. on my i5-4670K at 4.4 Ghhz (cache and RAM at 1:1), a loop finishes about 6 seconds (1%) faster if I run it on an SSD, not HDD. (It's CPU intensive, not disk intensive, but still sensitive enough to show some effect.) (My rig is in my sig and you can see more details in the "screencap" link above.)
Also FWIW, the first loop seems to take slightly longer than subsequent ones. Maybe I'm just imagining.
Anyway, your fps number is a quick benchmark you can use. You can make it more precise if you use hundredths of a second. Also see below for how to output capture this to a file, so you have it if you crash.
x264 also quotes another number which only seems to depend on the number-of-threads option, for me:
- Auto threads always = 35905.40 kb/s
- 8 threads always = 35912.18 kb/s
- 16 threads always = 36016.71 kb/s
Unlike fps, it's not influenced by anything else running that I've noticed. Even if I bring fps to its knees, these numbers stay exactly as shown. It must be calculated relative to the actual CPU time allocated or some such, not elapsed time per se.
x264 itself makes "ENCODE.MKV" each time it loops. This file is 398,103,597 bytes for me, but this doesn't make any sense relative to the kb/s rates versus how long it ran (e.g. 667 seconds).
Perhaps someone who knows what it's actually doing (unlike me lol) can step in here. Can the kb/s number be used as a benchmark? Perhaps at least for threads?
What's x264 doing underneath the hood?
Of course, it's encoding a video. But can someone say more? In particular, what parts of one's system does it use beside CPU?
- When my RAM's at 1:1 (2200 Mhz for 4.4 Ghz CPU), I get ~3.18 fps. Slowed to Auto (1333), I still get 3.07, only 3% less!
- Having cache at full 1:1 speed (44) or at Auto speed (38) makes no discernible difference. It's actually 0.01 fps slower when cache is faster, but that's well within margin of variability (Std Dev roughly 0.03).
- As previously stated, running on an SSD versus HDD results in an average 6 seconds (1%) less.
Does anything at all besides CPU matter much?
"Modding" the x264 package
I say "modding" a little tongue in cheek, because I'm only talking about extremely minor changes to DOS code, or whatever.
Still, I have found changes to its batch file like this to work better for me. New lines start with [NEW] and must be removed before running this:
Code:
Code:
@echo off
setlocal enabledelayedexpansion
cls
pushd "%CD%\test"
[NEW] copy x264_log2.txt x264_log3.txt
[NEW] copy x264_log1.txt x264_log2.txt
[NEW] dir *.log /o-d > x264_log1.txt
del *.log >NUL 2>&1
cls
echo.
[NEW] copy x264_log1.txt con:
echo x264 Stability Test
set target=1
set /p numpass="- Number of loops:"
set threads=16
set prio=normal
[NEW] echo | TIME >run1pass2loop0.log
echo.
echo - Running Test with %threads% threads, and %prio% priority in %numpass% loops
With the [NEW] lines, a Directory listing of .log files is captured to a .txt, then displayed in the console when you start a new x264 session:
Code:
Code:
04/30/2014 02:00 AM 58,552 run1pass2loop3.log
04/30/2014 01:49 AM 60,281 run1pass2loop2.log
04/30/2014 01:38 AM 59,237 run1pass2loop1.log
04/30/2014 01:27 AM 131 run1pass2loop0.log
There are sure to be other simple but useful modifications to the x264 batch file. Such as if the fps itself (hopefully, good to several more decimals), or time in seconds to the hundredths of a second, could be output to text files so they could be viewed later, like I showed above. It'd be really sweet if it could be summarized across however many loops have run so far. If anyone actually wants to make an EXE handler for the x264 package, a lot could be done for logging. (Don't forget to output incrementally since you might crash when OCing.)
In case anyone doesn't know, you can use BlueScreenView from Nirsoft to easily see when you crashed, and what the code was. Together with the text directories, you can still see how many loops you did, how fast, even if it crashes sometime in the middle of the night.
Ok, that's enough typing for now. If you have more insight on x264 v2, please speak up!
Thanks for helping make this place great - RK7
x264StabilityTest64bitlogthatalsocaptureslogsto.txt 2k .txt file