CPU vs GPU upgrade?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
Banjaxed
Posts: 8
Joined: Sun Oct 25, 2020 10:21 am

CPU vs GPU upgrade?

Post by Banjaxed »

Hi - apologies if this has been answered elsewhere - I did a search, but couldn't find any similar topics.

I'm using Handbrake more than I used to and am considering an upgrade to improve speed. I do not need the absolute highest quality, as the video will likely be reencoded by Wistia.

I have an X370 motherboard, AMD Ryzen 5 1600X CPU, 16Gb RAM and an old nVidia 710 graphics card. Handbrake is 1.3.3.

I'm looking to upgrade either the processor, or the graphics card, but not both. I've narrowed the choice down to a Ryzen 7 3700X (my MB supports this), or an nVidia 1660 Super GPU.

Any advice on the relative merits of these potential upgrades would be most welcome.

Content is generally 1920x1080 25fps H264.

Thanks!
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: CPU vs GPU upgrade?

Post by Woodstock »

which do you care more about, quality of result, or encode speed?

Quality=CPU upgrade
Speed=hardware encode upgrade
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: CPU vs GPU upgrade?

Post by mduell »

It's more quality for size that favors CPU, since you can throw a comical number of bits at a hardware encode.
Banjaxed
Posts: 8
Joined: Sun Oct 25, 2020 10:21 am

Re: CPU vs GPU upgrade?

Post by Banjaxed »

Thanks, folks - these videos will be hosted on a website, which uses Wistia to deliver the content. The originals are edited using Premiere Pro and then I use Handbrake to reduce the size, suitable for upload to the website. Many users watch these videos on mobile phones, so all in all, I'd say that speed of encoding is more important than absolute quality.

I'm not sure if Handbrake has a linear relationship with CPU cores/threads? I know Premiere Pro doesn't, but not sure about Handbrake. So, with encoding using Premiere Pro and re-encoding using Handbrake, I think speed is what I'm after. Thanks!!
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: CPU vs GPU upgrade?

Post by s55 »

Throw a log up for one of your current encodes and we may be able to balance your settings better for better performance, negating the need for an upgrade. HandBrake by default is more interested in "getting it right" and focusing on quality/filesize rather than speed.

3700X is a pretty decent CPU for 1080p encoding and will give a nice bump. That said, if you are less fussed about quality, there are things you can do to make software encoding significantly faster without compromising too much on filesize which I guess is also important. The GPU encoders are not the most efficient for filesize.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: CPU vs GPU upgrade?

Post by mduell »

Banjaxed wrote: Tue Oct 27, 2020 6:04 pm Thanks, folks - these videos will be hosted on a website, which uses Wistia to deliver the content. The originals are edited using Premiere Pro and then I use Handbrake to reduce the size, suitable for upload to the website. Many users watch these videos on mobile phones, so all in all, I'd say that speed of encoding is more important than absolute quality.
Keep in mind the difference between quality and quality for size. Just about any encoder can get quality if you throw enough bits at it. But with mobile users, they're generally lower bandwidth (and/or have data caps), so having small sizes with acceptable quality is important.
Banjaxed
Posts: 8
Joined: Sun Oct 25, 2020 10:21 am

Re: CPU vs GPU upgrade?

Post by Banjaxed »

Thanks all - good advice. And thanks for the reminder about file size. In thinking just about speed vs quality, I'd overlooked that.
I'll run a test encode and post the log here. All contributions gratefully received!
Banjaxed
Posts: 8
Joined: Sun Oct 25, 2020 10:21 am

Re: CPU vs GPU upgrade?

Post by Banjaxed »

OK - here's the log from a typical encode:

Code: Select all

HandBrake 1.3.3 (2020061300)
OS: Microsoft Windows NT 10.0.18363.0
CPU: AMD Ryzen 5 1600X Six-Core Processor           
Ram: 16335 MB, 
GPU Information:
  NVIDIA GeForce GT 710 - 27.21.14.5671
Screen: 2560x1440
Temp Dir: C:\Users\DP1\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\DP1\AppData\Roaming\HandBrake

-------------------------------------------


# Starting Encode ...

