HEVC (H.265) files are small, but many devices and programs cannot play them: older TVs and media players, some video editors, and many Windows PCs without the HEVC codec installed. The fix is to re-encode the video stream to H.264 with libx264. H.264 is the most widely supported video codec.

If FFmpeg shows libx265 or hvc1 errors while encoding, see FFmpeg H.265/HEVC Errors instead.

1. Why Convert HEVC to H.264?

HEVC compresses better than H.264, which makes it good for storage. The figure usually quoted is 40–50% smaller at the same quality. At matched VMAF (a video quality score), the measurement on the compression page found 26–35%. The saving depends on the footage. The problem is playback support:

Target HEVC (H.265) H.264
Old TVs / media players Often unsupported Almost always works
Windows (no HEVC codec) “Can’t play” / no video Plays out of the box
Older video editors Import fails / no preview Imports cleanly
Web <video> in older browsers Spotty Universal
Phones (5+ years old) Hit or miss Reliable

When a file must play everywhere, H.264 is the safe choice. The cost: the video is re-encoded, which loses some quality and takes a lot of CPU time, and the H.264 file is usually larger than the HEVC original.

-c:v copy cannot do this. Copying changes only the container, not the codec. See Copy vs Re-encode for why HEVC → H.264 always means re-encoding.

2. The Basic Conversion

For a standard 8-bit HEVC file:

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -preset medium -c:a aac output.mp4
  • -c:v libx264 … encode the video stream as H.264
  • -crf 20 … quality level (lower = better quality, bigger file)
  • -preset medium … balance between encode speed and compression
  • -c:a aac … re-encode audio to AAC (broadly compatible)

With most footage, -crf 20 is hard to tell apart from the source. The output stays an .mp4 file, which is what old players expect.

3. CRF — Quality vs Size

CRF (Constant Rate Factor) is the main quality setting. libx264 accepts 0–51; lower numbers mean higher quality and larger files.

CRF Visual result Typical use
18 Visually lossless to most eyes Archival, big screens
20 Excellent, hard to tell apart Recommended default
23 Good (libx264 default) General sharing
26 Noticeable softening on detail Small files, quick clips
28 Visible compression Aggressive size cutting

A few CRF points change the file size and quality noticeably. How much depends on the footage; there is no fixed rule such as “X points = half the size”. If you need a specific file size rather than a quality level, use two-pass encoding instead; see Two-Pass Encoding. If you mainly want a smaller file, Compress Video covers CRF, scaling and bitrate together.

4. Preset — Speed vs Compression

-preset sets how much effort the encoder spends. Slower presets compress more efficiently but take longer. They do not change the quality target; CRF does that.

Preset Speed Compression efficiency
ultrafast Fastest Lowest
veryfast Fast Lower
medium Default Baseline
slow Slower Higher
veryslow Slowest Highest

If you have time, -preset slow compresses more efficiently. At the same CRF, though, the quality also changes a little, so the file is not always smaller. For a quick job, medium is fine.

5. The 10-bit HEVC Trap (Force 8-bit yuv420p)

Much of the HEVC from phones, cameras and HDR sources uses 10-bit color (yuv420p10le). If you give that straight to libx264, the output may become High 10 H.264, which many old players cannot decode. Force standard 8-bit yuv420p so the file plays on as many devices as possible:

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -pix_fmt yuv420p -c:a aac output.mp4
  • -pix_fmt yuv420p … force 8-bit 4:2:0, the most widely supported pixel format

This is the safest command for most files. If a converted file plays sound but shows a black or garbled picture on an old device, the usual cause is a missing -pix_fmt yuv420p.

HDR sources: Converting 10-bit HDR to 8-bit yuv420p changes only the bit depth. It does not convert HDR to SDR (tone mapping), so the colors can look washed out, dull or otherwise wrong. For correct SDR colors, add a tone-mapping step; see HDR to SDR.

6. Keep the Audio As-Is

If the source audio is already AAC (very common in HEVC MP4s), you do not need to re-encode it. Copy it instead. This saves time and avoids a second round of quality loss:

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -c:a copy output.mp4
  • -c:a copy … copy the audio stream unchanged (fast, lossless)

If the player cannot play the copied audio (for example DTS or Opus in an MP4), use -c:a aac instead.

7. Troubleshooting

Picture is black or scrambled on an old TV/player

Cause: The output is 10-bit (High 10 profile) H.264. Fix: Add -pix_fmt yuv420p to force 8-bit (Section 5).

Conversion is extremely slow

Cause: A slow preset on a long, high-resolution file. Fix: Use -preset medium or -preset veryfast. Software H.264 encoding runs on the CPU, so long encodes are normal.

File got bigger than the HEVC original

Cause: This is normal. H.264 is less efficient than HEVC. Fix: Raise the CRF (for example -crf 23) or lower the resolution. See Compress Video.

Audio is missing after conversion

Cause: The audio was copied in a format your player cannot play, such as DTS or Opus. If MP4 cannot hold the format at all, the audio does not just disappear: the conversion fails with Could not find tag for codec .... Fix: Use -c:a aac instead of -c:a copy. This fixes both cases.

iPhone HEVC won’t play on Windows even after this

Cause: The problem is not the video format. For example, the file was not fully transferred, the original recording is damaged, or the player app is at fault. Fix: See Play iPhone Video on Windows.

FAQ

Q1. Does converting HEVC to H.264 lose quality? A. Yes. Re-encoding always loses some quality. With -crf 18–20 the loss is hard to see, but it is not lossless. Remuxing with -c copy changes only the container and cannot change the codec.

Q2. Will the H.264 file be larger than the HEVC? A. Usually, yes. H.264 needs more bits for the same quality.

Q3. Which CRF should I use? A. Start at -crf 20. Use 18 for archive quality, or 23–26 for a smaller file.

Q4. How do I know if my file is 10-bit? A. Run ffprobe input.mp4 and look for yuv420p10le in the video stream line. If you see it, use the -pix_fmt yuv420p command in Section 5.

Q5. Can I keep HEVC but just make it play on more devices? A. Adding the hvc1 tag sometimes helps on Apple devices. For really old players, only converting to H.264 works reliably. See FFmpeg H.265/HEVC Errors.