AVI to MKV Converter

Learn how to convert AVI video files to MKV format using FFmpeg commands, with a format comparison table and interactive command builder.

FFmpeg Command Builder

Fill in the fields and get a ready-to-run FFmpeg command.

Generated Command

ffmpeg -i video.avi -c copy video.mkv

Remuxes the AVI container into MKV without re-encoding. All streams are copied as-is — lossless and very fast.

AVI vs MKV — Format Comparison

Feature AVI MKV
Released 1992 (Microsoft) 2002 (Open source)
Audio tracks 1 (limited) Unlimited
Subtitle tracks Very limited Unlimited
Chapter support No Yes
Codec support Limited (DivX, Xvid) All codecs (H.264, H.265, AV1...)
File size overhead Small Negligible
Open standard No (Microsoft) Yes (Matroska)
HDR / metadata No Yes

Quick FFmpeg Reference

Remux (lossless, fastest)
ffmpeg -i input.avi -c copy output.mkv
Re-encode to H.264 + AAC
ffmpeg -i input.avi -c:v libx264 -crf 23 -c:a aac output.mkv
Re-encode to H.265 + AAC
ffmpeg -i input.avi -c:v libx265 -crf 28 -c:a aac output.mkv
Add external subtitle file
ffmpeg -i input.avi -i subs.srt -c copy -c:s srt output.mkv
Batch convert (Linux/macOS)
for f in *.avi; do ffmpeg -i "$f" -c copy "${f%.avi}.mkv"; done
Copied!

Summary

Learn how to convert AVI video files to MKV format using FFmpeg commands, with a format comparison table and interactive command builder.

How it works

  1. AVI files store video and audio streams inside a Microsoft RIFF container with limited codec and metadata support.
  2. MKV is a flexible container that wraps the same streams without altering the codec data — called a remux.
  3. FFmpeg reads the AVI container, extracts the raw streams, and places them into an MKV wrapper with no quality loss.
  4. Use the command builder below to generate an FFmpeg command tailored to your conversion goal.
  5. Run the command in your terminal; conversion typically completes in seconds for a remux.

Use cases

  • Remux AVI files to MKV to add subtitle tracks or multiple audio streams.
  • Improve compatibility with modern media players that handle MKV better than AVI.
  • Preserve original video quality by avoiding re-encoding during container switch.
  • Add chapter markers or metadata not supported in the AVI format.
  • Reduce file size by re-encoding with H.265/HEVC inside an MKV container.
  • Archive video collections in a future-proof open-standard format.
  • Enable hardware-accelerated playback on devices that support MKV but not AVI.
  • Batch-convert an entire AVI library to MKV with a single FFmpeg command.

Frequently Asked Questions

Last updated: 2026-06-11 · Reviewed by Nham Vu