Best settings for converting from h264 to hevc?

20,065

There is no best settings because quality is subjective, but the usual guidelines of libx265 (assuming you are using this encoder) is similar to libx264:

  • Use the highest -crf value that gives you an acceptable quality. Default value is 28.
  • Use the slowest -preset you have patience for. Default value is medium.
  • Stream copy the audio (which you are already doing).

Note that you will be re-encoding the artifacts present in your H.264 inputs which will harm compression efficiency.

I generally wouldn't bother re-encoding H.264 to H.265.

See FFmpeg Wiki: H.265 for some basic info.

Share:
20,065

Related videos on Youtube

cclloyd
Author by

cclloyd

Updated on September 18, 2022

Comments

  • cclloyd
    cclloyd almost 2 years

    I'm trying to convert some of my library to HEVC to save space. The idea being I re-encode the existing media and save 20-50% file size.

    What would be some recommended settings for converting and having minimal quality loss, while saving as much file size as possible (quality over file size).

    The current command I'll be using is generally

    ffmpeg -i input.mkv -c:v hevc -c:a copy -crf ??? output.mkv
    

    Note that encoding from the original medium is not an option for me right now. I would have to use the current files I have.

  • Christophe
    Christophe over 5 years
    Just a couple of quick clarifications: * For -crf, lower numbers mean better quality. * For -preset, I've not noticed any particular improvement in filesize or quality with presents slower than medium.
  • looooongname
    looooongname almost 5 years
    @Christophe According to the ffmpeg docs, slower presets don’t affect quality, only file size.
  • Sriram Murali
    Sriram Murali about 4 years
    { ffmpeg -strict 2 -hwaccel auto -i "inputfile.mp4" -c:v hevc_nvenc -rc vbr -cq 24 -qmin 24 -qmax 24 -profile:v main10 -pix_fmt p010le -b:v 0K -c:a aac -map 0 "outputfile.mp4" }