How to convert WebM to MP4 with ffmpeg (Windows and Mac)
Learn how to convert WebM videos to MP4 with ffmpeg on Windows and Mac, using the right command to keep quality and social media compatibility.

Recorded a video in your browser and it came out as WebM? That happens on older browsers or some setups, and it can be a problem: not every app and social network handles that format well. In this tutorial you will learn to convert WebM to MP4 with ffmpeg, the free, open-source tool video professionals use.
WebM vs MP4: what is the difference?
| WebM | MP4 (H.264) | |
|---|---|---|
| Designed for | The web, browsers | General use |
| Social media compatibility | Varies | Full |
| Editing in mobile apps and editors | Limited | Full |
| Quality | Great | Great |
Editor de Vídeo Online records MP4 on current browsers. If your video comes out as WebM, the first thing to do is update Chrome or Edge. If that does not help, convert it as shown below.
Step 1: install ffmpeg
Windows
Open Command Prompt or PowerShell and run:
winget install ffmpeg
Close and reopen the terminal so the command is recognized.
Mac
With Homebrew installed, run in Terminal:
brew install ffmpeg
Check the installation
ffmpeg -version
If you see the version, you are ready.
Step 2: convert the video
Go to the video's folder (for example cd Downloads) and run:
ffmpeg -i video.webm -c:v libx264 -pix_fmt yuv420p -r 30 video.mp4
What each part does:
-i video.webm: the input file.-c:v libx264: encodes the video as H.264, the most compatible standard.-pix_fmt yuv420p: a color format every player and platform accepts.-r 30: locks 30 frames per second, avoiding timing glitches.video.mp4: the output file name.
Step 3 (optional): tune quality and size
To control quality, add -crf (lower means better quality and a bigger file; 18 to 23 is a good range):
ffmpeg -i video.webm -c:v libx264 -crf 20 -preset slow -pix_fmt yuv420p -r 30 video.mp4
If the video has audio, convert the audio to AAC too:
ffmpeg -i video.webm -c:v libx264 -pix_fmt yuv420p -r 30 -c:a aac -b:a 160k video.mp4
Converting many files at once
On Mac or Linux:
for f in *.webm; do ffmpeg -i "$f" -c:v libx264 -pix_fmt yuv420p -r 30 "${f%.webm}.mp4"; done
On Windows (PowerShell):
Get-ChildItem *.webm | ForEach-Object { ffmpeg -i $_.Name -c:v libx264 -pix_fmt yuv420p -r 30 ($_.BaseName + ".mp4") }
If you produce lots of hand-drawing videos, consider Editor de Vídeo Online's advanced version, which already renders MP4 in batches: see how to batch-generate videos with Python.
Common problems
- "ffmpeg is not recognized": close and reopen the terminal after installing.
- No sound: the original video may have no audio. Animations recorded in Editor de Vídeo Online are silent; add narration and music afterwards (see how).
- Stuttering video: use
-r 30to lock the frame rate and see performance tips for recording in the browser.
Frequently asked questions
Does converting WebM to MP4 lose quality?
There is a re-encode, but with -crf between 18 and 20 the difference is invisible.
Is there an online converter?
There are, but you have to upload your video to a server. ffmpeg converts on your computer, with no size limit and without exposing the file.
Why did my video come out as WebM?
Older browsers cannot record MP4 natively. Updating Chrome or Edge usually fixes it.
Conclusion
A single ffmpeg command turns any WebM into an MP4 that works everywhere. But update your browser first: in most cases Editor de Vídeo Online already delivers MP4 directly.
Make your animated video now
Editor de Vídeo Online runs in your browser (Chrome or Edge): upload an image, pick a style and record an MP4. Nothing to install.
Try Editor de Vídeo Online →



