What H.264 encoding means and why you might need it

H.264 (also called AVC or MPEG-4 Part 10) is a video compression standard that makes files smaller without losing much visible quality. If you have video in another format — MOV, AVI, MKV, WebM, or dozens of others — you may need to convert it to H.264 because a specific device, platform, or workflow requires it. Older phones, streaming services, and video editing software often default to H.264 because it plays on nearly everything and doesn't demand much processing power.

The conversion process is straightforward: you pick a tool, point it at your source file, choose H.264 as the output codec, and let it encode. The time this takes depends on the file length, your computer's speed, and the quality settings you choose. A two-hour movie might take anywhere from 30 minutes to several hours.

Key Takeaways

  • H.264 is a video codec that compresses files to smaller sizes while keeping quality acceptable for most uses, and many devices and platforms require it.
  • FFmpeg is free, command-line based, and works on Windows, Mac, and Linux; it's the fastest option if you're comfortable typing commands.
  • HandBrake is free, has a graphical interface, and handles most common video formats without needing to learn commands.
  • Adobe Media Encoder, Final Cut Pro, and DaVinci Resolve all include H.264 export options if you already use them for editing.
  • Conversion time depends on file length, your computer's processor, and quality settings — expect 30 minutes to several hours for a feature-length film.

Using FFmpeg from the command line

FFmpeg is a free, open-source tool that runs on Windows, Mac, and Linux. It's the fastest option if you're willing to use the command line. Download it from ffmpeg.org, install it, and you can convert almost any video format to H.264.

The basic command looks like this: ffmpeg -i input.mov -c:v libx264 -preset medium output.mp4. Replace input.mov with your source file name and output.mp4 with what you want to call the result. The -preset option controls speed versus file size: ultrafast encodes quickly but creates larger files, medium is a middle ground, and slow takes longer but produces smaller files. Most people use medium or fast.

If your source file has audio you want to keep, FFmpeg copies it by default. If you need to adjust audio quality, add -c:a aac -b:a 128k to set the audio codec and bitrate. For a file with multiple audio tracks, you can select one with -map 0:v:0 -map 0:a:0 (this takes the first video and first audio track).

Using HandBrake with a graphical interface

HandBrake is free software with a point-and-click interface, making it the easiest option if you don't want to type commands. Download it from handbrake.fr, open it, and click the folder icon to select your source video.

In the main window, you'll see a list of presets on the left. Click H.264 under the Presets section — this automatically sets the codec and reasonable quality settings. The preset name tells you the target device: H.264 720p30 creates a file suitable for older phones, while H.264 1080p30 keeps higher resolution. If you want to adjust quality yourself, look for the Video tab and change the Quality slider — higher numbers mean better quality but larger files.

Once you've chosen your preset and output location (click the folder icon next to Save As), click Start Encode. HandBrake shows you the progress and estimates how long it will take. You can close the window and let it run in the background.

Converting within video editing software

If you already use Adobe Premiere Pro, Final Cut Pro, or DaVinci Resolve, you don't need a separate tool. Each has an export or render function that lets you choose H.264 as the output codec.

In Adobe Media Encoder (which comes with Premiere Pro), open your project, click Add to queue, then in the Preset column choose a preset that includes H.264 — look for names like H.264 - Match Source or YouTube 1080p Full HD. Click the preset name to open settings and adjust quality if needed, then click Start Queue.

In Final Cut Pro, go to File > Export > Master File, then in the dialog choose Video Codec: H.264. In DaVinci Resolve, go to the Deliver tab, set Video Codec to H.264, and click Add to Render Queue. All three let you preview the quality settings before encoding starts.

Understanding bitrate and quality trade-offs

The bitrate is how much data the encoder writes per second of video. Higher bitrate means better quality but larger files. A bitrate of 2000 to 4000 kbps (kilobits per second) is typical for streaming or playback on phones. A bitrate of 8000 to 12000 kbps is closer to what you'd use if you're archiving video or preparing it for further editing.

Most tools let you set bitrate directly or choose a quality level that sets it for you. In HandBrake, the Quality slider does this automatically — moving it right increases bitrate. In FFmpeg, add -b:v 4000k to set bitrate to 4000 kbps. If you're not sure what to use, start with 3000 to 4000 kbps, encode a short test clip, and watch it on the device where it will actually play. If it looks blocky or blurry, increase the bitrate and try again.

Choosing between MP4 and MKV containers

H.264 is a codec (the compression method), but it needs a container — a file format that holds the video, audio, and metadata together. The two most common containers for H.264 are MP4 and MKV.

MP4 is more widely compatible. Older phones, streaming platforms, and web browsers almost always play MP4 files. If you're encoding for a device you're not sure about, MP4 is the safer choice. Most tools default to MP4 when you choose H.264.

MKV is more flexible. It can hold multiple audio tracks, subtitles, and chapters in a single file without re-encoding. If you're archiving video with multiple language tracks or preparing files for a media server like Plex, MKV is often better. In FFmpeg, use -c:v libx264 output.mkv to create an MKV file. In HandBrake, click the Presets menu and look for H.264 MKV options.

Troubleshooting common encoding problems

If your encoded file won't play, the most common cause is that the device or player doesn't support the container or audio codec, not the H.264 video itself. Try playing the file in VLC media player (free, plays almost everything) to confirm the file itself is valid. If VLC plays it but your target device doesn't, try re-encoding to MP4 instead of MKV, or change the audio codec to AAC instead of whatever you used.

If encoding is very slow, check your computer's CPU usage while it's running. If it's below 50%, your tool may be using only one processor core. FFmpeg uses multiple cores by default, but some graphical tools don't. In HandBrake, go to Preferences > General and increase Concurrent Encodes if you're encoding multiple files. If you're encoding a single file and it's still slow, try changing the preset from slow to medium or fast — you'll get a slightly larger file but it will finish much sooner.

If the output file is much larger than expected, you likely set the bitrate too high or used a quality setting meant for archival rather than playback. Start with 3000 kbps and test on your target device before encoding the full file.

Frequently Asked Questions

Can I convert H.264 to another format?

Yes, the same tools work in reverse. FFmpeg, HandBrake, and editing software can read H.264 files and output them in other codecs like VP9, AV1, or HEVC. The command structure is identical — just change the codec name and output extension.

Will converting to H.264 reduce video quality?

Some quality is lost during compression, but at reasonable bitrates (3000 to 5000 kbps) the loss is usually invisible on phones and tablets. If you're encoding at very low bitrates (under 1000 kbps) or very high quality settings (above 10000 kbps), the difference becomes visible. Test on the device where the video will actually play.

How do I know what bitrate to use?

Start with 4000 kbps for general use, 2000 kbps for phones or streaming, and 8000 kbps if you plan to edit the file further. Encode a 30-second test clip at your chosen bitrate, watch it on the target device, and adjust up or down based on what you see.

Does H.264 work on all devices?

H.264 plays on nearly all phones, tablets, computers, and streaming devices made in the last 10 years. Very old devices (pre-2010) may not support it. If you're encoding for an older device, check its specifications or test a short file first.

What's the difference between H.264 and H.265?

H.265 (HEVC) is a newer codec that compresses video more efficiently, creating smaller files at the same quality. However, it's slower to encode and not supported on older devices. Use H.265 only if your target device supports it and you have time to wait for encoding.