Trim AVI — Free Online Tool
Trim an AVI file to a specific start and end time, producing a new AVI file with the same libx264 video and MP3 audio streams copied without re-encoding. This is the fastest way to cut an AVI clip precisely while preserving the original codec settings and avoiding any quality loss from transcoding.
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
When trimming an AVI file to another AVI, FFmpeg uses stream copying (-c copy) to extract the portion of the file between the specified timestamps without decoding or re-encoding either the video or audio data. The libx264 video stream and the MP3 audio stream are read directly from the original AVI container and written into a new AVI container. Because AVI uses interleaved audio/video data chunks rather than a modern index-based structure like MP4 or MKV, the output file's audio-video sync depends on finding a clean keyframe near the start point. FFmpeg adjusts the cut to the nearest preceding video keyframe, which means the actual start of the output clip may be very slightly earlier than the timestamp you specified. The end point is honored more precisely. No quality is lost because the compressed stream data is transferred byte-for-byte.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg command-line tool. On this web page, FFmpeg runs entirely inside your browser via WebAssembly (FFmpeg.wasm), so no files leave your device. The same command can be run locally on your desktop if you have FFmpeg installed, which is especially useful for AVI files larger than 1GB. |
-i input.avi
|
Specifies the input AVI file. FFmpeg reads the interleaved audio/video chunks and the AVI index to understand the stream layout before performing the trim operation. |
-ss 00:00:00
|
Sets the trim start time to the beginning of the file (0 seconds). Change this timestamp to any HH:MM:SS value to begin the output clip at a different point in the source AVI. FFmpeg will seek to the nearest preceding keyframe in the libx264 stream at or before this position. |
-to 00:00:10
|
Sets the absolute end time of the trimmed output to 10 seconds into the source AVI. Change this value to control the end of your clip. If you prefer to specify a clip duration rather than an endpoint, replace -to with -t followed by the desired duration in seconds or HH:MM:SS format. |
-c copy
|
Instructs FFmpeg to copy all streams — the libx264 video stream and the MP3 audio stream — directly from the input AVI to the output AVI without re-encoding. This makes the trim nearly instantaneous and preserves the original quality exactly, at the cost of less precise start-point accuracy due to keyframe alignment. |
output.avi
|
Specifies the output file as an AVI container. FFmpeg uses the .avi extension to determine the output container format, ensuring the trimmed video and audio streams are written with the correct AVI interleaved chunk structure and index. |
Common Use Cases
- Cut a specific scene or highlight from a legacy AVI video archived from a DVD rip or old camcorder recording without re-encoding and losing quality.
- Remove unwanted intro or outro footage from an AVI file recorded by older screen capture or security camera software that only exports in AVI format.
- Extract a short AVI clip from a long raw footage file to share with a video editor or client without converting to a different format that might not be supported by their older editing software.
- Trim an AVI file down before importing it into legacy video editing applications like Windows Movie Maker or older versions of Adobe Premiere that work natively with the AVI container.
- Isolate a specific segment of an AVI-format game recording or tutorial video to use as a standalone reference clip, keeping the original libx264 encoding intact.
- Reduce file size for an AVI recording by cutting out long periods of inactivity or silence, particularly from old-format webinar or lecture recordings stored in AVI.
Frequently Asked Questions
No — because the FFmpeg command uses -c copy, neither the libx264 video stream nor the MP3 audio stream is decoded or re-encoded during the trim. The compressed data is copied directly from the source AVI into the output AVI unchanged. Quality loss only occurs when re-encoding is involved, which is not the case here.
AVI files store video as a sequence of compressed frames, and most frames (P-frames and B-frames) depend on a prior keyframe (I-frame) to be decoded. When using -c copy, FFmpeg must start the clip at the nearest keyframe before your specified start time, because cutting mid-stream at a non-keyframe would produce undecodable data. The result is that your trimmed clip may begin a fraction of a second earlier than intended. If frame-accurate cutting is critical, you would need to re-encode, which this tool avoids to preserve quality.
In the command, -ss 00:00:00 sets the start time and -to 00:00:10 sets the end time, both in HH:MM:SS format. You can also use decimal seconds, for example -ss 30.5 -to 95.25 to trim from 30.5 seconds to 1 minute and 35.25 seconds. Alternatively, replace -to with -t followed by a duration value to specify how long the output clip should be rather than specifying an absolute end timestamp.
The command as shown processes one file at a time, but you can run it in a shell loop to batch process multiple AVI files. On Linux or macOS, use: for f in *.avi; do ffmpeg -i "$f" -ss 00:00:05 -to 00:01:00 -c copy "trimmed_$f"; done. On Windows Command Prompt, use a for loop with similar syntax. Each file will be trimmed to the same timestamps, so this works best when your source files share a consistent structure, such as recordings that all have a fixed-length intro to remove.
Yes — AVI supports multiple audio tracks, and because this command uses -c copy, all audio streams present in the source AVI will be preserved in the trimmed output without any loss or remapping. If your source AVI has, for example, a stereo MP3 track and a separate commentary track, both will appear in the output clip. If you want to keep only a specific audio track, you would add -map 0:v:0 -map 0:a:0 to the command to select the first video and first audio stream only.
AVI's legacy interleaved chunk structure does not handle timestamp-based trimming as gracefully as modern containers like MP4 or MKV. If the source AVI file already had minor sync drift, or if the keyframe interval in the libx264 stream is large, the forced keyframe alignment at the start of the trim can introduce a small audio-video offset. If you encounter sync problems, try adding -avoid_negative_ts make_zero before the output filename to normalize timestamps in the output file, which often resolves this issue.
Technical Notes
AVI (Audio Video Interleave) is a legacy Microsoft container format that stores audio and video data in interleaved chunks, governed by an index at the end of the file. Unlike modern containers such as MP4 or MKV, AVI has limited support for precise timestamp-based seeking, which makes stream-copy trimming slightly less exact than it would be in a newer container. The default codec combination here is libx264 for video and libmp3lame (MP3) for audio, both widely supported by legacy and modern playback software. AVI does not support subtitles, chapters, or embedded cover art, so none of those elements will be present in the output. AVI also lacks support for transparency — if your source contained any alpha channel data encoded via a codec like PNG or RGBA, this trim command with -c copy will carry that stream through unmodified, but AVI's support for alpha channel display depends heavily on the player. For very long source AVI files with a sparse keyframe interval, the trim start point may land several seconds before your intended timestamp; setting a shorter keyframe interval during the original encoding would have prevented this, but cannot be corrected during a stream-copy trim. File size of the output will be proportional to the ratio of the trimmed duration to the total duration, since no re-encoding changes the bitrate.