VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Hi all

    I'm writing scripts to repair my collection of movies in different video formats. I have so far sorted the .mkv and I'm now looking into the old .avi files.
    As I'm on Linux with no graphical environment (CLI only) and do intense use of scripting I would like to parse all the avi/s and get a simple answer on whether the index of the file I'm looking at is corrupted or not.
    Is there anything I can use to get such information? I would then use that info to make a decision on whether to force an index rebuild or not.
    Dvifix++ does have a "Check Errors" function but it works on GUI only.
    All the links I have found on google show how to use mencoder to rebuild the index regardless, but I don't want to do that id the index is already ok.

    Any tip/input?

    Thanks
    Quote Quote  
  2. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Check out FFprobe.
    Quote Quote  
  3. rebuilding the index should go very quickly...
    Originally Posted by kenj1 View Post
    An extremely fast method to fix this problem is via ffmpeg (http://www.ffmpeg.org/).

    For example, to fix a bad avi file "bad.avi" to "good.avi", you'd do the following:
    ffmpeg -i "bad.avi" -c:v copy -c:a copy "good.avi"
    The 2 arguments tell ffmpeg to directly copy the video and audio portions of the original file.

    It takes roughly 10 seconds on my iMac to fix a 1GB AVI file.

    Ken
    Quote Quote  
  4. But thanks for the feedback

    The rebuilding speed is not the issue in my case.

    The data I have is backed up offsite via Internet/VPN using rsync.

    If I "touch" the existing avi, rsync will retransfer it from scratch as it's essentially a new file. This behaviour is unwanted in my specific case.

    P.S. I'm still trying to get my head around the ffprobe suggestion as the list of parameters supported is just overwhelming
    Quote Quote  
  5. Running ffmpeg copy (as above) on an AVI with index known to be bad:
    it is repaired as expected, but there is no console message regarding anything out of the ordinary.
    Likewise, ffprobe does not have any AVI index validation as far as I could tell.


    My usual method for error checking is the following ffmpeg command line. It's Windows so you might need to translate:
    Code:
    ffmpeg.exe -i "file-under-test" -f null  "dummy" 2> "fferrorlog.txt"
    ('2>' redirects stderr to a file; I think it might do the same in Unix)
    This test also gave no indication of any problem with that file.


    Loading the file in VirtualDub (just loading it, nothing else) results in the following message:
    Code:
    [*] AVI: Opening file "E:\Data\Video\AA4 r19 -noindex.avi"
    
    [!] AVI: Index not found or damaged -- reconstructing via file scan.
    
    [!] AVI: Invalid chunk detected at 126985140. Enabling aggressive recovery 
        mode.
    
    [!] AVI: Keyframe flag reconstruction was not specified in open options and 
        the video stream is not a known keyframe-only type.  Seeking in the video 
        stream may be extremely slow.
    So, you could use VirtualDub to tell you whether to force an index rebuild or not.
    Virtualdub runs on Windows of course, which is why I tried to avoid suggesting it earlier.
    vdub.exe is the command-line interface. It is found in the same folder with Virtualdub.exe.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!