Skip to main content

Container · Codec

How to convert any video to MP4: a guide by file type

What MOV, WebM, MKV, AVI, raw .264 and .thm files are, which convert to MP4 in your browser, and what to do with the rest. One sample of each tested.

12 min readGuides
Container · Codecazelify
Guides

How to convert any video to MP4: a guide by file type

Key takeaways

  • The extension names the container, not the codec; an MP4 with H.264 video and AAC sound plays almost everywhere.
  • MOV, WebM and MKV convert in the browser when it can decode the codec inside; this converter can't open AVI, because browsers don't play it.
  • A raw .264 file from a security camera is already H.264, so it can be wrapped into an MP4 without re-encoding.
  • A .thm file is a thumbnail picture a camera saves next to a video; convert the video with the same name instead.

To convert a video to MP4, open it in a converter that can read its format, and save it again as an MP4 with H.264 video and AAC sound, the combination most phones, browsers and editors play. Most of the work is knowing what your file actually is: a .mov from an iPhone, a .webm screen recording, a .264 from a security camera and a .thm from an old camcorder need four different answers, and one of them isn't a video at all. This guide explains what MP4 is, then goes through the common file types one by one: what each is, where it comes from, and whether you can convert it for free in your browser.

What MP4 is, and why it plays almost everywhere#

A video file is two things in one. The container is the file format: the box that holds the streams, their timing and their metadata. The codecs are how each stream inside is compressed. MP4 is a container, formally MPEG-4 Part 14, based on the ISO base media file format.[1] The extension tells you the container; it doesn't tell you the codec.[2]

Fig. 01
A video file is a container holding compressed streams; the extension names the container, not the codec.A .mp4 file is an MP4 container. Inside it is a video stream compressed with a codec such as H.264 or HEVC, an audio stream compressed with a codec such as AAC, and timing information that keeps them in sync. Converting to MP4 can mean changing the container only, or decoding and re-encoding the streams.
The file (.mp4)The container
Video streamH.264, HEVC, AV1...
Audio streamAAC, Opus...
Timing and indexKeeps them in sync
  1. 01 → The file (.mp4)The container
  2. 02 → Video streamH.264, HEVC, AV1...
  3. 03 → Audio streamAAC, Opus...
  4. 04 → Timing and indexKeeps them in sync
A video file is a container holding compressed streams; the extension names the container, not the codec.

What makes an MP4 play "everywhere" is the codec pair most of them carry: H.264 video, the most widely supported video codec of the last two decades, and AAC audio.[3][4] An MP4 with HEVC video won't play on some Windows computers without an extra decoder; an MP4 with H.264 plays almost anywhere. So "convert to MP4" in practice means "make an H.264 MP4".

MP4 isn't always the best format to keep. Editors working on a long project often keep footage in the camera's own format, or in an editing codec, and only export MP4 at the end, because each re-encode is a generation of loss. Archivists keep originals untouched. MP4 with H.264 is the right format for sharing, uploading and playing back; it's the format of the finished file, not necessarily of the working one. That's why the advice throughout this guide is to keep the original and convert a copy.

The audio side matters less often, but it matters. AAC is the audio codec most MP4 files carry and nearly every player reads; Opus and Vorbis, common in WebM, are excellent codecs that some older devices don't read inside an MP4. Converting moves the sound to AAC along with the picture, so the file works on the widest range of devices.

There are two ways to get there:

  • Re-encoding decodes the video and encodes it again as H.264. It works on anything the converter can read, and costs one generation of compression, which is invisible at a good bitrate.
  • Re-wrapping (remuxing) moves streams that are already H.264 into an MP4 container without touching them. It's fast and lossless, but only possible when the codec is already right.

The free convert to MP4 tool re-encodes files your browser can play, at their own size and frame rate, and re-wraps raw H.264 camera streams without re-encoding. It runs in your browser: no upload, no sign-up and no watermark.

File types at a glance#

We dropped one real sample of each common type on the converter in Chrome and recorded what happened. Each sample was four seconds of our own talking Short, re-packaged into that format.

