Knowing that it works fine with mp4 muxer (mp4v1).
I am using the latest version 2.7.1
The library the MP4v2 muxer is based on – libmp4v2 – doesn't support HEVC for the video stream. Contrary to what the name suggests, libmp4v2 is not an actively developed project. Please use the libavformat-based MP4 muxer (there is no such thing as "mp4v1").