Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a WebM video file?

Tags:

ffmpeg

webm

After looking around the web, I found no way to generate a WebM video. I see drivers for Windows and QuickTime, but no evidence that the most common utility FFmpeg is being supported.

Is there any open source converter that produces WebM?

like image 401
Marneau Avatar asked Aug 05 '11 10:08

Marneau


People also ask

What creates WebM?

WebM files consist of video streams compressed with the VP8 or VP9 video codecs and audio streams compressed with the Vorbis or Opus audio codecs. The WebM file structure is based on the Matroska container.


2 Answers

You can use ffmpeg to convert to WebM. Make sure to compile it with the --enable-libvpx and --enable-libvorbis flags (see FFmpeg compile guides), or visit the FFmpeg Download page for links to builds that include support. After that, you can use the following command (I'm using input.flv as my example input file):

ffmpeg -i input.flv -vcodec libvpx -acodec libvorbis output.webm 

For additional information, see the FFmpeg vpx (WebM) Encoding Guide.

like image 110
matzahboy Avatar answered Oct 18 '22 01:10

matzahboy


ffmpeg -i input.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output.webm 

By default the CRF value can be from 4–63, and 10 is a good starting point. Lower values mean better quality.

like image 35
Ivan Karatayev Avatar answered Oct 18 '22 02:10

Ivan Karatayev