X265 delivers superior quality and offers much better compression than X264
However, X265 only works with newer TV sets. I have a Samsung Series 8 60 inch F8000 LED TV, only 5 years old. There is a command on the Ask Ubuntu Forum that illustrates how to transcode X265 MKV to X264 MP4 using ffmpeg. I have it modified slightly and saved it as an executable script, as below:
#!/bin/bash
# transcode all x256 .mkv to X264 .mp4 with ffmeg
for i in *.mkv ; do
ffmpeg -i "$i" -bsf:v h264_mp4toannexb -sn -map 0:0 -map 0:1 -vcodec libx264 "$i.ts"
mv "$i.ts" "$i.mp4"
sleep 3
done
To use it, I "cd" to the folder that contains the X265 data and call the script ...
The item on the Ask Ubuntu forum also contains details of the ffmpeg options in the above command.
G. Patterson.   T/A PGTS ABN: 99885392845