The sad truth is that the settings you pick are a matter of personal taste.

I'm a bit of an AV snob, but I also care about getting files small enough that they're easy to bring on SD cards to visit with friends and family - and that they'll play on most Blu-Ray players and TVs.

With that in mind, these are the settings that work for me:

Best (2 hour+ encodes) h.264, CPU x264

For FHD (1080p) Blu-Ray, I use these settings, at about 20mb per minute:

= Preset =
Super HQ 720p30 (Modified)

= Summary =
MKV File ===> for Blu-Rays with Subtitles
MP4 File ===> DVDs with Subtitles, Blu-Rays without Subtitles

= Dimensions =
Resolution Limit: 720p HD 

= Video =
Encoder: H.264 (x264)
Peak Framerate: 30
Constant Quality: 19.5
Preset: veryslow
Tune: film ===> for Life Action & 3D animation
      animation ===> Cartoons & Anime
Profile: high
Level: 3.1
Options: ref=5:bframes=5

= Audio =
AAC Stereo 160kbps

= Subtitles =
Foreign Audio Search (Burn In)
English PGS ===> Requires MKV for Blu-Ray
English VOBSUB ===> Works with MP4 for DVD

For DVD (480p) I make these modifications:

= Dimensions =
Resolution Limit: 480p HD

= Video =
Constant Quality: 19

I'll explain this more down below, but you might as well increase quality when you decrease resolution because you don't gain that much file size back anyway - preserving the visual quality of a video has somewhat of a roll-off as resolutions get higher.

Fast (7 - 15 minute encodes) h.264 VT on M1

Even if you're a snob, if you need to get a lot of video done quickly, using the macOS VideoToolbox on an Apple Silicon M1, you can rip through TV Shows at about 7-10 minutes per episode.

It's so fast, and the quality is so good, it's almost not worth the 2+ hours of GPU / CPU encoding to get better quality.
(but like I said - AV snob)

Video
Encoder: H.264 (M1 VideoToolbox)
Peak Framerate: 30
Quality: CQ 65

CQ 65 seems to be the magic number for me.

In fact, if you want noticeably better quality I'd recommend than rather than increasing CQ, you switch to x264 and target RF 20 or lower compression.

Technical Decisions

  • Why bframes=5?
  • Why RF 19.5?
    • Because it looks great at a small size. RF-17 is huge and approaches placebo. RF-21 is small, but approaches crap.
  • Why CQ 65?
    • Because it's near RF 20 and CQ 65+ doesn't seem to get much better.
  • Why 720p?
    • Because very high quality 720p looks much better to my eyes than good/high quality 1080p.
  • Why Peak Framerate 30?
    • I dunno. I considered constant 24.97, but I figured why not let it omit repeated / low / no motion frames?
  • Why MKV?
    • For Blu-Ray subtitles. MP4 was designed for DVD subtitles (VOBSUB), but not Blu-Ray (PGS). :-/
  • Why high profile?
    • Because that's the modern baseline for HD devices
  • Why level 3.1?
    • Because that's what you use for 720p30. If I were using 1080p30 It would be 4.0.
  • Why veryslow?
    • Because it significantly decreases the file size, and noticeably improves quality.

What I care about

  • Quality
  • Size
  • Subtitles
  • Smart TV Compatibility
  • Blu-Ray player USB Compatibility
  • Roku
  • Plex

Subtitles

I often have a hard time understanding while riding the remote between whispers and booms, so I like to have subtitles.

Quality

As stated, I want to make as few visual trade-offs as possible.

I know I shouldn't, but I pixel peep.

Sometimes I actually enjoy the shows that I've ripped myself less than the low-quality torrents I had before because I'm distracted by trying to determine if I got the best possible quality. Don't be like me.

Size

I have used MakeMKV to create full backups of my favorite movies, but those aren't streamed to my devices - they go on large, slow backup drives.

If I'm going to go through the bother of compressing a movie, it darn well better be convenient enough for me to be able to fit on one of those tiny SD-card sized drives that Macbooks come with these days - and actual SD cards as well, for when I'm visiting family and exposing them to new shows.

