How to increase performance?

Post your testing results with HandBrake.
Post Reply
CoriolisSTORM
Posts: 10
Joined: Fri Nov 19, 2010 5:26 am

How to increase performance?

Post by CoriolisSTORM »

Ladies and gentlemen, newb here to the boards, but I've been using HandBrake since about '04. (wonderful piece of software, you guys rock!) I've recently built a great i7 based system, and HandBrake really screams on it, I get about 30 FPS using the iPad preset on Blu Rays ripped with MakeMKV. My question is this, what can be done to increase performance of Handbrake on my machine even more? My specs:

Intel Core i7 930 (stock speed, 2.88GHz)
Asus P6X58D Premium motherboard
6 GB Corsair Dominator DDR 3 RAM
Intel X25M SSD (OS Drive) 80gb
2x 1TB Western Digital 7200 RPM SATA 6GB/S hard drives in software RAID0 (Asus board won't do hardware RAID 0 for these)
Seagate 7200 RPM 1TB Sata 3GB/S hard drive
Windows 7 Ultimate 64 bit

That's all the relevant specs anyway, I'm using a nightly build from last week with no problems, can't remember the exact version as I'm typing this from my iPad. What would benefit me most, higher clock speeds (as in an overclock), more RAM, or a faster HDD setup? Just curious, I've got to bring my temps down anyway, it's at 62 C running a full encode, but it really screams! I noticed while watching system monitor last night that the CPU usage is spread very well across all 4 (8) cores, but it regularly drops down to 20-50% then right back up, like it's waiting for data or something. Any ideas? I use my 2 WD drives as the ones to read the dump from, and write the output file to the Seagate if it means anything. I'll get some logs for you all either tomorrow or the next day, wish I had access to them now.


My previous 2 HandBrake setups:

Apple MacBook 4.1, Core 2 Duo 2.4GHz, 4 GB RAM (takes about 3-4 times longer than the HD clip length, it overheated and crashed on an encode last night, poor baby, it averages 9FPS on the HD files...)

AMD Athlon XP 2800+ 2.0 GHz, 2 GB RAM, set it on a DVD, and go to bed and hope it's done by the next morning, not gonna try HD files... My how times have improved!
If this is the wrong forum I apologize, but "Speed Kills!" :mrgreen:
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: How to increase performance?

Post by TedJ »

Improve your cooling and overclock. Extra RAM or a faster disk subsystem won't significantly affect encode times at all.
CoriolisSTORM wrote:I noticed while watching system monitor last night that the CPU usage is spread very well across all 4 (8) cores, but it regularly drops down to 20-50% then right back up, like it's waiting for data or something. Any ideas?
Handbrake uses ffmpeg for decoding the source, and it is single threaded only at this stage.
mduell
Veteran User
Posts: 8206
Joined: Sat Apr 21, 2007 8:54 pm

Re: How to increase performance?

Post by mduell »

Use faster x264 settings.
CoriolisSTORM
Posts: 10
Joined: Fri Nov 19, 2010 5:26 am

Re: How to increase performance?

Post by CoriolisSTORM »

I have switched to x264 which has improved things a bit. Currently researching a water cooling set up and some hopefully reasonable over clocks. Really eyeing a 980x, not just for this, but that's a big chunk of change...
mcortez
Posts: 2
Joined: Sun Feb 20, 2011 9:14 pm

Re: How to increase performance?

Post by mcortez »

Need help. I am running 1080p conversions in ATV gen 2 using dynaflash's HD settings and the conversions take forever. I am looking at 15 hours for Casino Royale in 1080p. Where am I bottlenecking. I am running a 2.4GHz core duo with a 250 GB 5400 HD and 6 GBs of DDR3 RAM. I assume based on Actvity Monitor readings that it's at the CPU level but I am wondering if a SSD would also help and if so how much. I would really appreciate some feedback here. I am considering upgrading to an iMac 17 Quad core with SSD for this very purpose but if can drop a SSD into my Macbook and get a bump that would be about $3k cheaper!
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: How to increase performance?

Post by s55 »

SSD won't make any difference. HB is CPU bound, not HD bound. The drive won't even be breaking a sweat.

Quad core / Hex / Octo Core CPU is what you want.
mcortez
Posts: 2
Joined: Sun Feb 20, 2011 9:14 pm

Re: How to increase performance?

Post by mcortez »

s55 wrote:SSD won't make any difference. HB is CPU bound, not HD bound. The drive won't even be breaking a sweat.

Quad core / Hex / Octo Core CPU is what you want.
Any idea how much of a performance bump I'll get jumping to a tricked out 2.93 i7 quad core imac?
Deleted User 11865

Re: How to increase performance?

Post by Deleted User 11865 »

Easily 2.5x faster, maybe even 3x or more.

TBH 15 hours sounds too much for a dual 2.4 GHz dual core, encoding at 720p. I've never tried dynaflash's ATV preset but I'm pretty sure my quad 2.8 GHz iMac could encode 720p in real time with these settings. I also think my 2.2 GHz Core 2 Duo MBP should get it done in less than 15 hours for a 2.5 hour movie (dyna's settings @ 720p) - my guess would be something like 8-10 hours.

