keepcalculator

06 Numbers and Powers

Convert H.265 to H.264: A Practical Guide

Card No. 06·14117 · Updated · Standard formula, shown below

To convert H.265 (HEVC) video to H.264 (AVC), you need to re-encode the video using software like HandBrake, FFmpeg, or a dedicated converter. This guide explains the reasons for converting, the steps involved, and the trade-offs in file size and quality.

Why Convert H.265 to H.264?

H.265 (High Efficiency Video Coding, HEVC) is the successor to H.264 (Advanced Video Coding, AVC). It compresses video more efficiently, typically achieving the same quality at about half the bitrate. However, H.265 support is not universal. Many older devices, web browsers, and media players only decode H.264. Converting ensures your video plays on a wider range of hardware and software without requiring a new player or codec pack.

Common scenarios where conversion is needed:

  • Uploading to a platform that only accepts H.264 (e.g., some social media sites).
  • Playing on an older TV, set-top box, or portable player.
  • Editing in software that doesn’t support H.265 natively.
  • Sharing with someone whose device lacks HEVC support.

How H.265 and H.264 Differ

Both codecs use block-based compression, but H.265 uses larger coding tree units (up to 64×64 pixels) compared to H.264’s macroblocks (16×16). This allows H.265 to encode more efficiently, especially at high resolutions (4K and above). H.265 also introduces more advanced motion compensation and intra-prediction techniques.

The practical difference: H.265 files are usually 30-50% smaller than H.264 at the same visual quality. But that efficiency comes at a cost—encoding and decoding H.265 requires more processing power. Older devices may not have hardware decoders for H.265, making playback stuttery or impossible.

Choosing a Conversion Method

You have several options, each with its own strengths:

  • HandBrake – Free, open-source, available for Windows, macOS, and Linux. It has a graphical interface and presets for many devices. Good for batch conversion.
  • FFmpeg – A command-line tool that is powerful and scriptable. Ideal for users comfortable with the terminal. It gives you full control over encoding parameters.
  • VLC Media Player – Can convert video via its “Convert/Saveâ€� feature, though options are limited. Useful for a quick one-off conversion.
  • Online converters – Web-based services that require no installation. However, they often have file size limits and upload your video to a third-party server, which may raise privacy concerns.

Step-by-Step: Using HandBrake

  1. Download and install HandBrake from the official website.
  2. Open HandBrake and click “Open Source� to select your H.265 video file.
  3. Choose a preset that matches your target device (e.g., “Fast 1080p30�). This sets the container to MP4 and the video codec to H.264 by default.
  4. Go to the “Video� tab. Under “Video Encoder,� select “H.264 (x264).�
  5. Adjust quality settings: Constant Quality RF (e.g., 20-23) is a good balance. Lower RF = higher quality and larger file.
  6. Click “Start Encode.� The output file will be saved in the destination folder you set.

Step-by-Step: Using FFmpeg

If you prefer the command line, FFmpeg is a powerful alternative. First, install FFmpeg (available from ffmpeg.org or your package manager). Then run:

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4

Explanation of flags:

  • -c:v libx264 – sets the video codec to H.264.
  • -crf 23 – constant rate factor; lower is higher quality (range 0-51, typical 18-28).
  • -preset medium – encoding speed vs. compression trade-off. Use “slowâ€� for better compression, “fastâ€� for quicker encoding.
  • -c:a aac -b:a 128k – converts audio to AAC at 128 kbps.

For batch conversion, you can loop over files in a script.

Quality and File Size Trade-offs

Converting from H.265 to H.264 always results in a larger file for the same perceived quality, because H.264 is less efficient. To keep quality high, use a CRF value around 18-20. If you need a smaller file, you can accept a slightly lower quality (CRF 23-28), but the file will still be larger than the original H.265.

Watch out for “double compression� – if your original H.265 was already lossy, re-encoding to H.264 will degrade quality further. The only way to avoid this is to go back to the original uncompressed source, which is rarely available. So, convert only when necessary.

Common Problems and Solutions

  • Audio sync issues – May occur if the original has unusual audio delay. In HandBrake, check the “Audioâ€� tab and adjust the “Audio DRCâ€� or delay. In FFmpeg, use -af "adelay=...".
  • Subtitle problems – Some subtitles are embedded in the H.265 stream. In HandBrake, go to the “Subtitlesâ€� tab and select “Burn Inâ€� if you want them hardcoded.
  • File size unexpectedly large – If you use a low CRF (e.g., 18) and high bitrate audio, the output can be huge. Adjust CRF upward or use a target bitrate.
  • Playback stutters after conversion – This may be due to the player not supporting the audio codec (e.g., AC3). Convert audio to AAC or MP3.

Frequently Asked Questions

Does converting H.265 to H.264 lose quality?

Yes, because it is a lossy re-encode. The original H.265 already lost some information from the source, and converting to H.264 loses a bit more. However, with a high enough bitrate (low CRF), the loss is often invisible to the eye.

Can I convert without re-encoding?

No, H.265 and H.264 use different compression algorithms, so a direct stream copy is not possible. You must decode and re-encode the video.

What is the best CRF value for H.264?

For most content, CRF 20-23 is a good balance. For archival quality, use 18. Higher values (28+) will show visible artifacts.

Is there a way to convert on my phone?

Yes, apps like “Video Converter� or “Media Converter� are available on iOS and Android. They work similarly but may have fewer options. Be aware of privacy when using online converters.

Why is my converted file larger than the original?

H.264 is less efficient than H.265, so at the same quality, the file will be larger. If you want a smaller file, you must accept lower quality (higher CRF).

Can I keep the same resolution and frame rate?

Yes, by default HandBrake and FFmpeg preserve the original resolution and frame rate. You can change them if needed, but that may cause quality loss or motion artifacts.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →