Convert AVI to WebM — Free Online Tool

Convert AVI files to WebM using VP9 video encoding and Opus audio — the modern open-source codecs built for efficient web streaming and native HTML5 playback. This tool runs entirely in your browser via FFmpeg.wasm, so your video never leaves your device.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

AVI is a legacy Microsoft container that typically wraps older codecs like DivX, Xvid, or MJPEG alongside MP3 or PCM audio. Converting to WebM requires a full re-encode of both streams: the video is transcoded using the libvpx-vp9 encoder (VP9), which produces significantly smaller files than older AVI-era codecs at comparable quality, while the audio is transcoded from whatever codec the AVI contains (commonly MP3 or PCM) into Opus via libopus, a modern low-latency codec optimized for web delivery. The output is wrapped in the WebM container — a subset of Matroska — which supports subtitles, chapters, and transparency that AVI cannot handle. Because AVI stores audio and video in interleaved chunks rather than a modern track-based structure, the conversion also normalizes the container structure for streaming-friendly access patterns.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg program, the open-source multimedia processing engine that handles all decoding, re-encoding, and container muxing for this AVI-to-WebM conversion.
-i input.avi Specifies the input AVI file. FFmpeg will detect and decode whatever video and audio codecs are stored inside the AVI container — commonly Xvid, DivX, MJPEG, or H.264 video paired with MP3 or PCM audio.
-c:v libvpx-vp9 Selects the VP9 video encoder for the output WebM file. VP9 is Google's open and royalty-free codec that delivers significantly better compression than the older codecs typically found in AVI files, and it is natively supported by all major web browsers.
-c:a libopus Transcodes the audio stream — whatever it was in the original AVI (often MP3 or uncompressed PCM) — into Opus audio using the libopus encoder. Opus is the preferred audio codec for WebM, offering superior quality-per-bit compared to MP3, especially at lower bitrates.
-crf 33 Sets the Constant Rate Factor for the VP9 encoder to 33, which targets a visually good balance of quality and file size suitable for most web video. Lower values like 24 or 20 increase quality and file size, while higher values like 40 reduce file size with more visible compression artifacts. The valid range for VP9 is 0 to 63.
-b:a 128k Sets the Opus audio output bitrate to 128 kilobits per second. Opus at 128k delivers audio transparency (perceptually lossless quality) for most content, and is substantially more efficient than the MP3 audio commonly found in AVI source files at the same bitrate.
-b:v 0 Sets the target video bitrate to zero, which is required to enable true constant-quality CRF mode in the libvpx-vp9 encoder. Without this flag, VP9 ignores the -crf value and defaults to constrained bitrate mode, producing inconsistent quality across different scenes in the AVI source.
output.webm Defines the output filename and tells FFmpeg to use the WebM container format. FFmpeg infers the container from the .webm extension, which wraps the VP9 video and Opus audio streams into the open, web-optimized WebM format ready for HTML5 playback.

Common Use Cases

  • Embedding a legacy AVI home video or archive footage directly into a website using an HTML5 <video> tag, since browsers cannot natively play AVI files
  • Uploading older AVI-format screen recordings or tutorials to a web platform that requires WebM or VP9 for adaptive streaming
  • Reducing the file size of large AVI files encoded with uncompressed or lightly-compressed codecs like MJPEG or Huffyuv, where VP9's efficiency can yield dramatic size reductions
  • Migrating a local media archive of AVI files to a format compatible with modern open-source media players and web-based video editors that support WebM but not AVI
  • Preparing AVI footage for use in a WebRTC or browser-based video application that expects WebM/VP9 input
  • Converting AVI files recorded by older camcorders or capture cards into a royalty-free format for distribution without codec licensing concerns

Frequently Asked Questions

Because the video in an AVI file almost never uses VP9, this conversion always involves a full re-encode — it is never a lossless remux. The default CRF value of 33 used by this tool targets a good balance of file size and visual quality for most web content. If your source AVI was already heavily compressed (e.g., with Xvid at low bitrate), re-encoding introduces a second generation of quality loss, so using a lower CRF like 24 or 20 is advisable for archival material. If the AVI contains high-quality or lossless video (MJPEG, Huffyuv, or uncompressed), the VP9 encode will deliver excellent results at the default settings.
The file size difference depends almost entirely on what codec the original AVI used. AVI files using uncompressed PCM audio or lightly-compressed MJPEG video can be dramatically larger than the VP9/Opus WebM output, sometimes by a factor of 10x or more. Conversely, if the AVI was already heavily compressed with a codec like Xvid at a low bitrate, the WebM may be a similar size or even slightly larger because VP9 needs sufficient bitrate headroom to represent the video accurately. Opus audio encoding is generally much more efficient than the MP3 or PCM audio common in AVI files, which also contributes to size reduction.
WebM actually supports more modern features than AVI. AVI has no native support for subtitles, chapters, or HDR metadata, whereas WebM (being based on Matroska) supports all of these. However, AVI does support multiple audio tracks, and so does WebM, so multi-track audio is preserved. One thing to note is that embedded metadata fields from AVI (such as artist, title, or creation date stored in the INFO chunk) may not transfer cleanly into WebM metadata tags during conversion, so you may need to re-add metadata after conversion if it is important.
Yes. WebM files with VP9 video and Opus audio are supported by VLC, mpv, and most modern media players on Windows, macOS, and Linux. On Windows, the built-in Media Player may require installing the VP9 Video Extensions from the Microsoft Store for full playback support. The main strength of WebM, however, is universal support in all modern browsers — Chrome, Firefox, Edge, and Opera — without any plugins.
The video quality is controlled by the -crf flag, where lower values produce higher quality at larger file sizes and higher values produce smaller files with more compression. For VP9, the range is 0 (lossless) to 63 (lowest quality), and the default in this command is 33. To get higher quality output, try -crf 24 or -crf 20. The -b:v 0 flag must remain in the command alongside -crf — this tells VP9 to operate in constant-quality mode rather than targeting a specific bitrate, which is essential for CRF to work correctly with the libvpx-vp9 encoder.
Yes, on the command line you can wrap the command in a loop. On Linux or macOS, use: for f in *.avi; do ffmpeg -i "$f" -c:v libvpx-vp9 -c:a libopus -crf 33 -b:a 128k -b:v 0 "${f%.avi}.webm"; done. On Windows Command Prompt, use: for %f in (*.avi) do ffmpeg -i "%f" -c:v libvpx-vp9 -c:a libopus -crf 33 -b:a 128k -b:v 0 "%~nf.webm". This browser-based tool processes files one at a time, so the command-line approach is recommended for batch jobs or files over 1GB.

Technical Notes

AVI files carry a wide variety of video codecs in practice — DivX, Xvid, MJPEG, H.264 (rare), and even raw uncompressed video — so the encoding workload varies significantly depending on the source. The libvpx-vp9 encoder is computationally intensive compared to H.264, meaning WebM conversion from AVI is typically slower than converting to MP4. The -b:v 0 flag is not optional with VP9 CRF mode: without it, the encoder reverts to constrained-quality mode and ignores the CRF value. Opus audio encoded at 128k with libopus provides quality comparable to MP3 at 192k, making the default audio settings very efficient. AVI's lack of a standardized timestamp model can occasionally cause audio sync issues in source files; if the output WebM has audio drift, adding -vsync cfr to the command can help regularize frame timing. Transparency (alpha channel video) is supported in WebM via VP9 but is not present in AVI source material, so this feature is irrelevant for AVI-to-WebM conversion. Subtitle and chapter data cannot be carried over from AVI since AVI does not support these features natively.

Related Tools