All posts
AVI to WebM via CLI
AVI to VP9 + Opus using the same profile as MP4 → WebM.
Open online converterPackages to install
ffmpeg is enough. The codecs are the same: libvpx-vp9 and libopus.
ffmpeg
sudo apt-get update
sudo apt-get install -y ffmpegHow to run the command
ffmpeg -i input.avi -c:v libvpx-vp9 -crf 32 -b:v 0 -deadline good -cpu-used 4 -c:a libopus -b:a 96k output.webm.
ffmpeg -y -i input.avi -c:v libvpx-vp9 -crf 32 -b:v 0 -deadline good -cpu-used 4 -c:a libopus -b:a 96k output.webmDockerfile example
Build a minimal Ubuntu image with the required packages and run the conversion inside the container.
FROM ubuntu:24.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg && \
rm -rf /var/lib/apt/lists/*
WORKDIR /work
docker build -t avi-to-webm .
docker run --rm -v "$PWD:/work" -w /work avi-to-webm \
ffmpeg -y -i input.avi -c:v libvpx-vp9 -crf 32 -b:v 0 -deadline good -cpu-used 4 -c:a libopus -b:a 96k output.webmExample commands
Run these locally after installing the packages, or inside the container from the Dockerfile.
ffmpeg -y -i input.avi -c:v libvpx-vp9 -crf 32 -b:v 0 -deadline good -cpu-used 4 -c:a libopus -b:a 96k output.webmffmpeg -y -i input.avi -c:v libvpx-vp9 -crf 36 -b:v 0 -c:a libopus -b:a 64k output.webm