Search code examples
ffmpeg

Encode H265 to hvc1 codec


Here is the info of my source file: enter image description here

I want to keep audio quality and just encode the video track so I use this command:

ffmpeg -i INPUT -c:a copy -c:v libx265 video-h265.mp4

This is the result: enter image description here

But the codec of the video track is hev1 . I want it's hvc1


Solution

  • 'hev1'/'hvc1' are code points used to signal different packaging of the stream in the container mp4 file. There is no change in the coding itself. It is possible to round trip between the two modes. Try with mp4box :

    mp4box -raw 1 file.mp4 
    

    This will extract the stream into a raw HEVC file.

    mp4box -add file_track1.hvc output.mp4
    

    This will reimport the stream using hvc1 if it can.