Hello,

I have one avi file that is damaged. I tried playing with mplayer -idx,but this only plays 1min, then the rest is not played and it stops. Is there any way to play the most rest of the movie, bit like in windows ?
Thanks in advance for an help.
Cranium1200

Dani AI

Generated

As reported, the file plays for a short time and then stops. That pattern usually means the AVI container index is missing or the file is truncated: the container can point players only to the frames that actually exist. and are right that some players try automatic fixes, but when that fails a file-level approach is more reliable.

First, inspect the file to see what is readable and what is missing:

ffprobe -v error -show_format -show_streams broken.avi
mediainfo broken.avi

Look for stream presence, reported duration, and any codec errors. If streams appear but the index is wrong or truncated, rebuilding the container often recovers playback without re-encoding:

ffmpeg -err_detect ignore_err -i broken.avi -c copy fixed.avi

If a straight remux fails, re-encode whatever ffmpeg can read into a fresh container (this can salvage more but costs CPU and may reduce quality):

ffmpeg -err_detect ignore_err -i broken.avi -c:v libx264 -preset veryfast -crf 23 -c:a aac repaired.mp4

When ffmpeg cannot pass the corrupted region, salvage what remains by extracting raw frames and audio, then reassemble:

ffmpeg -i broken.avi -vsync 0 frames_%06d.png
ffmpeg -i broken.avi -vn audio.wav
ffmpeg -framerate 25 -i frames_%06d.png -i audio.wav -c:v libx264 -c:a aac out.mp4

GUI tools that rebuild AVI indexes may be easier for some cases: Avidemux and DivFix++ have index-repair features that often succeed on truncated AVIs. See FFmpeg usage notes for options and details: FFmpeg documentation and Avidemux downloads/info: Avidemux.

If the file itself is physically truncated (missing most of the data beyond the first minute), no tool can recreate the lost frames. The workflows above show how to verify what is present and recover as much as possible from the remaining data.

Recommended Answers

All 2 Replies

try VLC player. if it can't play your file, most probably no player will

When you open it up in VLC it should tell you that it's broken, and it'll attempt to fix it, if I'm not mistaken.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.