

The tables below summarize the libraries used in FFmpeg to perform the codec conversions for WebM and MP4 files. The Media conversion page lists commands needed to convert codecs. In this example, the -c:a flag and the -c:v are for specifying the audio and video codecs respectively. media # ffmpeg -i glocken.mov -c:a vorbis -c:v av1 glocken.mkv mkv file with a vorbis audio codec and an av1 video codec. The WebM format for example allows audio to be encoded using either Vorbis or Opus. Two files of the same container type could hold data compressed using different codecs.

As stated in Media file basics, a codec is not the same thing as a container (file type). To verify your results, use FFmpeg and Shaka Packager as already shown in Media Application basics: /media # packager input=glocken.mp4 -dump_stream_info /media # ffmpeg -i glocken.mp4 Codecs # rwx- 1 root root 494497 Mar 7 18:45 glocken.webm Check your work # Video:359kB audio:117kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.356068% To get a tiny file, you would do this instead: /media # ffmpeg -i glocken.mov -b:v 200k glocken.webmįrame = 300 fps = 3.6 q = 0.0 Lsize = 483kB time =00:00:10.01 bitrate = 395.0kbits/s speed = 0.121x You can see this for yourself using the ls -a bash command in the folder where your media files are located. So the video is no longer a mere 4% of the original. It's important to call out that FFmpeg 4.2.2 set the default video bitrate to 200k and in 4.3.2 it does not set a default bitrate. While MP4 compresses to about 83% of the original file's size, WebM is down to 78% of the original's size, but can be much smaller. This isn't surprising when you look at the results. WebM /media # ffmpeg -i glocken.mov glocken.webm MP4 /media # ffmpeg -i glocken.mov glocken.mp4 Review Media file basics for more about containers and streams if you don't know the different between them. webm file extensions with both an audio and video stream inside the file. Containers #įirst, we need to create our two containers from the. If the commands don't work for your version of FFmpeg, consult the FFmpeg documentation.