ExtensionWhat it usually isWhere it comes fromConverts here?
.movQuickTime container, usually H.264 or HEVCiPhone, Mac screen recordings, camerasYes, if the browser decodes its codec (H.264: yes)
.webmWebM container, VP8, VP9 or AV1 with OpusBrowser screen recorders, web downloadsYes
.mkvMatroska container, any codecScreen recorders, downloadsYes, when the codec inside is H.264, VP9 or AV1
.aviOld AVI containerOlder cameras and softwareNo: the browser can't open AVI
.264, .h264Raw H.264 stream, no containerSecurity cameras and DVRsYes, wrapped without re-encoding
.265, .hevcRaw HEVC streamNewer cameras and DVRsNo: export as MP4 from the recorder
.thmA thumbnail picture (JPEG)Camcorders, older action camerasNot a video
.dav, .hubA recorder's own containerSecurity DVR and NVR systemsOnly if it's actually raw H.264 inside

The rest of this guide explains each row.

MOV, WebM, MKV and AVI#

MOV#

MOV is Apple's QuickTime container.[5] An iPhone records MOV with either H.264 ("Most Compatible" in the camera settings) or HEVC ("High Efficiency"). An H.264 MOV converts in any current browser. An HEVC MOV plays in Safari and in Chrome on computers with hardware HEVC decoding; on computers without it, the browser can't decode the picture, and the converter says so instead of making a broken file.[6] If you have an HEVC MOV that won't open, change the iPhone's camera format to Most Compatible for future recordings, or convert the clip on the phone or Mac first.

WebM#

WebM is an open container designed for the web, carrying VP8, VP9 or AV1 video with Vorbis or Opus audio.[7] Screen recordings made in the browser are often WebM. Chrome and Edge decode all of these, so WebM converts cleanly; the result is an H.264 MP4 that also opens in phone galleries and older editors that don't read WebM.

MKV#

MKV is Matroska, a flexible open container that can hold almost any codec.[8] OBS and many screen recorders write MKV because it survives a crash mid-recording. Whether an MKV converts depends on what's inside: H.264, VP9 and AV1 convert; codecs the browser can't decode (some older or broadcast formats) don't. Our H.264 MKV converted without trouble.

AVI#

AVI is Microsoft's container from the 1990s.[9] It still turns up from old cameras, screen-capture software and archives. Browsers don't open AVI files at all, whatever codec they hold, so the converter shows "This browser can't play that file". Our sample held perfectly ordinary H.264 video and was still refused, because the problem is the container, not the codec. To convert AVI, use a desktop application that reads it, and save an MP4 from there.

Raw streams: .264 and .h264#

Security cameras, dashcams and DVRs often save video as a raw elementary stream: compressed H.264 video with no container around it.[3] The file is just the camera's encoded pictures, one after another, cut into units the standard calls NAL units.[10] There's no frame rate, no index and no audio track, which is why phones, editors and media players refuse to open a .264 file even though the video inside is ordinary H.264.

Because the video is already H.264, converting it doesn't need a re-encode. The free converter recognises a raw H.264 stream by its contents, not its extension, reads its picture size from the stream's own settings, and wraps every picture into an MP4 exactly as the camera recorded it. It takes seconds, and the picture is bit-for-bit the camera's. Our 4-second sample came out as 122 frames at 540 × 960 and 30 frames a second.

Fig. 02
What to do with a file from a security camera or DVR.If the file is a raw H.264 stream (often .264 or .h264), wrap it into MP4 without re-encoding. If it is a raw H.265 stream, export the clip as MP4 from the recorder. If it is the recorder's own container format, export it as MP4 or AVI from the recorder or its player app. Keep the original file in every case.yesnoyesno
Is the file a raw H.264 stream (the converter recognises it)?
Wrap it into MP4: no re-encode, keep the original
Is it a raw H.265 stream or the recorder's own format?
Export it as MP4 from the recorder or its player app
Try it as an ordinary video file
  1. Is the file a raw H.264 stream (the converter recognises it)?
    1. yes → Wrap it into MP4: no re-encode, keep the original
    2. no → Is it a raw H.265 stream or the recorder's own format?
      1. yes → Export it as MP4 from the recorder or its player app
      2. no → Try it as an ordinary video file
What to do with a file from a security camera or DVR.

The frame rate. Many cameras don't write their frame rate into the stream. When it's there, the MP4 uses it. When it isn't, the MP4 plays at 25 frames a second, and the tool offers 30 instead; most cameras record at one of the two. If people seem to move too fast or too slowly, switch.

B-frames. Some streams store pictures out of display order to compress better. The converter reads each picture's place in the display order from the stream and writes the MP4 so players show them in the right order.

.265 and .hevc#

