Easy way to make a webm for Firefox playback with ffmpeg.

This is how to create a nice webm using ffmpeg on Linux. Firstly, capture the section of video you wish to be encoded as a webm. This command will strip out a section of video from 00:09:23 to 00:09:33 and save it in the same format as the existing file.

[email protected]:~/Videos$ ffmpeg -i total.mkv -vcodec copy -acodec copy -ss 00:09:23 -to 00:09:33 out.mkv

Then we may encode it as a webm file.

This command encodes our webm with the best quality depending on the original source video of course.

[email protected]:~/Videos$ ffmpeg -i out.mkv -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output.webm

Now we have a quality webm file with no fuss. This file is only 1.3 megabytes too, not bad. This is better than opening the video in vlc and clicking record to capture a section of video.

No comments have been made. Use this form to start the conversation :)

Leave a Reply