Maybe there's just a huge difference between the Core Duo and the Core 2 Duo… or there's something wrong with your setup. Posting an Activity Log might help (see red banner, all logs are saved to disk).

Edit: Casino Royale, Chapter 1 (9m38s), 720p, dynaflash's settings on a 2.8GHz Quad Core i5 iMac:

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/LOGICAL_VOLUME_ID.m4v: 2011-02-20 22:58:02 +0100
Handbrake Version: 0.9.5 x86_64 (2011010300)

[22:58:02] macgui: Rip: Pending queue count is 0
[22:58:02] macgui: getNextPendingQueueIndex next pending encode index is:1
[22:58:03] macgui: scanning specifically for title: 1
[22:58:03] hb_scan: path=/Volumes/LOGICAL_VOLUME_ID, title_index=1
[22:58:03] scan: BD has 21 title(s)
[22:58:03] bd: scanning title 1
[22:58:03] bd: duration is 02:24:34 (8674624 ms)
[22:58:03] bd: video id=1011, stream type=H264, format 1080p
[22:58:03] bd: aspect = 1.77778
[22:58:03] bd: checking audio 1
[22:58:03] bd: audio id=1100, lang=English (AC3), 3cc=eng
[22:58:03] bd: checking audio 2
[22:58:03] bd: audio id=1101, lang=English (MPEG), 3cc=eng
[22:58:03] bd: checking audio 3
[22:58:03] bd: audio id=1102, lang=Francais (AC3), 3cc=fra
[22:58:03] bd: chap 1 packet=768, 578244 ms
[22:58:03] bd: chap 2 packet=2188416192, 593217 ms
[22:58:03] bd: chap 3 packet=4694325696, 364822 ms
[22:58:03] bd: chap 4 packet=6039568320, 582915 ms
[22:58:03] bd: chap 5 packet=8349229056, 280613 ms
[22:58:03] bd: chap 6 packet=9442566912, 322905 ms
[22:58:03] bd: chap 7 packet=10740517248, 748622 ms
[22:58:03] bd: chap 8 packet=13655242944, 571237 ms
[22:58:03] bd: chap 9 packet=15888263616, 589755 ms
[22:58:03] bd: chap 10 packet=18185739456, 774023 ms
[22:58:03] bd: chap 11 packet=21218568192, 515097 ms
[22:58:03] bd: chap 12 packet=23241887616, 288454 ms
[22:58:03] bd: chap 13 packet=24419313792, 633507 ms
[22:58:03] bd: chap 14 packet=26954179392, 702243 ms
[22:58:03] bd: chap 15 packet=29691219456, 454328 ms
[22:58:03] bd: chap 16 packet=31609750080, 674632 ms
[22:58:03] bd: title 1 has 16 chapters
[22:58:03] scan: decoding previews for title 1
[22:58:03] scan: title angle(s) 1
[22:58:03] scan: audio 0x1101: pcm_bluray, rate=48000Hz, bitrate=4608000 English (MPEG) (5.1 ch)
[22:58:03] scan: audio 0x1100: AC-3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
[22:58:03] scan: audio 0x1102: AC-3, rate=48000Hz, bitrate=448000 Francais (AC3) (5.1 ch)
[h264 @ 0x10304e600] non-existing PPS referenced
[h264 @ 0x103088400] non-existing PPS referenced
[h264 @ 0x10304d800] non-existing PPS referenced
[h264 @ 0x1030ba000] non-existing PPS referenced
[h264 @ 0x1030ba600] non-existing PPS referenced
[h264 @ 0x1030bc000] non-existing PPS referenced
[h264 @ 0x1030bc600] non-existing PPS referenced
[h264 @ 0x1030bcc00] non-existing PPS referenced
[22:58:04] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 140/142/0/0, aspect 16:9, PAR 1:1
[22:58:04] stream: 59 good frames, 22 errors (37%)
[22:58:04] scan: title (0) job->width:1920, job->height:800
[22:58:04] libhb: scan thread found 1 valid title(s)
[22:58:04] macgui: ScanDone state received from fQueueEncodeLibhb
[22:58:04] macgui: Preset: dynaflash ATV
[22:58:04] macgui: processNewQueueEncode number of passes expected is: 1
[22:58:04] macgui: Start / Stop set to chapters
[22:58:04] macgui: prepareJob exiting
[22:58:04] 1 job(s) to process
[22:58:04] starting job
[22:58:04] sync: expecting 13887 video frames
[ac3 @ 0x103095200] No channel layout specified. The encoder will guess the layout, but it might be incorrect.
[22:58:04] job configuration:
[22:58:04]  * source
[22:58:04]    + /Volumes/LOGICAL_VOLUME_ID
[22:58:04]    + title 1, chapter(s) 1 to 1
[22:58:04]  * destination
[22:58:04]    + /Users/tim/Desktop/LOGICAL_VOLUME_ID.m4v
[22:58:04]    + container: MPEG-4 (.mp4 and .m4v)
[22:58:04]      + 64-bit formatting
[22:58:04]  * video track
[22:58:04]    + decoder: h264
[22:58:04]      + bitrate 200 kbps
[22:58:04]    + frame rate: same as source (around 23.976 fps)
[22:58:04]    + loose anamorphic
[22:58:04]      + storage dimensions: 1920 * 1080 -> 1280 * 528, crop 140/142/0/0, mod 16
[22:58:04]      + pixel aspect ratio: 132 / 133
[22:58:04]      + display dimensions: 1270 * 528
[22:58:04]    + encoder: x264
[22:58:04]      + options: b-adapt=2:b-pyramid=none:trellis=0:weightp=0:vbv-maxrate=5500:vbv-bufsize=5500
[22:58:04]      + quality: 20.00 (RF)
[22:58:04]  * audio track 0
[22:58:04]    + decoder: English (MPEG) (5.1 ch) (track 2, id 1101)
[22:58:04]    + mixdown: Dolby Pro Logic II
[22:58:04]    + encoder: ca_aac
[22:58:04]      + bitrate: 160 kbps, samplerate: 48000 Hz
[22:58:04]  * audio track 1
[22:58:04]    + decoder: English (AC3) (5.1 ch) (track 1, id 1100)
[22:58:04]      + bitrate: 448 kbps, samplerate: 48000 Hz
[22:58:04]    + AC3 passthrough
[22:58:04] encx264: min-keyint: auto (23), keyint: 240
[22:58:04] encx264: encoding with stored aspect 132/133
[22:58:04] encx264: Encoding at constant RF 20.000000
x264 [info]: [22:58:04] reader: first SCR 1044806 id 4113 DTS 1044806
using SAR=132/133
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
x264 [info]: profile High, level 3.1
No accelerated IMDCT transform found
[22:58:04] h264: "" (1) at frame 0 time 3754
[23:07:24] reader: end of chapter 1 (media 1) reached at media chapter 2
[23:07:24] stream: 13865 good frames, 0 errors (0%)
[23:07:24] reader: done. 2 scr changes
[23:07:27] work: average encoding speed for job is 24.700424 fps
[23:07:27] sync: got 13864 frames, 13887 expected
[23:07:27] h264-decoder done: 13864 frames, 0 decoder errors, 0 drops
[23:07:27] render: lost time: 0 (0 frames)
[23:07:27] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: frame I:117   Avg QP:17.57  size: 89022  PSNR Mean Y:45.79 U:52.58 V:51.85 Avg:46.87 Global:44.67
x264 [info]: frame P:5293  Avg QP:22.04  size: 24216  PSNR Mean Y:42.98 U:49.85 V:49.00 Avg:43.99 Global:40.91
x264 [info]: frame B:8454  Avg QP:26.10  size:  7467  PSNR Mean Y:41.24 U:50.41 V:49.29 Avg:42.40 Global:40.16
x264 [info]: consecutive B-frames:  3.5% 34.1% 28.3% 34.1%
x264 [info]: mb I  I16..4: 13.1% 52.4% 34.5%
x264 [info]: mb P  I16..4:  1.7%  7.4%  2.1%  P16..4: 30.7% 18.7% 15.1%  0.0%  0.0%    skip:24.3%
x264 [info]: mb B  I16..4:  0.2%  2.0%  0.4%  B16..8: 37.5%  6.0%  1.9%  direct: 3.2%  skip:48.8%  L0:38.9% L1:53.9% BI: 7.2%
x264 [info]: 8x8 transform intra:67.3% inter:45.8%
x264 [info]: coded y,uvDC,uvAC intra: 75.1% 35.3% 17.8% inter: 18.0% 9.9% 4.8%
x264 [info]: i16 v,h,dc,p: 59% 13%  6% 22%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 13% 24%  7%  9%  9%  9%  8%  9%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 15% 18%  7% 10%  9%  9%  7%  7%
x264 [info]: i8c dc,h,v,p: 70% 13% 14%  3%
x264 [info]: ref P L0: 77.3% 13.3%  9.4%
x264 [info]: ref B L0: 80.5% 19.5%
x264 [info]: SSIM Mean Y:0.9700011 (15.229db)
x264 [info]: PSNR Mean Y:41.940 U:50.215 V:49.198 Avg:43.045 Global:40.456 kb/s:2790.61
[23:07:27] pcm_bluray-decoder done: 0 frames, 0 decoder errors, 0 drops
[23:07:27] mux: track 0, 13864 frames, 201708563 bytes, 2790.44 kbps, fifo 8
[23:07:27] mux: track 1, 27104 frames, 12011171 bytes, 166.16 kbps, fifo 256
[23:07:27] mux: track 2, 18052 frames, 32349184 bytes, 447.52 kbps, fifo 256
[23:07:27] libhb: work result = 0