[12:00:20] base preset: Transition 1080 25fps
[12:00:20] hb_init: starting libhb thread
[12:00:20] Starting work at: Fri Oct 30 12:00:20 2020
[12:00:20] 1 job(s) to process
[12:00:20] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": "av_aac",
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      "copy:aac",
      "copy:ac3",
      "copy:dtshd",
      "copy:dts",
      "copy:eac3",
      "copy:flac",
      "copy:mp3",
      "copy:truehd"
    ],
    "FallbackEncoder": "ac3"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": true,
    "File": "D:\\Tiny Sponges\\2.Transition\\Video\\Misc\\201030 Ger Graus test.mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": true
    },
    "Mux": "av_mp4"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 4,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 3,
        "Settings": {
          "block-height": "16",
          "block-thresh": "40",
          "block-width": "16",
          "filter-mode": "2",
          "mode": "3",
          "motion-thresh": "1",
          "spatial-metric": "2",
          "spatial-thresh": "1"
        }
      },
      {
        "ID": 12,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "1080",
          "width": "1920"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "D:\\Tiny Sponges\\2.Transition\\Video\\11.Interviews\\201023 Ger Graus\\Master\\201023 Ger Graus.mp4"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "x264",
    "Level": "4.0",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "fast",
    "Profile": "main",
    "Quality": 22.0,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[12:00:20] CPU:
[12:00:20]  - logical processor count: 12
[12:00:20] Intel Quick Sync Video support: no
[12:00:20] hb_scan: path=D:\Tiny Sponges\2.Transition\Video\11.Interviews\201023 Ger Graus\Master\201023 Ger Graus.mp4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image D:\Tiny Sponges\2.Transition\Video\11.Interviews\201023 Ger Graus\Master\201023 Ger Graus.mp4
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
src/libbluray/bluray.c:2585: nav_get_title_list(D:\Tiny Sponges\2.Transition\Video\11.Interviews\201023 Ger Graus\Master\201023 Ger Graus.mp4\) failed
[12:00:20] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[12:00:20] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Tiny Sponges\2.Transition\Video\11.Interviews\201023 Ger Graus\Master\201023 Ger Graus.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2020-10-24T16:59:55.000000Z
  Duration: 00:36:58.16, start: 0.000000, bitrate: 7472 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 7279 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2020-10-24T16:59:55.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2020-10-24T16:59:55.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
[12:00:20] scan: decoding previews for title 1
[12:00:20] scan: audio 0x1: aac, rate=44100Hz, bitrate=189588 English (AAC LC) (2.0 ch) (189 kbps)
[12:00:20] scan: 10 previews, 1920x1080, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[12:00:20] scan: supported video decoders: avcodec qsv
[12:00:20] libhb: scan thread found 1 valid title(s)
[12:00:20] Skipping subtitle scan.  No suitable subtitle tracks.
[12:00:20] Starting Task: Encoding Pass
[12:00:20] Skipping vfr filter
[12:00:20] Skipping crop/scale filter
[12:00:20] work: only 1 chapter, disabling chapter markers
[12:00:20] job configuration:
[12:00:20]  * source
[12:00:20]    + D:\Tiny Sponges\2.Transition\Video\11.Interviews\201023 Ger Graus\Master\201023 Ger Graus.mp4
[12:00:20]    + title 1, chapter(s) 1 to 1
[12:00:20]    + container: mov,mp4,m4a,3gp,3g2,mj2
[12:00:20]    + data rate: 7472 kbps
[12:00:20]  * destination
[12:00:20]    + D:\Tiny Sponges\2.Transition\Video\Misc\201030 Ger Graus test.mp4
[12:00:20]    + container: MPEG-4 (libavformat)
[12:00:20]      + optimized for HTTP streaming (fast start)
[12:00:20]      + align initial A/V stream timestamps
[12:00:20]  * video track
[12:00:20]    + decoder: h264
[12:00:20]      + bitrate 7279 kbps
[12:00:20]    + filters
[12:00:20]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[12:00:20]      + Decomb (mode=39)
[12:00:20]    + Output geometry
[12:00:20]      + storage dimensions: 1920 x 1080
[12:00:20]      + pixel aspect ratio: 1 : 1
[12:00:20]      + display dimensions: 1920 x 1080
[12:00:20]    + encoder: H.264 (libx264)
[12:00:20]      + preset:  fast
[12:00:20]      + profile: main
[12:00:20]      + level:   4.0
[12:00:20]      + quality: 22.00 (RF)
[12:00:20]      + color profile: 1-1-1
[12:00:20]  * audio track 1
[12:00:20]    + decoder: English (AAC LC) (2.0 ch) (189 kbps) (track 1, id 0x1)
[12:00:20]      + bitrate: 189 kbps, samplerate: 44100 Hz
[12:00:20]    + mixdown: Stereo
[12:00:20]    + dither: none
[12:00:20]    + encoder: AAC (libavcodec)
[12:00:20]      + bitrate: 160 kbps, samplerate: 44100 Hz
[12:00:20] sync: expecting 55453 video frames
[12:00:20] encx264: encoding at constant RF 22.000000
[12:00:20] encx264: unparsed options: level=4.0:ref=2:8x8dct=0:weightp=1:subme=6:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=30
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile Main, level 4.0, 4:2:0, 8-bit
[12:00:20] sync: first pts video is 0
[12:00:20] sync: "Chapter 1" (1) at frame 1 time 0
[12:00:20] sync: first pts audio 0x1 is 0
[12:11:09] reader: done. 1 scr changes
[12:11:09] work: average encoding speed for job is 85.454597 fps
[12:11:09] comb detect: heavy 40 | light 303 | uncombed 55109 | total 55452
[12:11:09] decomb: deinterlaced 40 | blended 303 | unfiltered 55109 | total 55452
[12:11:09] aac-decoder done: 95525 frames, 0 decoder errors
[12:11:09] h264-decoder done: 55452 frames, 0 decoder errors
[12:11:09] sync: got 55452 frames, 55453 expected
[12:11:09] sync: framerate min 25.000 fps, max 25.000 fps, avg 25.000 fps
x264 [info]: frame I:223   Avg QP:11.43  size:112902
x264 [info]: frame P:14051 Avg QP:15.99  size: 17603
x264 [info]: frame B:41178 Avg QP:20.56  size:  2171
x264 [info]: consecutive B-frames:  0.7%  0.6%  0.6% 98.0%
x264 [info]: mb I  I16..4: 59.9%  0.0% 40.1%
x264 [info]: mb P  I16..4:  1.7%  0.0%  1.8%  P16..4: 16.3%  7.1%  3.7%  0.0%  0.0%    skip:69.4%
x264 [info]: mb B  I16..4:  0.3%  0.0%  0.1%  B16..8:  7.8%  1.2%  0.1%  direct: 1.5%  skip:89.0%  L0:44.3% L1:47.9% BI: 7.8%
x264 [info]: coded y,uvDC,uvAC intra: 40.7% 60.2% 22.3% inter: 3.1% 4.9% 0.2%
x264 [info]: i16 v,h,dc,p: 52% 25% 13% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 24% 18%  5%  5%  5%  6%  5%  3%
x264 [info]: i8c dc,h,v,p: 54% 23% 18%  5%
x264 [info]: Weighted P-Frames: Y:0.3% UV:0.3%
x264 [info]: ref P L0: 69.0% 31.0%
x264 [info]: ref B L0: 83.2% 16.8%
x264 [info]: ref B L1: 94.6%  5.4%
x264 [info]: kb/s:1305.35
[12:11:10] mux: track 0, 55452 frames, 361911593 bytes, 1305.29 kbps, fifo 2048
[12:11:10] mux: track 1, 95526 frames, 44589960 bytes, 160.82 kbps, fifo 4096
[12:11:10] Finished work at: Fri Oct 30 12:11:10 2020
[12:11:10] libhb: work result = 0

# Encode Completed ...

# Unable to play sound. Reason: File not found!
Last edited by Anonymous on Mon Nov 02, 2020 4:01 pm, edited 1 time in total.
Reason: Logs in between [code][/code] blocks please
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: CPU vs GPU upgrade?

Post by mduell »

Disable comb detection and decomb/deinterlace for a little bit of free gains with 1080p sources.
Banjaxed
Posts: 8
Joined: Sun Oct 25, 2020 10:21 am

Re: CPU vs GPU upgrade?

Post by Banjaxed »

Thanks mduell - I've disabled those settings. Anything else I should do?
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: CPU vs GPU upgrade?

Post by mduell »

You can do faster x264 presets, at the expense of encoding efficiency (quality for size).

Beyond that, you need a faster CPU. Double the cores, better cores, and/or ~40% higher clockspeed.
Banjaxed
Posts: 8
Joined: Sun Oct 25, 2020 10:21 am

Re: CPU vs GPU upgrade?

Post by Banjaxed »

Apologies if this is a dumb question - when you say "faster x264 presets", do you mean increasing the 'quality' number in my existing preset, choosing a different preset, or something else? If it's choosing a different preset, for training videos delivered (mostly) to mobile devices, any suggestion as to which one?
Thanks!
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: CPU vs GPU upgrade?

Post by s55 »

Video Tab -> Encoder Preset (Slider)
Currently Set to: Fast

You could try Faster or Very Fast but I wouldn't myself go much further than that. If your hot happy with the results you can dial it back. That said, I wouldn't expect a massive difference but it should be a bit faster.
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: CPU vs GPU upgrade?

Post by rollin_eng »

Banjaxed
Posts: 8
Joined: Sun Oct 25, 2020 10:21 am

Re: CPU vs GPU upgrade?

Post by Banjaxed »

Thanks all - very kind of you to take the time to help!
I've run tests on a sample file and found a combination that seems to offer the best combination of speed, quality and file size. So, that's my new default preset.
Which brings me back to the original question of whether I should upgrade the CPU or the GPU. Handbrake isn't really the issue - it's more the original encoding from Premiere Pro - that's the slowest part of the workflow and where I think I could really benefit from more speed. I will ask that question in the Adobe forum, but any thoughts here gratefully received.
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: CPU vs GPU upgrade?

Post by rollin_eng »

Are you using cpu or gpu in your preset?
Banjaxed
Posts: 8
Joined: Sun Oct 25, 2020 10:21 am

Re: CPU vs GPU upgrade?

Post by Banjaxed »

Hi - I've enabled the GPU in both Handbrake and Premiere Pro, but as it's an old GT 710, it probably isn't doing much.

Now that Handbrake is better optimized, I'm more interested in speeding up Premiere Pro output. Hence the CPU vs GPU update question...
Post Reply