Skip to content
recorder.tools

WebM vs MP4: Which Format Should You Record Video In?

WebM vs MP4 for screen and webcam recordings: compatibility, quality, file size and editing, plus how to convert or fix browser recordings with ffmpeg.

By . Updated . 3 min read.

Two film strips labelled WebM and MP4 side by side, with codec names inside each

When you record in a browser, you often get a choice between WebM and MP4. Both produce good video. The difference that matters in practice is where the file will be played or edited afterwards.

The short answer

  • Choose MP4 if you will send the file to other people, upload it to social media, open it in QuickTime or iMovie, or edit it in software you are not sure about. MP4 plays almost everywhere.
  • Choose WebM if the video stays on the web, goes to YouTube, or you edit it in a tool that supports WebM. It is an open, royalty-free format and browsers have recorded it for years.

If you are unsure, pick MP4. The screen recorder and webcam recorder default to MP4 whenever your browser can record it.

Containers and codecs

WebM and MP4 are containers: boxes that hold a video stream, an audio stream and some information about them. What actually determines quality and compatibility is the codec used for each stream inside.

WebMMP4
Typical video codecsVP8, VP9, AV1H.264, H.265 (HEVC), AV1
Typical audio codecsOpus, VorbisAAC
LicensingRoyalty-freeCodecs may be patent-licensed
Plays in all modern browsersYesYes
Plays in QuickTime Player and iMovieNoYes
Accepted by YouTubeYesYes
Accepted by most social appsVariesYes

Browser recordings are usually VP8 or VP9 with Opus for WebM, and H.264 with AAC for MP4.

Which browsers record which format

  • Chrome and Edge record WebM, and recent versions can also record MP4.
  • Firefox records WebM.
  • Safari records MP4.

A recorder can only offer the formats your browser supports, so the format choice may not appear in every browser.

Quality and file size

At the same bitrate, VP9 and H.264 look similar for screen recordings; VP9 is often somewhat more efficient, and AV1 more efficient still. In practice, browsers pick their own bitrates, and screen content compresses very well in all of them. Do not expect a meaningful quality difference from the container choice alone.

What does change file size is the content: a static slide deck produces a small file, while full-screen video playback or fast scrolling produces a large one.

Editing

Most modern editors open both formats, but not all of them, and some open WebM slowly. If your editor refuses a WebM file, convert it to MP4 first (see below). Apple software is the most common case: QuickTime Player and iMovie do not open WebM.

The duration problem in browser WebM files

Browsers write WebM files as a live stream, without knowing in advance how long the recording will be. The resulting files often have no duration stored and no seek index. Symptoms:

  • The player shows no total length, or the length appears only after playback reaches the end.
  • Seeking is slow or jumps to the wrong place.
  • Some editors import the file with a wrong duration.

The fix is a quick remux, which rewrites the container without re-encoding the video, so there is no quality loss and it takes seconds:

ffmpeg -i recording.webm -c copy fixed.webm

Converting WebM to MP4

To turn a WebM recording into a widely compatible MP4, re-encode it to H.264 and AAC with ffmpeg:

ffmpeg -i recording.webm -c:v libx264 -crf 20 -preset medium \
  -c:a aac -b:a 160k -movflags +faststart recording.mp4
  • -crf 20 controls quality: lower is better and larger. 18 to 23 is a sensible range.
  • -movflags +faststart moves the index to the start of the file so it begins playing before it is fully downloaded.

Re-encoding is lossy, so it is better to record in MP4 from the start when you know you will need it.

Summary

You want toRecord in
Send to anyone, any deviceMP4
Edit in iMovie or QuickTimeMP4
Upload to YouTubeEither
Embed on a websiteEither
Use only open formatsWebM

Both are fine for quality. Choose by destination, and keep ffmpeg handy for the occasional conversion.

Written by

Full-stack developer and creator of recorder.tools. Builds the recorders on this site and writes these guides after testing each one across browsers and operating systems.

Related guides