Newer cameras record HEVC (H.265) and may save raw .265 or .hevc streams.[6] The free converter wraps raw H.264 only. For HEVC, export the clip as MP4 from the recorder or its viewing app instead.

.dav and .hub#

Some recorders save their own container formats, such as .dav or .hub. These aren't standard video files. Sometimes the bytes inside are a plain raw H.264 stream with a different extension, and then the converter recognises the stream and wraps it. More often they're a vendor container that browsers can't read; the converter then tells you so. The fix is to use the recorder's own export, usually from its playback screen or desktop viewer, and choose MP4 or AVI. Encrypted or password-protected recordings aren't supported.

Not really videos: .thm and other companions#

Some files sit next to your videos and look like they belong with them, but aren't videos.

.thm files are thumbnail pictures. Camcorders and older action cameras save a small JPEG next to each recording so their own screens can show a preview, and give it a .thm extension. They sit beside the videos in the camera's DCIM folder, the standard camera file layout.[11] There's no video in it to convert. The converter recognises the picture and tells you to look for the video file with the same name, usually a .mp4, .mov or .mts in the same folder.

Other companions you may see: .lrv low-resolution proxy videos from action cameras (a small copy of the real video, playable but not what you want to edit), .xml or .sidecar files with metadata, and .srt or .vtt caption files, which hold text, not pictures. If you're trying to get the words out of a video, see the transcription guide.

Why a file won't convert#

When a converter refuses a file, there are only a handful of reasons, and the message usually tells you which.

The browser can't open the container. AVI is the common case. Nothing inside the file is unusual, but the browser has no reader for the box it's packed in. A desktop converter that reads the container is the only fix.

The browser can't decode the codec. The container opens, but the video inside uses a codec the browser has no decoder for on your computer. HEVC on a computer without hardware HEVC support is the common case; some professional codecs (ProRes from cameras, for example) are another. The fix is to convert on a device that decodes it, or to re-export from the camera or app in H.264.

The file is damaged. A recording cut short by a dead battery or a full card may have no index, so nothing can find where the pictures are. Some recorders write a container that's only finalised when recording stops; a crash leaves it unreadable. Formats like MKV are designed to survive this, which is why screen recorders use them.

It isn't a video. Thumbnails, proxies and metadata files sit next to videos and share their names. The converter recognises the common ones and says so.

It's too big. The browser reads the whole file into memory, so files over an hour or 2 GB are refused before they're read. Split long recordings on the device that made them.

Fig. 03
Why a converter refuses a file, and what to do about it.If the browser cannot open the container, as with AVI, use a desktop converter. If the container opens but the codec cannot be decoded, as with HEVC on some computers, re-export as H.264 from the camera or app. If the file opens but is damaged or is a thumbnail, look for the original video. Otherwise the file should convert.yesyesnono
Does the browser open the file's container (MP4, MOV, WebM, MKV)?
Can the browser decode the codec inside on this computer?
It converts
Re-export as H.264 from the camera or app
Use a desktop converter that reads it (AVI, vendor formats)
  1. Does the browser open the file's container (MP4, MOV, WebM, MKV)?
    1. yes → Can the browser decode the codec inside on this computer?
      1. yes → It converts
      2. no → Re-export as H.264 from the camera or app
    2. no → Use a desktop converter that reads it (AVI, vendor formats)
Why a converter refuses a file, and what to do about it.

Converting on a phone#

Phones can play almost everything they record, but converting on a phone has its own limits.

iPhone. In Settings, then Camera, then Formats, choose Most Compatible, and new videos record as H.264 from the start. Apple also notes that when you share by AirDrop, Messages or email and the receiving device doesn't support HEVC, the video may be sent in a more compatible format automatically.[12]

Android. Most Android phones record H.264 MP4 by default; some high-end models offer HEVC to save space, with a setting to switch back.

In the browser on a phone. The browser converter works on phones too, but a phone's browser has far less memory than a computer's, so long or high-resolution videos may not fit. For anything over a few minutes, a computer is the reliable choice.

Messaging apps are not converters. Sending a video to yourself through a chat app often produces an MP4, but it's usually compressed hard and scaled down along the way. It's a quick fix for something you only need to watch once; it isn't a good copy to edit.

