You've bagged yourself a copy of Game of Thrones from a friend, made a cup of tea, and are about to settle down for a night in front of the television.

But disaster strikes: the AVI file won't play. Your evening's plans lie in tatters.

What are you supposed to do? It's not on Netflix, you don't want to break the law by downloading a torrent, and you've long-since missed the live screening on HBO.

Don't worry; your evening can still be saved! Here's how to quickly repair AVI files that won't play.

Why Does an AVI File Become Corrupted?

You'll stumble across several reasons why AVI files don't work. The most common are bad sectors on a hard drive, a virus, electromagnetic interference, software issues during creation, and torrent issues (yes, some AVI files on torrents are entirely legal).

The causes sound serious, but it's not necessarily the case. Most of the time, you can trace the root of the problem back to a damaged index.

Because AVI is a sub-format of the Resource Interchange File Format (RIFF), it breaks data down into two blocks. Typically, these two blocks are indexed by an optional third block; it supplies the location of the data to the program that's reading the file. This third block is usually the problem area.

Simply put, if you can fix the index, you've probably fixed the AVI file.

Two Methods for Fixing Broken AVI Files

A Google search will reveal several apps that claim to fix AVI files. In many cases their claims are accurate, but they'll try and charge you a hefty fee if you want to save the fixed file.

Often, you'll find a workaround to avoid paying the full fee, but why not save yourself the hassle? There are only two programs you need: DivFix++ and/or VLC Media Player.

I'm going to show you how to use each of them to fix AVI files.

Download: DivFix++

Download: VLC Media Player

DivFix++

DivFix++ hasn't been updated for a few years, but it remains the most-used app for fixing AVI files, and it still works perfectly.

This guide will cover the Windows version of the app, but it's also available on macOS and Linux.

To begin, grab a copy of the app from the developer's website. The app comes packaged in a ZIP file. When you unzip it, you can use the EXE file straight away. You do not need to install it on your machine.

Open the app for the first time, and you'll see a blank screen with just a few options. Pay attention to the three checkboxes in the lower right-hand corner.

If your AVI won't open, it's worth making sure Cut Out Bad Parts is ticked. It'll strip out parts of the video that cannot be salvaged, but at least you'll be able to play and watch the remainder. It's also smart to keep a copy of the original file.

Using DivFix++ to fix AVI files is a two-part process. Firstly, you need to strip out the old index. Click Add Files and point the app at your broken file. You can also click Check Errors before you start, but it's an unnecessary step. If your file isn't working, you just want to fix it as quickly as possible.

When you've added the file, it'll show up in the Source Files box. You can add multiple files to create a queue. Next, click Strip Index.

If the process was successful, you'll see a confirmation in the Log Window.

Now you need to rebuild the index and fix any other corrupted parts of the video. At the top of the app's window, click the folder icon and select a destination for the new file. Next, click on Fix to get the process up and running. Depending on the size of the file and length of the video, it could take several minutes.

When the file is ready, you'll once again see a confirmation in the Log Window.

That's it; the newly-created file should play perfectly.

VLC Media Player

If you don't want to use a DivFix++, you can often get results by using VLC Media Player instead. Any self-respecting tech geek should have a copy on their system because it's packed with features. Like DivFix++, the app is available on macOS and Linux, but I'm going to focus on the Windows version.

If you try and open a broken AVI file within VLC, you'll see an on-screen error message:

VLC broken file error

Click Build index then play and let VLC do its thing. As the message suggests, it could take a long time.

If you have lots of broken AVI files and don't want to regularly deal with the on-screen message, you can make VLC automatically fix files when you open them.

Open the VLC app and navigate to Tools > Preferences.

In the new window, click on the tab labeled Inputs/Codecs and scroll down the to the Files section. Within Files, locate Damaged or incomplete AVI file and select Always fix from the drop-down menu. Click Save when you're ready.

Note: Using VLC to fix AVI files does not alter the actual file. It merely temporarily fixes it by saving a new index in the app's memory while the file is in use. If you try to watch the file in another media player, you'll still encounter a playback error.

Which Tools Do You Use to Fix AVI Files?

This article has shown you how to use DivFix++ and VLC Media Player to fix broken AVI files. Follow the steps closely, and that evening with Game of Thrones will be back on track in no time. It is also worth checking out Stellar Video Repair. It is a similar tool to the two that we discussed in detail and is a solid option if the first two do not work for you.

Now it's your turn to add to our suggestions: Have you found an app that can repair AVI files that we didn't mention? What makes it so unique? Why does it deserve a mention?

As always, you can leave your suggestions and recommendations in the comments below. And remember to share the article on social media – you might save someone else's evening!

Image Credit: oculo via Shutterstock.com