H.265 Encoding with Handbrake Nightly

I’ve been testing H.265 to cut down on storage requirements for my media collection. I was using StaxRip until I discovered I did not like how Plex handled subtitles when using the MKV container. I liked that StaxRip  would use my Nvidia GPU and not my CPU, but subtitles were the deal breaker.

I decided to the tried and true Handbrake (the nightly version), which does support GPU encoding with Nvidia graphics cards. However, Handbrake also uses the CPU (often at 100%). I can live with this since Handbrake is much simpler to use and it is easy to burn in subtitles.

As mentioned above, I am using the nightly version and I update it often. I tweaked the Roku 1080p30 Surround profile to make my custom H.265/MKV preset:

  • Summary | Format: MKV
  • Dimensions | Cropping – Automtic and Anamorphic: Automatic
  • Filters | Defaults/no changes
  • Video | H.265 (Nvidia NVEnc), Framerate (FPS): Same as source, Variable Framerate, Constant Quality: 20 QP, Encoder Preset: Slow, remainder default.
  • Audio | Auto passthru all tracks. I also create a stereo track.
  • Subtitles | Foreign Audio Scan with Forced Only and Burn In checked.
  • Chapters | Create chapter markers checked.

I am seeing great reductions in file size using these settings. A Blu-ray movie ripped with MakeMKV was 23.2 GB, but Handbrake was able to compress it to 10.8 GB using the settings above. I watched the entire movie and it looked perfect. There was a night scene, which usually exposes bad encoding, but it looked perfect to me. There was no pixelation or large areas just made solid black or gray. The detail was incredible. I did use a movie from 2018 since the filming at night looked good. Some older movies have terrible night scenes and nothing will be able to make up for that.

Handbrake is also fast. I am seeing 180 to 220 FPS while converting files over my gigabit network from one NAS to another NAS. Transcoding a Blu-ray rip takes about 25 minutes, five minutes of which is the scanning for foreign audio process.

I saw much smaller H.265 file sizes with Handbrake when using just CPU, but it was taking about three hours per movie. This is using an Intel i7-8700K CPU with no overclocking. The frame rates and times are when converting video from one NAS to another NAS over a gigabit connection.

If you would like to create the same Handbrake profile, open a text document, paste the information below, and save it as a .json file (not a text file):

{
  "PresetList": [
    {
      "AlignAVStart": false,
      "AudioCopyMask": [
        "copy:aac",
        "copy:ac3",
        "copy:dtshd",
        "copy:dts",
        "copy:mp3",
        "copy:truehd",
        "copy:eac3"
      ],
      "AudioEncoderFallback": "none",
      "AudioLanguageList": [
        "eng"
      ],
      "AudioList": [
        {
          "AudioBitrate": 640,
          "AudioCompressionLevel": 0.0,
          "AudioEncoder": "copy",
          "AudioMixdown": "none",
          "AudioNormalizeMixLevel": false,
          "AudioSamplerate": "auto",
          "AudioTrackQualityEnable": false,
          "AudioTrackQuality": 0.0,
          "AudioTrackGainSlider": 0.0,
          "AudioTrackDRCSlider": 0.0
        },
        {
          "AudioBitrate": 160,
          "AudioCompressionLevel": 0.0,
          "AudioEncoder": "av_aac",
          "AudioMixdown": "stereo",
          "AudioNormalizeMixLevel": false,
          "AudioSamplerate": "auto",
          "AudioTrackQualityEnable": false,
          "AudioTrackQuality": 5.0,
          "AudioTrackGainSlider": 0.0,
          "AudioTrackDRCSlider": 0.0
        }
      ],
      "AudioSecondaryEncoderMode": true,
      "AudioTrackSelectionBehavior": "all",
      "ChapterMarkers": true,
      "ChildrenArray": [],
      "Default": false,
      "FileFormat": "mkv",
      "Folder": false,
      "FolderOpen": false,
      "Mp4HttpOptimize": false,
      "Mp4iPodCompatible": false,
      "PictureAutoCrop": true,
      "PictureBottomCrop": 140,
      "PictureLeftCrop": 0,
      "PictureRightCrop": 0,
      "PictureTopCrop": 140,
      "PictureDARWidth": 1920,
      "PictureDeblock": 4,
      "PictureDeinterlaceFilter": "decomb",
      "PictureCombDetectPreset": "default",
      "PictureCombDetectCustom": "",
      "PictureDeinterlacePreset": "default",
      "PictureDenoiseCustom": "",
      "PictureDenoiseFilter": "off",
      "PictureDenoisePreset": "light",
      "PictureDenoiseTune": "none",
      "PictureSharpenCustom": "",
      "PictureSharpenFilter": "off",
      "PictureSharpenPreset": "medium",
      "PictureSharpenTune": "none",
      "PictureDetelecine": "off",
      "PictureDetelecineCustom": "",
      "PictureItuPAR": false,
      "PictureKeepRatio": true,
      "PictureLooseCrop": false,
      "PictureModulus": 2,
      "PicturePAR": "auto",
      "PicturePARWidth": 1,
      "PicturePARHeight": 1,
      "PictureRotate": "0:0",
      "PictureForceHeight": 0,
      "PictureForceWidth": 0,
      "PresetDescription": "Nvenc add 2.0 audio, burn subtitles",
      "PresetName": "H265 MKV Cuda CQ20 Foreign Audio Scan",
      "Type": 1,
      "UsesPictureFilters": false,
      "UsesPictureSettings": 2,
      "SubtitleAddCC": false,
      "SubtitleAddForeignAudioSearch": true,
      "SubtitleAddForeignAudioSubtitle": false,
      "SubtitleBurnBehavior": "foreign",
      "SubtitleBurnBDSub": false,
      "SubtitleBurnDVDSub": false,
      "SubtitleLanguageList": [
        "eng"
      ],
      "SubtitleTrackSelectionBehavior": "none",
      "VideoAvgBitrate": 0,
      "VideoColorMatrixCode": 0,
      "VideoEncoder": "nvenc_h265",
      "VideoFramerateMode": "vfr",
      "VideoGrayScale": false,
      "VideoScaler": "swscale",
      "VideoPreset": "slow",
      "VideoTune": "",
      "VideoProfile": "auto",
      "VideoLevel": "auto",
      "VideoOptionExtra": "",
      "VideoQualityType": 2,
      "VideoQualitySlider": 20.0,
      "VideoQSVDecode": false,
      "VideoQSVAsyncDepth": 4,
      "VideoTwoPass": true,
      "VideoTurboTwoPass": false,
      "x264Option": "",
      "x264UseAdvancedOptions": false
    }
  ],
  "VersionMajor": "11",
  "VersionMicro": "0",
  "VersionMinor": "0"
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.