Code: Select all

[23:07:27] work: average encoding speed for job is 24.700424 fps
That's just a tad faster than real time. The i7 would probably be 10-20% faster (due to the higher frequency but also Hyper-Threading).
robandcat
Posts: 22
Joined: Wed Nov 24, 2010 1:12 am

Re: How to increase performance?

Post by robandcat »

These bench marks are all dandy but it does depend on the rf factor eg. rf 28 will encode really fast compared to rf 16. Just saying :mrgreen:
CoriolisSTORM
Posts: 10
Joined: Fri Nov 19, 2010 5:26 am

Re: How to increase performance?

Post by CoriolisSTORM »

Been a while, I know, but here's an update. I've since upgraded the system above to an i7 980x with a Corsair liquid cooler, the HX100 I think it is). I have seen a remarkable decrease in encoding times. I'll look around for the sample video files to convert and play with and get back with you on the times. What I'm back for is another reason, and I saw no reason to clutter up the boards of this fine site with another thread of mine. My Mac Mini (Core 2 Duo from late 2009) died on me suddenly with a dead logic board. As it is cost prohibitive to buy a new logic board and I don't really want to buy another Mini yet, I've decided to build a PC of my own in this general form factor. I've seen mention on AMD's APU pages of GPU acceleration with Handbrake and the upcoming Trinity APUs (looks like I'll be getting a Llano one though, Trinity isn't due out for a while.) Is this just some more of their marketing stuff or is there some new work that has been done between you guys?
Deleted User 11865

