How do I convert 10-bit H.265 videos to H.264 without quality loss?

Convert 10-bit H.265 to 10-bit H.264:

ffmpeg -i input -c:v libx264 -crf 18 -c:a copy output.mkv
  • libx264 will automatically to to match the pixel format of the input, so no extra parameters are needed.

  • The example uses -crf 18 which will likely appear visually lossless. If you want true lossless mode then then use -crf 0, but note this can create large files. See FFmpeg Wiki: H.264.

Convert 10-bit H.265 to 8-bit H.265:

ffmpeg -i input -c:v libx265 -vf format=yuv420p -c:a copy output.mkv
  • Uses the format filter to choose the yuv420p pixel format to create 8-bit output.

  • Adjust the -crf value to provide the desired level of quality. Default is -crf 28. See FFmpeg Wiki: H.265.

  • If you want lossless mode then then replace -crf with -x265-params lossless=1, but note this can create large files.

Convert 10-bit H.265 to 8-bit H.264:

ffmpeg -i input -c:v libx264 -crf 18 -vf format=yuv420p -c:a copy output.mkv
  • Uses the format filter to choose the yuv420p pixel format to create 8-bit output.

  • The example uses -crf 18 which will likely appear visually lossless. If you want true lossless mode then then use -crf 0, but note this can create large files. See FFmpeg Wiki: H.264.