Converting in the browser, step by step#

  1. Open the convert to MP4 tool in desktop Chrome or Edge.
  2. Drop the file, or choose it. The tool looks at the file's first bytes to see what it really is.
  3. For an ordinary video, it shows what you'll get (MP4, the size, the length). Press Convert to MP4; the video is re-encoded as H.264 at its own size and frame rate.
  4. For a raw H.264 stream, it wraps it straight away and downloads the MP4. Change the frame rate if motion looks wrong.
  5. For a file it can't convert, it says what the file is and what to do instead.

Files can be up to an hour long and 2 GB, because the browser reads the whole file into memory. The output plays on most phones, browsers and editors; from there you can trim or crop it, merge it with other clips or add your logo as a watermark. If the file came out of an editor whose export keeps failing, the Clipchamp export guide collects the usual causes.

Quality and size after converting#

Re-encoding adds one generation of compression. The converter keeps the video's resolution and frame rate and spends a little more than the source's own bitrate, so the result looks the same; it doesn't upscale, crop or change the frame rate. A file converted from a very efficient codec (AV1 or HEVC) to H.264 can come out larger, because H.264 needs more bits for the same picture. If size matters, compress once afterwards rather than lowering quality during the conversion.

A raw H.264 stream wrapped into MP4 is the same size as the stream plus a few kilobytes of container. Nothing about the picture changes.

iPhone, Mac, Safari, Chrome, Edge and Windows are trademarks of their owners. Azelify isn't affiliated with or endorsed by them.

Frequently asked questions#

How do I convert a .264 file to MP4?#

Drop it on a converter that reads raw H.264 streams. The free browser tool wraps the stream into an MP4 without re-encoding, using the frame rate in the stream or 25 fps if there isn't one (switch to 30 if motion looks wrong).

What is a .thm file, and can I convert it to MP4?#

A .thm file is a thumbnail picture a camera saves next to a video. It contains no video. Convert the .mp4 or .mov with the same name instead.

Can I convert AVI to MP4 in my browser?#

Not with this converter: it relies on the browser to read the file, and browsers don't open AVI. Use a desktop application that reads AVI.

Why won't my iPhone MOV convert?#

It's probably HEVC, and your computer has no hardware HEVC decoder. Record in Most Compatible (H.264) in the camera settings, or convert it on the phone or Mac.

Does converting change the frame rate or size?#

No. An ordinary video is re-encoded at its own size and frame rate. A raw camera stream keeps its pictures exactly; only its playback rate is set.

Is converting to MP4 lossless?#

Re-wrapping a stream that's already H.264 is lossless. Converting from another codec re-encodes, which at a good bitrate isn't visible but isn't bit-for-bit identical.

Is there a free MP4 converter with no daily limit?#

The browser converter has no account, no watermark and no daily cap; each file can be up to an hour and 2 GB.

Sources

  1. Wikipedia, MP4 file format (MPEG-4 Part 14), en.wikipedia.org (opens in a new tab) (accessed 2026-11-26). ↩

  2. MDN Web Docs, Media container formats (file types), developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩

  3. ITU-T, Recommendation H.264: Advanced video coding for generic audiovisual services, www.itu.int (opens in a new tab) (accessed 2026-11-26). ↩ ↩[2]

  4. MDN Web Docs, Web video codec guide, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩

  5. Wikipedia, QuickTime File Format, en.wikipedia.org (opens in a new tab) (accessed 2026-11-26). ↩

  6. Wikipedia, High Efficiency Video Coding, en.wikipedia.org (opens in a new tab) (accessed 2026-11-26). ↩ ↩[2]

  7. Wikipedia, WebM, en.wikipedia.org (opens in a new tab) (accessed 2026-11-26). ↩

  8. Wikipedia, Matroska, en.wikipedia.org (opens in a new tab) (accessed 2026-11-26). ↩

  9. Wikipedia, Audio Video Interleave, en.wikipedia.org (opens in a new tab) (accessed 2026-11-26). ↩

  10. Wikipedia, Network Abstraction Layer, en.wikipedia.org (opens in a new tab) (accessed 2026-11-26). ↩

  11. Wikipedia, Design rule for Camera File system, the camera file layout that includes thumbnail files, en.wikipedia.org (opens in a new tab) (accessed 2026-11-26). ↩

  12. Apple Support, Using HEIF or HEVC media on Apple devices, support.apple.com (opens in a new tab) (accessed 2026-11-26). ↩

Convert a video to MP4, free

Drop a MOV, WebM, MKV or raw .264 file and get an H.264 MP4. In your browser: no upload, no sign-up, no watermark.

Convert to MP4

Keep reading

More in Edit video online

All guides