Re: How to increase performance?

Post by Deleted User 11865 »

The OpenCL work is not done by us. It'll likely land in HandBrake eventually, but it's a matter of months (or longer), not weeks.
CoriolisSTORM
Posts: 10
Joined: Fri Nov 19, 2010 5:26 am

Re: How to increase performance?

Post by CoriolisSTORM »

Rodeo wrote:The OpenCL work is not done by us. It'll likely land in HandBrake eventually, but it's a matter of months (or longer), not weeks.
I thought not. I was thinking that you guys "codecs" (I know, not the right term), but x264 and ffmpeg and the like have to support it first correct? Thank you for your prompt response! You guys continue to crank out good software!
Deleted User 11865

Re: How to increase performance?

Post by Deleted User 11865 »

CoriolisSTORM wrote:
Rodeo wrote:The OpenCL work is not done by us. It'll likely land in HandBrake eventually, but it's a matter of months (or longer), not weeks.
I thought not. I was thinking that you guys "codecs" (I know, not the right term), but x264 and ffmpeg and the like have to support it first correct? Thank you for your prompt response! You guys continue to crank out good software!
Of course, x264 will have it first. Then the nightly builds (presumably very shortly after x264 commits it), and finally a HandBrake release.

viewtopic.php?f=6&t=24279#p111572
mduell
Veteran User
Posts: 8206
Joined: Sat Apr 21, 2007 8:54 pm

