Compress a video for android using ffmpeg
The solution may be just to reconfigure (install) ffmpeg with x265 headers by setting --enable-libx265 for build as in the documentation
However keep in mind that x265 encoding/decoding is still relatively new and is not implemented/present well enough in Android devices unless you have a newer/branded device*.
(hw support, optimizations)
*generally speaking. - even 2017's Galaxy S8 has built-in HEVC support even in official camera app