Could not get the excellent @lisamelton's `transcode-video.rb` to work on my machine, because flatpak. My ruby skills are too rusty to enable me to adapt it, but it did spit out a proper set of HandBrakeCLI args for me, so I pasted those that into this:
https://gist.github.com/rpardee/42ab258ec0d25248af45eec92519a212
It'll be interesting to see how long it takes to go through all my ripped TV shows...