How can I check the integrity of an avi file and repair it automatically in Linux?

5

2

I have an avi file and tried to check it as suggested here. But after a short while I just got a segmentation fault, without any other information!

How is it possible to fix/repair this avi file? Watching this file with mplayer just works fine, using it with ffmpeg or kdenlive is causing errors!

System: Ubuntu 13.10 Size file: 4.2 GB

Addition:

Here is part of the output(begin and end) when running the command (the FULL output is about 1 MB of text!)

ffmpeg -v error -i file.avi -f null -

Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press ctrl-c to stop encoding
[dvvideo @ 0x21f39c0] AC EOB marker is absent pos=64
    Last message repeated 1 times
.....
(These kind of lines repeat over and over and over. I really do not see a point providing them all. There are no build information. Interlaced in the output are lines like:
frame=  124 fps=  0 q=0.0 size=      -0kB time=4.00 bitrate=  -0.0kbits/s
)
....
    Last message repeated 3 times
[dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=69
[dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=65
    Last message repeated 1 times
    [dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=71
[dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=75
[dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=64
    Last message repeated 2 times
[dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=70
[dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=71
[dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=67
[dvvideo @ 0x1fad9c0] AC EOB marker is absent pos=65
Segmentation fault (core dumped)

Alex

Posted 2014-01-30T20:07:03.933

Reputation: 337

1What's wrong with the avi file? Why don't you show the actual errors? Can you provide a small sample file that will allow us to attempt to duplicate whever issue you are experiencing? Your ffmpeg command and the complete console output are important information. – llogan – 2014-01-31T00:36:23.000

As mentioned in the question, I got a segmentation fault, without any other message output. Maybe I can enable some debugging for ffmpeg? If so, how? – Alex – 2014-02-04T11:29:00.017

I have updated the question with some of the output ffmpeg` created. If people want to have a sample: How to create this sample? – Alex – 2014-02-12T19:24:45.243

Yes, I do not think this is possible. Its about 1 Megabyte! If you give your email address, I can email you the complete 1 Mega-Byte output of the command !!! – Alex – 2014-02-12T19:31:51.307

See updated question – Alex – 2014-02-12T19:34:18.253

The build information is missing. Provide the first ~50 lines of the console output, and provide the last ~50 lines of the console output. – llogan – 2014-02-12T19:35:27.877

With the command as specied above I get the output as given above. Again: I get EXACTLY the output as given above. There is NO build information. Again: There is no build information. I ONLY get the output as above! If you need other information please provide a way to get it! – Alex – 2014-02-12T19:37:08.703

Then I can only suggest to download a recent ffmpeg build and test with it.

– llogan – 2014-02-12T19:40:46.020

1

In this thread at least the errors of "AC EOB marker is absent" was caused by the x264 that ffmpeg was using, which was fixed by installing gpac-devel-static (on fedora).

– harrymc – 2014-02-12T19:46:56.287

post the output of mplayer -identify filename.avi – Costin Gușă – 2014-02-13T15:36:30.007

Answers

6

try using mencoder (the encoding part of mplayer) like this:

mencoder -idx problemfile.avi -ovc copy -oac copy -o reindexedfile.avi

(via http://www.kahunaburger.com/2010/01/30/fixing-an-avi-index-with-mencoder/)

Costin Gușă

Posted 2014-01-30T20:07:03.933

Reputation: 637

2

Force index

mencoder -forceidx input.avi -o output.avi -oac copy -ovc copy  

Copy all

mencoder -ovc copy -oac copy input.file -o output.file  

Also see https://stackoverflow.com/questions/894903/how-can-i-validate-a-video-file-from-a-script

totti

Posted 2014-01-30T20:07:03.933

Reputation: 832