Re: How to increase performance?

Post by mduell »

CoriolisSTORM wrote:I've seen mention on AMD's APU pages of GPU acceleration with Handbrake and the upcoming Trinity APUs (looks like I'll be getting a Llano one though, Trinity isn't due out for a while.) Is this just some more of their marketing stuff or is there some new work that has been done between you guys?
CoriolisSTORM wrote:I thought not. I was thinking that you guys "codecs" (I know, not the right term), but x264 and ffmpeg and the like have to support it first correct? Thank you for your prompt response! You guys continue to crank out good software!
New work by AMD, and currently only available to those AMD shares it with.

Also note x264 just committed threaded lookahead, which improves performance particularly for faster encoding. Should be in HB soon if not already.
Deleted User 11865

Re: How to increase performance?

Post by Deleted User 11865 »

mduell wrote:
CoriolisSTORM wrote:I've seen mention on AMD's APU pages of GPU acceleration with Handbrake and the upcoming Trinity APUs (looks like I'll be getting a Llano one though, Trinity isn't due out for a while.) Is this just some more of their marketing stuff or is there some new work that has been done between you guys?
CoriolisSTORM wrote:I thought not. I was thinking that you guys "codecs" (I know, not the right term), but x264 and ffmpeg and the like have to support it first correct? Thank you for your prompt response! You guys continue to crank out good software!
New work by AMD, and currently only available to those AMD shares it with.
x264 OpenCL lookahead patch is not difficult to find if you hang around #x264dev on IRC, though. It's not developed in secret.
madmossy
Posts: 2
Joined: Mon Jan 21, 2013 9:39 am

Re: How to increase performance?

Post by madmossy »

An i7 3770K @ 4Ghz can encode 1080p High Profile 4.1 - Film with RF @ 22 in almost real time, I get ~25-28 FPS when encoding.
Post Reply