Austin
Austin

Reputation: 7319

FFmpeg Error Checking

I have three example videos, good.avi, damaged1.avi, and damaged2.avi. The first will play in VLC, but the second two both error with the same "Broken or missing AVI Index" message.

I have thousands of these videos which I need to process in MATLAB, so I'm trying to error check using FFmpeg like this: ffmpeg -v error -i vidname.avi -f null - 2>&1

Now here's the part I don't understand:
On good.avi it completes with no output -OK
On damaged1.avi it outputs [mjpeg @ 0x7fc1dd813800] overread 1 -OK
On damaged2.avi it completed with no output as in good.avi -?????

Would someone with video codec/FFmpeg experience please help me understand what's going on here so I can develop a more robust error check?

They also both have identical codec details in VLC: enter image description here

Upvotes: 0

Views: 3483

Answers (1)

wto
wto

Reputation: 221

This is a long shot, but I suspect one of the JPEG image is corrupted (due to the overread 1 error message).

Try to extract the images from damaged1.avi

ffmpeg -i damage1.avi -vcodec copy image%d.jpg

then run mogrify on the extracted images:

for i in image*.jpg; do mogrify "$i"; done

Finally, recreate the video:

cat image*.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output.avi

If this works, then you can extract the audio from damage1.avi and multiplex it into output.avi.

Upvotes: 2

Related Questions