AVI Repair :(


Recommended Posts

I've made a recording with BB Flashback express. Due to issues in the past with large files the software is configured to split it into 1GB files during the recording process. I use the batch export tool to convert the files to avi format using xvid. The intention is to then append and crop with virtualdub.

The problem is that occasionally one or two of the avi files after exporting seem to have broken headers and I'm trying to figure out how to fix them. (Re-exporting makes no difference). They won't play in VLC, yet play perfectly in MPC. Opening these broken files in virtualdub results in an error "Invalid AVI file: The main 'movi' block is missing".

I tried:

  • Replacing the headers manually from one of the other avi files with HxD and used the "Re-derive keyframe flags" extended option to hopefully rebuild it correctly, but it didn't work, the resulting video consisted of solid green frames. I could easily have done this wrong though, since I have extremely little knowledge of the format...
  • Installing 'super' to do a conversion to see if that'd fix it, but I can't get it to install, I get an error when the installer it tries to download something :angry:
  • Using AVIFix or whatever it was called, but that just gave an error about not finding the movi block.
  • Using AVIRepair, which apparently replaced the header with one from a known good file, but I get the same 'movi' error opening it in virtualdub afterwards.

The video and audio data is clearly there and intact since it plays perfectly in MPC, I just don't know how to repair the headers so it'll open in virtualdub...

Can anyone please help me? (The one thing I can't do is send you the file, sorry, it's personal!)

Link to comment
https://www.neowin.net/forum/topic/1148214-avi-repair/
Share on other sites

UPDATE:

I first tried to solve this a few days ago and failed, now with some further analysis using virtualdub's hex editor's "RIFF chunk tree" viewer I've managed to somewhat better understand the container formatting and I've solved it!

With all of the "good" files there's a JUNK block between the header and movi blocks, which consists of four bytes representing the characters JUNK followed by four bytes describing length followed by the junk content. With the broken files there's simply two bytes representing the letters JU and nothing more, it immediately starts the movi list block after this, i.e. it's screwed up. I fixed this by copying the rest of the junk block from a good file, and adjusting the bytes near the beginning representing file size. I'm now allowing virtualdub to repair the index.

I'm very happy now :)

Link to comment
https://www.neowin.net/forum/topic/1148214-avi-repair/#findComment-595650314
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • (macOS) Screen zoom was broken for me in beta 1 and it's now working properly in beta 2. In terms of performance and UI design/consistency, these betas are already much better than Tahoe.
    • Less powerful than a PS5 at twice the price! I wonder if they use that for marketing? Totally DoA.
    • Astra 0.6.1 Beta by Razvan Serea Astra is an audiophile music player designed for local music libraries, supporting MP3, FLAC, WAV, AAC, OGG, M4A, OPUS, WMA, AIFF, and more via FFmpeg. It offers gapless playback with pre-buffering, multichannel audio remapping, and Dolby Atmos decoding, ensuring albums play seamlessly while maintaining high-fidelity sound. Astra features real-time DSP visualizers powered by a native C++ engine, including an oscilloscope, spectrum analyzer, and vectorscope. A fully parametric 10-band EQ with live frequency response, built-in presets, and AutoEQ headphone calibration import lets you precisely shape your sound. Playback controls include shuffle, repeat, and drag-and-drop queue management, while the library automatically extracts metadata, album artwork, and supports global search, favorites, and recently played tracking. Additional features include output device selection, delay calibration, customizable themes, fullscreen and mini-player modes, Discord Rich Presence, optional Last.fm scrobbling, and an opt-in local API for integrations. Astra delivers a complete, high-quality desktop audio experience with no telemetry, accounts, or streaming. Astra 0.6.1 Beta changelog: Lyrics Initial XLRC support via @boof2015/xlrc 0.2.0 (#131) XLRC sidecar scanning, manual import, and renderer support Word timing, furigana, translations, voice labels, and translation-priority controls for XLRC Fullscreen lyrics overhaul with additional layout polish Manual lyrics editor with LRC, XLRC, and plain-text modes Drag-and-drop lyrics import plus sync offset controls Clickable synced lyrics for seeking, with popout and transport lyrics updates (#138) Fixed lyrics info sidebar scrolling (#138) Added a workaround for LRCLIB instability Metadata & Library Metadata editor rebuilt as a side panel Virtual DB metadata overrides and optional direct file tag writing Bulk metadata editing for title, artist, album, album artist, genre, year, track/disc numbers, and artwork Undo/redo support for virtual metadata edits Clear overrides action and default save-mode preference Artist page grid view added, with later design and sizing refinements Improved Jump to Playing with smart source, queue, album, artist, and library track targets Fixed smart source jump behavior Playlists Fixed VLC-style M3U import failures (#127) Added playlist export to M3U/M3U8 (#118) Improved imported playlist path resolution and missing-entry preservation Shuffle added to playlist pages (#121) Remove tracks directly from playlist views (#128) Fixed create-playlist-from-track modal closing when clicking inside it (#137) Multi-select quality-of-life fixes Right-click context menus no longer clear multiselections UI & Navigation Fixed UI scaling regressions in sidebar and home surfaces (#122, #123) Fixed transport bar regression (#126) Fixed horizontal scrolling on Home and Library rails Fixed artist grid sizing while searching Updated playlist action buttons and related layout polish Additional fullscreen lyrics visual adjustments Visualization Scopes and visualizers now respect UI scaling settings (#155) Added shared canvas sizing logic for correct DPR/backing-store behavior Canvas sizing tests added for visualizer scaling regressions Discord RPC Discord Rich Presence activity structure refactored Compact status can prioritize title or artist Profile info line can show file info or album Title and artist links can target YouTube Music, Last.fm, or be disabled Optional small Astra badge for cover-art presence Configurable “clear when paused” timing Added Discord activity tests Scrobbling Fixed custom Last.fm2 API profiles being accidentally blocked Expanded scrobbler profile protocol handling coverage Stability & Tests Added/expanded tests for XLRC parsing, lyrics presentation, metadata editor state, playlist import/export path handling, artist grid layout, horizontal scrolling, canvas sizing, and Discord RPC activity building Download: Astra 0.6.1 Beta | 138.0 MB (Open Source) View: Astra Home Page | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • How does it compare to the "SeeStar S30 Pro" and the "Vespera PRO 2"?
  • Recent Achievements

    • Week One Done
      Almohandis earned a badge
      Week One Done
    • Rookie
      dorf went up a rank
      Rookie
    • First Post
      mike_rumble earned a badge
      First Post
    • Dedicated
      tuben earned a badge
      Dedicated
    • Week One Done
      mnsgroup earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      501
    2. 2
      +Edouard
      209
    3. 3
      PsYcHoKiLLa
      100
    4. 4
      Michael Scrip
      85
    5. 5
      neufuse
      69
  • Tell a friend

    Love Neowin? Tell a friend!