Convert AVI to MTS — Free Online Tool

Convert AVI files to MTS (AVCHD) format using H.264 video and AAC audio — the same codec pairing used natively by Sony and Panasonic camcorders. This tool re-encodes your legacy AVI content into an MPEG-2 Transport Stream container, making it compatible with AVCHD-aware editors and broadcast pipelines.

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 uses a simple RIFF-based container that interleaves audio and video chunks, often containing older codec streams like DivX, Xvid, or MJPEG alongside MP3 audio. During this conversion, FFmpeg fully decodes the AVI's video and audio streams and re-encodes them from scratch: the video is encoded to H.264 (libx264) and the audio to AAC, then both are wrapped in an MPEG-2 Transport Stream (.mts) container. This is a full transcode — not a remux — because the MTS/AVCHD container requires H.264 video and AAC or AC-3 audio, which AVI files rarely already contain in a compatible form. The CRF 23 setting balances quality and file size, while the Transport Stream structure adds packetization overhead that AVCHD-compliant devices and editors expect.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg program, the open-source multimedia processing engine that handles all decoding, encoding, and container remuxing. On this page, FFmpeg runs entirely in your browser via WebAssembly (FFmpeg.wasm) — no server is involved.
-i input.avi Specifies the input file — your source AVI (Audio Video Interleave) file. FFmpeg will probe this file to detect its container structure, video codec (e.g., Xvid, DivX, MJPEG), audio codec (e.g., MP3, PCM), and stream layout before beginning the transcode.
-c:v libx264 Sets the video encoder to libx264, which encodes the output video as H.264. This is required because the MTS/AVCHD container expects H.264 video — the source AVI's video codec (whatever it may be) is fully decoded and re-encoded to H.264 by this flag.
-c:a aac Sets the audio encoder to AAC, which is the default and most compatible audio codec for MTS/AVCHD output. The AVI's audio (typically MP3 or PCM) is decoded and re-encoded to AAC, matching what Sony and Panasonic camcorders natively record.
-crf 23 Sets the Constant Rate Factor for H.264 encoding to 23, which is the libx264 default and represents a balanced quality-to-file-size tradeoff. Lower values (e.g., 18) produce higher-quality, larger MTS files; higher values (e.g., 28) produce smaller files with more compression artifacts.
-b:a 128k Sets the AAC audio bitrate to 128 kilobits per second. At this bitrate, AAC delivers audio quality comparable to 160-192k MP3, which is generally transparent for most content. Increase to 192k or 256k if the AVI source contains high-fidelity audio like music or studio recordings.
output.mts Specifies the output filename with the .mts extension, which tells FFmpeg to wrap the encoded H.264 video and AAC audio into an MPEG-2 Transport Stream container — the format used by AVCHD camcorders and compatible with AVCHD-aware editors and players.

Common Use Cases

  • Importing old AVI home videos into Sony Vegas or Premiere Pro using the native AVCHD/MTS project format to maintain a consistent timeline workflow
  • Archiving DV or DivX-encoded AVI footage into AVCHD MTS format to match the file structure of existing Sony Handycam or Panasonic HC-series camcorder libraries
  • Preparing AVI source footage for broadcast or cable delivery workflows that require MPEG-2 Transport Stream encapsulation with H.264 video
  • Consolidating mixed-format video libraries from legacy Windows systems into MTS so they can be played back on Blu-ray players and Sony Bravia TVs that support AVCHD
  • Converting AVI screen recordings or tutorial videos into MTS format for ingestion into professional broadcast editing systems that prefer transport stream inputs
  • Re-encoding large AVI files captured from older capture cards into the AVCHD MTS format for use with camcorder footage in multi-source video projects

Frequently Asked Questions

Yes, there will be some generation loss because this is a full re-encode — the AVI's video is decoded and re-compressed using H.264 at CRF 23, and the audio is decoded and re-compressed to AAC at 128k. If your source AVI was already lossy (e.g., DivX or Xvid encoded), you are compressing already-compressed data, which can introduce visible artifacts. Lowering the CRF value (e.g., to 18) will significantly improve output quality at the cost of larger file size. For archival purposes, use the lowest CRF you can tolerate.
MTS files recorded by camcorders like Sony Handycams use specific bitrates, interlacing settings, and metadata flags mandated by the AVCHD specification. FFmpeg produces a valid MPEG-2 Transport Stream with H.264 and AAC, but it does not replicate every AVCHD compliance detail — for example, it won't add camcorder-specific SEI NAL units or enforce AVCHD's exact bitrate caps. The file will be compatible with most software that reads MTS, but may not pass strict AVCHD validation used by some hardware players.
The audio is fully decoded from whatever codec the AVI used — typically MP3 (libmp3lame) or PCM — and then re-encoded to AAC at 128k for the MTS output. AAC is generally more efficient than MP3 at the same bitrate, so 128k AAC often sounds better than 128k MP3, but any re-encoding introduces minor quality loss. If your AVI contains multiple audio tracks, FFmpeg will by default carry all of them into the MTS output, since both containers support multiple audio tracks.
Standard AVI does not support embedded subtitle tracks, so there are no subtitles to transfer in most cases. However, MTS (as an MPEG-2 Transport Stream) does support subtitles, so if you have an external subtitle file you want to add during conversion, you can modify the FFmpeg command to include a subtitle input and map it into the output. The base conversion command shown on this page does not include subtitle handling.
Change the -crf value in the command to control H.264 encode quality. The scale runs from 0 (mathematically lossless) to 51 (extremely compressed), with 23 as the default. For high-quality output from valuable AVI source material, try -crf 18. For smaller files where quality is less critical, try -crf 28. You can also add -b:a 192k or -b:a 256k to improve AAC audio quality beyond the default 128k, which is useful if the AVI source had high-fidelity audio.
Yes, on Linux or macOS you can use a shell loop: for f in *.avi; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.avi}.mts"; done. On Windows Command Prompt, use: for %f in (*.avi) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.mts". This browser-based tool processes one file at a time, so use the desktop FFmpeg command for bulk batch jobs, especially since files over 1GB are better handled locally anyway.

Technical Notes

AVI's RIFF container structure does not support the packetized stream model that MPEG-2 Transport Streams require, so there is no shortcut remux path here — every conversion from AVI to MTS requires a full decode-encode cycle. The output MTS file uses an MPEG-2 Transport Stream container, which adds fixed-size 188-byte transport packets and PAT/PMT tables that AVCHD readers and broadcast systems expect. One practical limitation is that AVI files sometimes contain VBR (variable bitrate) audio that is improperly interleaved, which can cause sync drift in the output; if you notice audio/video sync issues, adding -async 1 to the FFmpeg command can help. AVI does not support chapters or subtitle tracks at the container level, so neither will carry over — though the MTS format itself is subtitle-capable. Metadata embedded in AVI (such as title or creation date stored in INFO chunks) is not preserved in the MTS output, as the two containers use entirely different metadata schemes. File size after conversion will vary widely depending on the source AVI's codec: an Xvid-encoded AVI re-encoded at CRF 23 may produce a similarly sized or slightly larger MTS, while a raw or MJPEG AVI will typically produce a significantly smaller output.

Related Tools