Convert AVI to M4V — Free Online Tool
Convert AVI files to M4V format using H.264 video and AAC audio — the codec combination required for iTunes compatibility and native playback on iPhone, iPad, and Apple TV. Your files are processed entirely in your browser using FFmpeg.wasm; nothing is uploaded to any server.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your AVI file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
AVI is a legacy Microsoft container that commonly wraps video in codecs like DivX, Xvid, or MJPEG with MP3 audio. Because M4V is an Apple MPEG-4 container that strictly requires H.264 or H.265 video and AAC audio, this conversion always involves full re-encoding — both the video stream (transcoded to H.264 via libx264) and the audio stream (transcoded from MP3 to AAC). The output file also receives the -movflags +faststart optimization, which relocates the MP4 metadata atom to the beginning of the file so the video can begin playing before the entire file has loaded. The result is a file that iTunes, QuickTime, iOS, and Apple TV can natively recognize and play without any additional software.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg program. In this browser tool, FFmpeg.wasm runs the same command entirely in your browser via WebAssembly — no server involved. You can also run this exact command in a desktop terminal if you have FFmpeg installed. |
-i input.avi
|
Specifies the input file — your source AVI video. FFmpeg will detect the container and probe the internal video and audio codec streams (e.g., Xvid video, MP3 audio) before beginning the conversion. |
-c:v libx264
|
Re-encodes the video stream using the libx264 H.264 encoder. This is required because AVI video codecs like DivX, Xvid, and MJPEG are not valid inside an M4V/MPEG-4 container; H.264 is the standard Apple-compatible video codec for M4V. |
-c:a aac
|
Transcodes the audio stream to AAC using FFmpeg's built-in AAC encoder. AVI commonly carries MP3 audio, which is not the preferred audio format for Apple's M4V container — AAC is the required codec for iTunes library compatibility and iOS hardware audio decoding. |
-crf 23
|
Sets the Constant Rate Factor for the H.264 video encoder to 23, the default balance between quality and file size. Lower values (e.g., 18) produce higher quality and larger files; higher values (e.g., 28) produce smaller files with more visible compression artifacts. |
-b:a 128k
|
Sets the AAC audio bitrate to 128 kilobits per second. This is widely considered the minimum bitrate for transparent AAC audio quality and matches iTunes' standard bitrate for music downloads. Increase to 192k or 256k if your source AVI contains high-fidelity audio. |
-movflags +faststart
|
Moves the M4V file's metadata header (the moov atom) to the beginning of the file after encoding completes. This is an M4V/MP4-specific optimization that enables progressive playback — the video can start playing before the full file is downloaded, which is important for web streaming and QuickTime-based players. |
output.m4v
|
Specifies the output filename with the .m4v extension, which signals to iTunes, QuickTime, and Apple devices that this is an Apple MPEG-4 video file with potential support for chapters, multiple audio tracks, and DRM. The .m4v extension is functionally interchangeable with .mp4 on most non-Apple platforms. |
Common Use Cases
- Importing old AVI home videos or camcorder recordings into iTunes or the Apple TV app to watch on your television via Apple TV
- Preparing AVI video files for transfer to an iPhone or iPad using the Finder (macOS) or iTunes (Windows) sync workflow, which only accepts M4V/MP4/MOV
- Converting AVI episodes of a TV show or personal video collection into M4V so they appear with proper chapter and metadata support in your Apple library
- Making legacy DivX or Xvid AVI files — common formats from the early 2000s — playable on modern Apple devices without installing third-party codec packs
- Producing M4V files with the +faststart flag for embedding Apple-compatible video in web pages or email clients that use QuickTime-based playback
- Archiving AVI footage from older security cameras or screen recorders into a more modern, widely supported container while maintaining H.264 quality control via CRF
Frequently Asked Questions
Yes, some generation loss is expected because this conversion requires re-encoding both video and audio. The AVI video — often stored as DivX, Xvid, or MJPEG — must be decoded and re-encoded to H.264, and the audio must be transcoded from MP3 to AAC. The default CRF 23 setting produces visually good results for most content, but if your source AVI already used heavy lossy compression, re-encoding compounds that loss. Using a lower CRF value (e.g., 18) can minimize the quality difference at the cost of a larger file.
M4V is technically an Apple-branded variant of the MPEG-4 container (.mp4), and the two formats are nearly identical at the byte level. Apple devices and iTunes give preference to the .m4v extension for video files in their media libraries, and it signals support for Apple-specific features like DRM, chapters, and multiple audio tracks. Most non-Apple players (VLC, browsers, Android) will also open .m4v files without issue. If you need the broadest possible compatibility outside the Apple ecosystem, simply renaming the file to .mp4 typically works.
Both AVI and M4V support multiple audio tracks, and FFmpeg will attempt to map all audio streams from the source file. However, if your AVI contains audio codecs other than those supported by M4V (such as AC-3 or PCM), each track will be individually transcoded to AAC. You should verify the output contains the expected tracks using a tool like MediaInfo, especially for AVI files with non-standard audio configurations.
M4V supports both chapters and subtitles, which AVI does not. However, this specific conversion command does not add chapters or subtitles — it converts only the video and audio streams present in the source AVI. If you want to add chapters or embed subtitle tracks into the output M4V, you would need to extend the FFmpeg command with additional input files and stream mapping flags, which is beyond the scope of this tool's default behavior.
The -movflags +faststart flag moves the MP4/M4V metadata (the 'moov' atom) from the end of the file to the beginning. By default, FFmpeg writes this metadata at the end of the file after encoding is complete, which means the entire file must be downloaded before playback can start. With +faststart, a player or browser can begin playing the video immediately after receiving only the header, making it essential for streaming or web-embedded video. For files used only locally in iTunes or Finder, the impact is minimal, but it is a best practice for M4V files.
Video quality is controlled by the -crf flag, which accepts values from 0 (lossless/largest) to 51 (worst quality/smallest). The default is 23, which is a balanced midpoint. To produce a higher-quality output closer to your source AVI, lower the CRF to 18 or 20; to shrink the file size at some quality cost, raise it to 28 or higher. For audio, replace 128k in -b:a 128k with a higher value like 192k or 256k for better audio fidelity, or 96k to reduce file size. For example: ffmpeg -i input.avi -c:v libx264 -c:a aac -crf 18 -b:a 192k -movflags +faststart output.m4v
Technical Notes
AVI's interleaved audio/video structure and its reliance on VfW (Video for Windows) codecs like DivX, Xvid, and MJPEG make it fundamentally incompatible with Apple's M4V container without full re-encoding. The libx264 encoder used here produces H.264 Baseline/Main/High profile video that is natively decodable by Apple's hardware video decoder on every iOS and macOS device since 2010. AAC audio at 128k provides near-transparent quality for typical speech and music content and is the only audio codec that iTunes strictly requires for DRM-wrapped M4V files (though DRM is not applied by this tool). One known limitation: AVI files occasionally contain VBR MP3 audio with malformed headers that can cause audio sync drift after transcoding — if you notice sync issues in the output, inspect the source AVI with MediaInfo and consider adding the -async 1 flag to the FFmpeg command. The M4V container supports metadata fields (title, artist, year, cover art) that AVI does not, but those fields will not be populated automatically by this conversion and would need to be written separately using a tool like AtomicParsley or the iTunes app itself.