Members CMS
PHP 8.1+ & MySQL Buy license · $349.95
Media library

Which video formats play in every browser: MP4, MOV and WebM

A file ending in .mp4 is not always playable. How containers and codecs differ, which combinations browsers support, and what to check before you publish.

Updated 4 minute read The Members CMS team

You upload a video, it plays perfectly on your laptop, and then a member writes in to say it shows a black box or an error on theirs. The file ends in .mp4, so what went wrong?

The answer is that a file extension tells you very little about whether a video will play. This guide explains the difference between containers and codecs, which combinations are safe for the web, and what to check before you publish.

Containers and codecs: the key idea

Every video file has two layers:

  • The container is the wrapper. It is what the extension usually refers to: MP4, MOV or WebM. It holds the video track, the audio track and some information about them.
  • The codecs are how the picture and sound inside are actually compressed. Common video codecs include H.264, HEVC (also called H.265), VP9 and AV1. Common audio codecs include AAC and Opus.

A browser has to understand both layers. It may happily open an MP4 container and then find a video codec it cannot decode. That is why two files both ending in .mp4 can behave completely differently.

Which combinations play where

Browser support changes over time and can depend on the device's hardware, so treat this as a general guide rather than a promise.

ContainerTypical codecsBrowser support
MP4H.264 video + AAC audioPlays in practically every modern browser and device. The safest choice.
MP4 or MOVHEVC (H.265)Patchy. Fine on many Apple devices, not reliable elsewhere.
WebMVP9 + OpusWidely supported in current browsers; older devices may struggle.
MP4 or WebMAV1Growing support, often depending on newer hardware.
MOVEditing codecs from cameras or editing softwareGenerally not playable in browsers at all.

If you want one format that just works, MP4 with H.264 video and AAC audio is still the answer.

Newer codecs such as VP9, HEVC and AV1 can give smaller files at the same quality, which is attractive for a large library. The catch is that a member on an older phone or laptop may not be able to play them. If you do use them, keep an H.264 version available as a fallback rather than relying on the newer codec alone.

A note on MOV files

MOV is a container that comes from Apple's ecosystem. Safari usually plays MOV files that contain web-friendly codecs, while other browsers often do not. Many phones record in a high-efficiency mode using HEVC, and camera or editing exports can use codecs intended for editing rather than playback. Converting MOV to MP4 with H.264 is the safe route for the web.

Other things that affect playback

Codec is the big one, but a few other details can trip you up:

  • Fast start. In an MP4, the index that describes the file can sit at the start or the end. If it is at the end, the browser may need to download the whole file before playing. Moving it to the start (often called "faststart") lets playback begin quickly.
  • Resolution and bitrate. A very high bitrate 4K file may play but stutter on slower connections or older devices. Offering a sensible web version helps.
  • Rotation metadata. Phone videos can carry a rotation tag, just like photos. Software that ignores it may show the video sideways. Our guide to portrait, landscape and square galleries explains why.
  • Audio codec. A video with an unusual audio track may play silently or not at all.

How to check a video before publishing

You do not need to guess. Tools such as FFprobe read a file and tell you exactly what is inside. A quick check looks like this:

  1. Run ffprobe yourfile.mp4 and look at the "Stream" lines.
  2. Check the video codec: h264 is the safest.
  3. Check the audio codec: aac is the safest in MP4.
  4. Note the resolution and duration, which are useful for your records anyway.
  5. Test the file in at least two different browsers, including one on a phone.

Converting a problem file

If a file uses a codec that will not play widely, FFmpeg can convert it. A common starting point is:

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

This creates an H.264 and AAC MP4 with fast start enabled. Lower -crf numbers mean higher quality and bigger files. Always keep the original as well, in case you want to re-encode it differently later.

Building a routine for your library

If you add video regularly, a simple routine saves member complaints:

  • Export from your editing software as MP4, H.264 and AAC by default.
  • Check any file that arrives as MOV or from an unfamiliar source.
  • Keep codec, resolution and duration recorded against every video, so problems are easy to spot later.
  • Group clips into sets with their photos - see uploading image and video sets in folders.

How Members CMS handles this

Members CMS accepts MP4, MOV, WebM, M4V, MKV, AVI, WMV, MPG/MPEG, OGV and 3GP videos and checks the real file type rather than trusting the extension. With FFmpeg and FFprobe installed on the server, it records each video's duration and codec and creates a poster image in the background.

Formats or codecs that browsers cannot play reliably, such as MKV, AVI, WMV or HEVC (H.265), get an MP4 copy for previews at 480p, 720p or 1080p. The original is always kept as uploaded, so you can still download or re-encode it later. Members can then watch in your members area, delivered through the connector - see serving member media from another server.

Frequently asked questions

Will every MP4 file play in a browser?

No. MP4 is only the container. Video encoded with H.264 and AAC audio plays almost everywhere, but an MP4 using a less common codec may not play in some browsers.

Do MOV files play on websites?

Sometimes. Safari usually plays them, other browsers often do not, depending on the codec inside. Converting to MP4 with H.264 is the safe choice for the web.

How can I tell which codec a video uses?

A tool such as FFprobe reads the codec, resolution and duration from the file. With FFmpeg and FFprobe installed, Members CMS records each video's duration and codec.

Get three guides like this every month, plus software update notices.Subscribe →