Re-encoding video to H.265 using FFMPEG

Published on
1 mins read
ffmpeg -i in.mp4 -c:v libx265 -c:a aac -tag:v hvc1 -crf 24 out.mp4
  • -c:v libx265 tells ffmpeg to encode video into h265 by using CPU. This option is preferred since CPU encoder will results in smaller file sizes than GPU encoder
  • -c:a aac (Optional) tells ffmpeg to encode audio into aac codec
  • -tag:v hvc 1 tagging video encode type to make video to be able to play h265 natively in Apple devices
  • -crf 24 constant rate factor
    • value between 0 (lossless) - 51 (lossy)
    • higher value means more loss of video quality, but smaller file size
    • default at 28, recommended at 18 before loss of quality becomes visible by eye