These are a couple of scripts I keep around to help me with Plex encodings. Credit to nebhead for the post processing script. I believe I've modified it a bit but the majority is still theirs.
The other script (reencode.sh) is designed to clean up unneeded files, previews, etc etc, then uses ffprobe to check for files already encoding to HEVC, and then creates a manifest of files which are not, and encodes them.