How to convert mp4 video to WebM video?

I have a video in mp4 format and I want to convert it into WebM format, I have tried converting it with FFmpeg but it takes a very long time to convert, is there any solution for this?

Since WebM container/format doesn’t support video stream encoded with H.264 codec (which I assume your original mp4 video file has), you need to transcode the video to either VP8 or VP9 codec which is supported by the WebM format. Also, the audio stream in your video file should be transcoded with either Vorbis or Opus audio codecs which are supported by the WebM format.

For simplicity, let’s assume you want to transcode your video using VP9 video codec and Opus audio codec, and for the time constraint we will be using the Constant Quality rate control method to transcode your video in the appropriate time, there might be increased in file size but there’s always speed vs. quality trade-off in video transcoding.

Consider following FFmpeg command,

ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -c:a libopus -b:a 128k output.webm

Once the quality/size tradeoff is acceptable, adjust the CRF value. Lower numbers result in larger, higher-quality files.

And here is the list of reasons why people face issues while transferring mp4 to ts.

1 Like

Why do I feel that there is a drop in audio quality when I do this?

Hey James!

You should raise -b:a 128k. The audio bitrate is as follows.

Please visit if you are looking for other conversions such as from .mov to mp4 in FFmpeg.

Thanks

Or you can use the crf flag which guarantees a variable bitrate for constant quality. Although it can be changed, the default range is from 4 to 63.

For more information: Encode/VP9 – FFmpeg

In case you need more detail on these two formats checkout the: MP4 vs WebM