My target is in the ballpark of 20mb per minute.

  • 45-minute TV Show => 700~900mb
  • 2-hour movie => 2.5gb

That said, I have over a quarter of a terabyte of 1080p Gilmore Girls at 40mb per minute (~1.7gb) per episode - but that's its a rare exception - it's an archival HD copy which doesn't seem to have been publicly released. If I swapped it all out for my standard 720p, my wife would never notice.
(In fact, she probably wouldn't notice if I swapped it for 480p.)

Also, since RF-19 defines quality, and not bit rate, it's quite common for a high-quality (low-noise) cartoon to fall down near 10mb per minute, or an old, grainy film like Mary Poppins or Star Wars 4k77 to run upwards of 50mb per minute. I'm still trying to find the right DNR settings for that - since the noise is the primary culprit - might just have to live with it though (it is what it is?).

Great 720p is better than Good 1080p

I've run dozens of tests running two clips side by side on different mediums - including my 10ft projector screen - and what I've found is that for my target size and bitrate, it's absolutely better to have great 720p rather than to have good 1080p.

The file size goes down, and the quality goes up!

That's a winning combination in my book.

So while, yes, if I were willing to significantly increase the storage, transfer, and stream size of my videos I could potentially get the quality difference high enough to be noticable, I find that I can instead get noticeably better visual quality by beefing up my 720p.

h.265 is for 4k, NOT 1080p

In just about every test I ran, h.265 looks much worse on production quality movies (though it seems to be indistinguishable for my iPhone videos).

You can save a ton of space... but I don't think it's worth it.

And at about the same space, I think h.264 will look better. h.265 is a "high efficiency" codec - kinda like HE-AAC and other low-quality-by-design formats.

You'll see a lot of reviews out there with still image comparisons between h.265 and h.264, but DON'T TRUST 'EM. Comparing Stills and Video is like comparing Apples and Pies.

That said, I believe that when you have higher resolution images - 4k, 8k, etc - you may start to see some gains.

Since your eye literally can't see 4k anyway (except maybe perhaps on a 10ft projector screen, close up), I think the idea of h.265 is more to give you a little extra when there's a little extra to give, but to not waste space on things you can't see anyway - but at HD/FHD, you actually can see everything. You don't want to give up more than that because you don't want enhanced 480p, you want full HD.

If you're primarily watching videos on a phone or tablet then h.265 is probably well worth it - but not for TV or projector with "low resolution" movies produced in FHD (1080p) or lower.

VideoToolbox vs x264

I actually found that VideoToolbox's CQ 65 was 'good enough' for me and later picked the x264's RF 19.5 settings above due to some playback compatibily issues on my Roku.

I (as a snob) was actually willing to live with VT.

So when I came up with my x264 settings, I was actually working backwards to see how much more quality I could eek out at the same target file size as CQ 65.

And it is noticeably better... but just barely.

A little sharper. Maybe fewer blocks on fast movements on small shadowy figures. Maybe ever so slightly better color in dark light.

However, if I were just relaxing and enjoying the show rather than pixel peeping. I probably wouldn't notice.

In any case, reiterating what I said before, a CQ higher than 65 is NOT visually better quality from what I can tell. At least not by much.

CQ 55 definitely looks worse, but CQ 70 looks about the same. Slightly better maybe... not sure if it's as good as slower RF 20. Probably not.

It may be worth playing around more, but my guess is that the M1 accelerated encoding probably can't get that much better due to the limitations of the algorithms baked into the hardware.

Don't get me wrong. It's really good. I was willing to live with it all things considered.

But if you have the time and want even better quality, I think the answer isn't to bump up the CQ, but rather to start at veryslow RF 20 and then bump down to RF 19, RF 18, or maybe RF 17 (which approaches placebo, and really high file sizes).

Other Resources

Video Encoding is a tough nut to crack and there is no perfect solution. Just a lot of nerds talking about subjective experience and trying to apply objective reasoning to it...


By AJ ONeal

If you loved this and want more like it, sign up!


Did I make your day?
Buy me a coffeeBuy me a coffee  

(you can learn about the bigger picture I'm working towards on my patreon page )