Video encoding advice

Hi, as I am just about to start setting up my home plex media server, I would very much like some guidence on what format to encode my dvd and blu-ray movies to.

I obviously want to achieve a high picture and sound quality but want to keep the file size to no more than around 4gb if this is possible, bearing in mind I will be keeping all movies to 1080p for the time being.

Should I go with x264 still or is now a good time to move to x265 HEVC and either way, which encoder would you recommend I use, Handbrake is the one I have been looking at so far?

Thanks for any help you can offer.

I hope you’re watching these with something under 40inches otherwise it’s going to look like crap at those sizes

I personally use handbrake constant quality around 20. Only stereo AAC I only use a sound bar. Recently switched to hevc for remote streaming purposes but all my clients direct play hevc (thanks apple). My h264 files are about 7 to 10 gig, hevc under 5. Look great on my TV’s (46in)

I suggest vidcoder .
It’s free
Uses handbrake back end
Much easier
Many size / quality options

I set my movies bitrate to 3000bps and they usually well under 4gb.
And look fine on my 65"

Thank you to all who have offered advice, very much appreciated.