DivX ;-) Repair Guide

Written by Candela
Version 3.3 October 2001

Version 3.3, October 2001

Version 3.2, June 2001

Version 3.1, April 2001

Version 3.0, April 2001

Version 2.6, March 2001

Version 2.5, January 2001

Version 2.0, October 2000

Version 1.0, August 2000

1. Introduction

After many hours of tedious downloading, and finally sitting down to watch your movie some of you may have noticed one of the following things:

You probably didn't pay too much attention to the latter, but in the first case you had to get out of your lazy chair and fast-forward a bit to make the movie play again. If it happened more than once, you probably deleted the file while wishing the ripper of the movie a one way ticket to hell. But were these 'bad frames', as they are generally called, really the ripper's fault? The answer, in most cases, is quite simply no. They may be in fact your own fault. In this article I'm going to talk about the cause of these errors, how they can be prevented and finally how to solve them.

After I first wrote this document I have discovered other and easier ways to deal with errors. These however, are all described in a separate section. The original method still gives you the most control and makes it possible for you to understand what is going on. Some of the new methods merely simplify the process but the idea behind them is exactly the same. Other possibilities don't actually repair the corrupt data but conceal or patch it.

For the most part, this article is about repairing corrupt files and freezes. However, there can be a lot other problems with DivX ;-). Section 6. Tips & Tricks is specifically devoted to these so you can immediatly jump there if your problem is not related to corrupt data.

I'm always open to suggestions and improvements. You can contact me at the following e-mail address divx_repair@hotmail.com. Or you can try to find me on IRC (EFNET or DALNET) where I'm known as Candela.
Please do not ask me any questions about DVD ripping and try to find an answer to these and other questions at Doom9's MPEG Palace, DivX Digest or Nicky Page's Digital Solutions instead. In case of problems with movies in (S)VCD format, I suggest you try VCD Help. Also refer to these sites for all software in case my links fail.
And finally, do NOT ask me where to download movies, you will be ignored.

2. The cause

2.1. Some history

When I first saw these errors, I thought something had gone wrong during encoding and that the ripper hadn't bothered to check the movie before releasing it on the Internet. I didn't really give it anymore attention until one day I was talking to someone on IRC. It turned out that he had the same movie as me but without the image freezing. On top of that, the filesize of his movie was exactly the same as mine, which proved that it was in fact the same rip and not a different version made by someone else. After playing my version on different systems to make sure my computer wasn't to blame, there was only one possibility left: the file I had was corrupt. After some further investigation this turned out to be true and I was able to replace the corrupt data (only 2046 bytes to be exact) to successfully repair my movie.

2.2. Who's to blame?

Why or how does data in the movies get corrupt? In an ideal world it shouldn't happen, but then again in an ideal world I would have lots of money, buy all movies on DVD and wouldn't even bother to write this document.
Resuming a broken download is probably the most common, but not the only source of corruption. When a filetransfer gets broken unexpectedly on the server side, your file may contain some bad bytes at the end because the client didn't detect the error immediatly. Here is an extract from the help file of the popular downloadmanager GetRight:

Rollback XX K on resumed connections: Because some data may have been corrupted when GetRight was disconnected, this allows you to backup a little bit and reget a small amount of data to be sure that no errors are in the file on your computer. It is suggested that this be the about number of kilobytes (K) downloaded in 2 seconds, which will depend on the speed of your Internet connection. For most modems, the default of 4K is fine.

There are many programs now that can perform this kind of 'rollback'. Among them are current versions of GetRight, FlashGet, FlashFXP, SmartFTP, etc. Make sure you enable this feature when downloading.

2.3. Prevention

Let's look at the best and most common method to detect and prevent errors:

When you are unable to use the above method (e.g. downloading from a website), try to keep resuming to a strict minimum and use a download client capable of doing a rollback like GetRight to reduce the risk of corruption.

2.4. Identifying errors caused by corrupt data

There are a lot of things that can be wrong with the movies you download and not all of them mean your file is corrupt. I already pointed out the 2 most common errors in case of corrupt data. But keep in mind they can also be a result from the encoding process, especially when you have an AMD CPU. It is however highly unlikely that the following errors are a result of corruption. Please refer to section 6 for solutions to these problems.

2.5. Tracing freeze frames

There is an altered version of VirtualDub which automatically creates an index of freeze frames (Video Check Video for Freezes...). It will quickly scroll through the movie and report if there were freezes or not. If there were, it will save an index of those bad frames in the file c:\badframes.log. This is usefull if you want to verify a suspicious file before burning. Keep in mind it only checks for freezes and it will not report the smaller errors like distortion in the frame.

3. The cure

3.1. The basics

Let us first get some things straight. This is NOT a 'press one button and your movie is fixed' type of solution. It requires some effort, spare time and a bit of common sense. Even if you think you do not meet these simple requirements, I advise you to read on and decide afterwards. The method is based on the following assumptions (if these are not correct for you don't even bother sending any comments):

Since you want to replace the corrupt data it's obvious you have to get hold of the good data. So the first thing you have to do is find someone who has the same movie without the error. When you have found someone the only thing left is ask him to send the good data. But how do you know where the file is corrupt and which bytes to copy? Most of you probably know you can find the differences between 2 files by comparing them with programs like a hex editor. Unfortunately this requires both files to be on your hard disk which makes this useless here, as you don't have the error-free movie. Luckily, there exists such thing as a CRC which stands for Cyclic Redundancy Code. The theoretical background of this is not important here. All you need to know is that this number (often 32-bit) is calculated based on the content of a file. If a single byte in the file changes, the CRC will also change. In order to find out if a file is different from another one you only need to compare the CRC3 of both files. This only allows you to see if the file is different though, not what the differences are or where they are located. To circumvent this, you can split4 the files in smaller pieces and compare the CRC of these files. Then you will have good approximation5 of the location of the error (e.g. in part 5 of 20). Only the bad parts have to be downloaded and replaced. Finally you can merge the pieces back together and your file is repaired.

note1: Sometimes freeze errors are caused by the encoding process. It's obvious you cannot repair these errors.

note2: Until now I have only encountered corrupt files were data was altered so probably inserted or deleted data almost never occurs.

note3: There is a slight possibility 2 different files of equal size will have the same CRC but the odds are practically zero and can be neglected.

note4: Even though they are perfectly suitable for error prevention, compression programs like RAR cannot be used as a file splitter here (even in store mode). This is because they alter the data of the file they split depending on which options you set. A program that merely copies the data into different pieces is needed here.

note5: The only way to find the error exactly is to do a byte by byte comparison of both files which, as I said before, is not possible.

3.2. Tools of the trade

Assuming you already have a player for your movies you are going to be needing 2 other Windows programs that can be downloaded from the Internet, Topsplit and QuickSFV. They are free, small in size and very easy to use. You are not obligated to use these specific programs. There are other programs which do exactly the same thing (and are 'compatible'), but these are the best in my opinion. Topsplit, as the name suggests, splits large files into smaller pieces. QuickSFV is a CRC calculator and validator. It uses .SFV files, which are plain text, to store the CRC values.

3.3. Step by step

Before going any further I would like to emphasise the importance of having a BACKUP copy of your movie. If you follow my directions closely and read section 4 attentively nothing should go wrong. But you never know because life just isn't fair. Also read the entire document before even thinking about trying anything and never ever do something you don't fully understand.

The first part is also the hardest. In order to know where your movie is corrupt and to get hold of replacement data, you need access to an error-free copy of the movie. This means you have to search for someone that has it and is willing to help you. IRC is a good place to start. Once you have found a nice person (like myself ;) make sure you don't have different versions of the movie. The perfect way to check is to compare the filesizes in BYTES1. If they are exactly the same, you can be almost 100% sure it's the same rip. Additional checks include the resolution of the picture, framerate, bitrate, sound quality, etc. These can also be used when comparing incompletely downloaded2 movies, where you obviously are not able to compare filesizes. All this information can easily be obtained in Windows Explorer (Select file · Right click · Properties · General & Details tab).



note1: Do not compare sizes expressed in KB=1.024 BYTES or MB=1.024 KB! These are only approximations of the real size (converted and rounded).

note2: You can also use this method as a safe way to finish incompletely downloaded movies because resuming might corrupt your file.

Next you both have to split the movie into smaller parts. Start up Topsplit and select the movie (Source File Information Select Source File) and the output directory (Output File Information Select Output Folder). Decide on a split size1 to use and configure Topsplit accordingly (Split Size Change By Size). Make sure the output filename is exactly the same for both of you to avoid some minor inconvenience later. Change it if necessary (Miscellaneous Miscell Change Split Name).


Start splitting the movie (Start Process) and wait for it to finish. If everything went ok you'll find a lot of files in the output directory named2 .001, .002, .003, ..., with a size of 2.000.000 bytes.

note1: When splitting you can choose whatever size you want for the small parts, just make sure both of you use the same size. Choosing a big size means less parts but more data to transfer when there is an error. A small size results in small transfers but many files which may be slow to handle on your harddisk.

note2: You may also find a .BAT file in the same dir. You can just ignore it or you can prevent it from being created (Miscellaneous Setting Split Setting Batch File Setting Automatically Generate Merge Batch File). It is used to merge the parts again with the DOS copy command when you do not have Topsplit installed.

Next you have to find out were the corrupt data is. Make a CRC table (Select all the parts in Windows Explorer Right click Create SFV).

create sfv file

Choose a filename and press OK. When it's finished send the created .SFV file to the other person. He needs to put this file in the directory with his splitted movie to check which of his files are different from yours (Select the .SFV file in Windows Explorer Right click Verify All or Doubleclick).

check crc

When files are different (i.e. contain corrupt data) they will fail the CRC check as you can see in the above screenshot.

note:  I mentioned the filename of both movies had to be the same. If they are not, you will see 'FAILED. File does not exist' appear after every file because they cannot be found. You can edit the .SFV file with a text editor and do a search & replace on the filenames to match yours. Another possibility is to rename all your files or to split again with the correct name.

As you have probably guessed by now, you will only have to download the files where CRC check failed. Often the errors are small and you'll need only a couple of files. Once you've downloaded the good files replace your own with them. Now it's time to join1 the parts (Merge tab) so fire up Topsplit again and select the first of the split files (Source File Information Select Source File). Also select an output folder (Output File Information Select Output Folder) and an output filename (Merge File List Miscell Change Merge Name).


note1: You can let Topsplit delete the files as they are joined together (Setting Merge Setting Delete Each split file after merge). This is very useful if you do not have enough free space to hold yet another copy of the movie. However, if the files have their read-only attribute set (e.g. when splitting from CD) Topsplit can't delete them (unless you have Topsplit v1.27 build 5). You can turn this attribute off in Windows Explorer (Select files Right click Properties General tab Attributes Read-only).

4. Caveats

Up until now, you only checked if the movie of the other person was ok at the time you saw an error. You replaced all your files that had a different CRC and your movie was fixed. But let's suppose the following situation: movie A is corrupt at frame 1000 and movie B has a problem at frame 1500. If you repaired movie A with movie B by merely replacing the files with a different CRC, you would get an exact copy of movie B where frame 1500 is bad. You wouldn't want that to happen off course.

The only way to check if your movie is fine, is to watch it at the position of the bad file. Therefore you need to be able to link the file offset to the frame number. You can do this with the latest version of VirtualDub (1.4d) which comes with an AVI parser. You can also use AVIIndexGenerator which is MUCH faster than VirtualDub's parser but it doesn't have a GUI. More info about this program can be found in section 5.10.

Suppose you had split your file in parts of 10.000 bytes and you would get a different CRC for part .050. This means your file is corrupt somewhere between 490.000 and 500.000 bytes. Now you have to find out which frames are in this range. Select the Hex editor in VirtualDub (Tools menu Hex editor...), open the movie and select (Edit menu RIFF chunk tree). You will see a window like below.

RIFF chunk list

VirtualDub only shows offsets in hexadecimal format so we need to convert (the windows calculator can do this in scientific mode): (490.000)D=(77A10)H and (500.000)D=(7A120)H. By looking at the screenshot you can see this range covers chunks 178 to 180. Since the chunks (wb is audio and dc is video) represent the frames, this means the error has to be in frame 178, 179 or 180. Now, you can now go look at the frames in VirtualDub and check for errors.

5. Other possibilities

The methods under this section actually replace the corrupt data and restore the file in its original form. They are easier than what's described in Chapter 3 but the effect is the same. You can repair any error like this but obviously you need to find someone with an undamaged version of the file.

5.1.1. Zidrav (v3.3)

Zidrav is a rather strange name for a program that allows you to create and apply patches. It's easy to use and avoids splitting and merging the file. Let Zidrav scan the corrupt movie and it will create a CRC index which you send to the person with the good movie. He will use it to create a patch for you to fix the errors. Since Zidrav uses blocks of 16KB (configurable) for CRC calculation it can make small patches which contain less overhead than my method (you could also use a splitsize of 16KB but that would result in too many files to handle easily). The only drawback is that you have no control over the process so you can not get around the problems described in section 4. A new version was supposedly in the works but the homepage seems to have mysteriously dissapeared.

5.1.2. WinCRC (v1.0) & rsync

These two programs do the same thing as Zidrav but there is one big difference, they fix the errors in real time. Both parties have to run the program. The person with the good movie runs it in server mode and the other one in client mode. The client connects to the server, determines where the errors are by comparing CRCs, downloads the good data and patches the corrupt file on the fly. Again, the main problem is that one of the movies has to be 100% ok as you have no control whatsoever over the patching process. It's also unlikely people behind a proxy or firewall will be able to use either program.
WinCRC was previously known as FileFix but now has a GUI and uses a different, more reliable network protocol. I did not test rsync myself as it is a Unix program. Someone send me a version compiled for windows though, but I'm too lazy to test it. You can grab it here if you want. Have fun trying to figure out how it works.

5.1.3. MovieCRC (v2.02) & MovieRepair (v4.00)

These 2 programs have to be used together. They do exactly the same as Zidrav but in command line style which may scare some people off. MovieCRC is used to create CRC indices and patch files. MovieRepair on the other hand is used to apply these patches to the corrupt file. Check the command line help for more information on how to use these programs.

By patching you can prevent a movie from freezing but you can't repair distortions in a frame. Most of the time patching freezes will even cause a small amount of distortion. The benefit of patching is that you can do this without having access to a good copy which sometimes doesn't even exists. But since only a few bytes get altered, you can still repair the file afterwards should you do find a good copy.

5.2.1. Pseudo patches

The idea behind pseudo patches is quite simple: replace the corrupt frames with empty frames. This can be done by tricking the player into thinking the corrupt frame has size 0 so it will not pass this frame to the codec. As you all probably know by now, avi files contain an index at the end. Even though this index is not really needed for decoding, it is required by players and they use it to know which frames are keyframes for example. The index also contains info about the size of each frame. By setting this size in the index to 0, the player will display an empty frame and then continue with the next. This is not the same as omitting this frame from the index because then the frame will be skipped and the the sound may go out of synch.

Now before we go further I would like to make it clear pseudo patches are not some magical solution. They seem to give good results when only 1 frame is corrupt and freezes. The only thing you may notice is some distortion in the picture but it will no longer freeze. In certain cases however (e.g. a corrupt frame at a scene change) they don't work at all and will completely distort the image during playback.

Because I believe this method is only aimed at the more advanced user, I will not explain everything in detail on this site. If you are not afraid of some hex editing you can download the following files and start experimenting. First of all you need an avi parser which tells you the layout of the avi file you are trying to patch. Since the new VirtualDub is not showing the frame offsets in the index, it's easier to use AVIIndexGenerator, from the same author as MovieRepair. Even though it does not have a GUI like VirtualDub you won't need to calculate the index offsets manually. Secondly you need this text file. This will tell you the output format of AVIIndexGenerator and the info you need about the structure of an avi file.

There is no program yet to do this automatically so everything has to be done manually with a hex editor. However, when someone has patched a movie manually, a patch for use with Zidrav or MovieRepair can be made. That way, other people can easily apply the patch. You can download the pseudo patch to be used with Zidrav or MovieRepair for the small sample movie on this site (corrupt at frame 212). This way you can see the result and compare it with the other methods like AviDeFreezer and BSPlayer.

Patching and editing are closely related but the major difference is that you will be altering the internal structure and size of the movie. Therefore it will no longer be repairable once you have edited it. It's better you don't use any of these methods since they 'destroy' your original file and pseudo patches give better results most of the time (i.e. less distortion).

5.3.1. Koala Film Player

This player contains a module which can actually apply pseudopatches automatically. However, instead of merely patching the index it seems to rewrite it. This results in an altered filesize and that is the reason I put it under the edit instead of the patch section. But since only the index get's altered, it's still possible to repair the file afterwards making this a prefered edit method. Too bad the fix module isn't available seperatly.

5.3.2. DivFix (v1.05)

First I like clear up some misunderstandings about DivFix. Its name is causing a lot of confusion and I wish the author would change it. Its primary function, at which it does an excellent job, is making incompletely downloaded AVI files playable by rebuilding their index. However, as of version 1.03 it is able to detect and fix freezes (by omitting the frames in the index) where the frame header is corrupt. It does NOT detect errors in the actual frame data, only the headers. In 99% of the cases the errors are in the actual data and not the header so it will probably not work if you try it.
This is still a fairly safe way of editing since it only alters the index at the end of the file meaning you're file is still repairable. But since the filesize changes, it will be harder locating a good copy (since you need to compare filesizes).

5.3.3. AVIDeFreezer

AVIDeFreezer is an easy to use program that fixes freezes without removing any frames. But like any other method in this section, it's best you don't use it since it alters the entire file. The zip file contains a tutorial if you really must try it. The homepage seems to have stopped working.

5.3.4. VirtualDub (v1.4c) & other editors

It's mentioned elsewhere in this article that you can use an AVI editor like VirtualDub to cut out bad frames. However, you can't just cut out the corrupt frame, you need to remove all the frames beginning at the corrupt one until the next keyframe. This could introduce a large skip.

5.3.5. The Svinsen way

Some guy named 'Svinsen' developed his own method and called his guide exactly the same as mine in a feeble attempt to cash in on my site's popularity evil. I didn't test it but I'm giving Svinsen the benefit of the doubt and assume it works. However, you'll probably get the same results with AVIDefreezer which is easier to use, just like Zidrav for example is the same but easier then my original method.

For these methods the file doesn't need to be altered and freezes will be fixed during playback. If you have neither the time or effort to repair files, these solutions are for you.

5.4.1. DivX AntiFreeze (v0.4)

This is a DirectShow filter which, after installation, will be used by any player to skip freezes. You can download the filter from its homepage. You don't need to install it if you plan to use any of the following methods.

5.4.2. DivX 4.01

This new MPEG-4 based codec made by DivXNetworks is now backward compatible with DivX ;-). During installation you will be presented with a choice to use the codec for playback of DivX ;-) 3.11 content. If you choose yes all your movies will be played back with this codec and freezes will no longer occurr. However it's possible compatibility is not yet 100%, even though a lot of problems have been solved with version 4.01. If you get strange colours or distortion during playback after installing this codec you know why.
A possible solution in that case is choosing no during installation and using The Playa for corrupt movies. This player will always use the DivX 4 codec for playback when it's installed. An even better way is to use BSPlayer which allows you to choose which codec you want to use (Right click Options Preferences... Video Use DivX 4 decoder for MP43, DIV3, DIV4).

5.4.3. DivX ;-) Directshow Filter

I discovered this on the Digital Digest forum.The reason why movies freeze on corrupt frames is apparently caused by the DivX Directshow Filter. You can make Media Player or any other player using this filter to display video, skip the errors automatically by unregistering this filter in Windows. You can do this in several ways:

Since you can no longer adjust the CPU slider in the DivX ;-) codec after unregistering it's better to use one of the previous methods.

5.4.4. BSPlayer (v0.84)

BSPlayer caught my attention after reading the Test of the DivX players article on DivX Digest which called it the best and ugliest1 player :) for Windows. By activating the following setting (Right click Options Use alternate filter for DivX ;-)) playback will no longer freeze on corrupt frames. However, it's then no longer possible to adjust the CPU slider of the DivX ;-) codec and therefore not recommended.

note1: This player looks hideous indeed. Make sure you grab one of the additional skins available on its homepage or on skinz.org.

6. Tips & Tricks

6.1. Choppy playback

I put this here because some people seem to think this is caused by corrupt files which is not the case. Choppy playback can be caused by a lot of different things. Some movies are just badly ripped but keep in mind that you need at least a PII-300 MHz, or faster if you have an AMD CPU, to play DivX ;-) movies smoothly. The faster the better of course and also make sure you have good video card. A couple of things you can try to improve playback are:

6.2. Incomplete AVI files

All AVI files have an index at the end containing information about each frame such as its size, wether it's audio or video, key- or deltaframe. This information is used by players and therefore you can not play incompletely downloaded AVI files because the required index is missing. It's however possible to play these files in several ways.

6.3. Corrupt RAR files

Sometimes when you get a corrupt RAR file there is not always a possibility to download it again because the file may be corrupt on the server. You can however try to repair the file with WinRAR. You do this by selecting the corrupt file in WinRAR (don't open it) and either press the Repair button on the toolbar, press Alt-R or select (Commands menu Repair archive). There is a good chance WinRAR can repair the file if a recovery record was added to the archive on creation. So when you create RAR files yourselves, always make sure (Archiving options Put recovery record) is checked.
If this doesn't work you can always extract the movie regardless of the bad RAR. In order to do this, you need to tell WinRAR not to delete the file because of a bad CRC. When you extract, check (Miscellaneous Keep broken files). It is off course possible you will get freezes because the file is damaged, but you can repair the movie as you know by now and it's better than throwing your entire download away.

6.4. Missing RAR files

I'm going to be using a file called tarzan.avi split in 10 parts as an example throughout this section. The set would consist of: tarzan.rar, tarzan.r00, tarzan.r01, ..., tarzan.r08

Distribution of movies in split RAR files helps preventing errors but it can also be a source of frustration. Probably everyone has been confronted with a missing file in a set of RARs which prevented extraction. It's not always easy to find a missing part because most people don't keep the RARs but only the extracted file.
Most of you probably know a set of RARs can be extracted with WinRAR (Extract Miscellaneous Keep broken files) up until a missing part. If tarzan.r07 & tarzan.r08 would be missing you can extract tarzan.rar up until tarzan.r06. This will give you an incomplete tarzan.avi file which you can resume from someone with the complete movie.
But now suppose you have every file except tarzan.r00.That means you can only extract tarzan.rar and resume from there. That would be a terrible shame though because you already have the entire movie except for 1 tiny part. You could let someone with tarzan.avi recreate the RARs, but that is difficult because there are a lot of different configuration options. Setting different options results in different RAR files which probably won't help you. You could use the CRC of the files you have to let the other person try until he gets the same RARs. That would be a tedious job though and all the work has to be done by the person trying to help you.
Wouldn't it be nice if you could do most of the work yourself and get the missing data in 1 try? What you have to do is make a copy of another part, e.g. tarzan.r01, and rename it to the missing part, tarzan.r00 in this case. Extract and you will get a tarzan.avi that is corrupt at the position were tarzan.r00 was supposed to be, but the rest of the file will be fine1! And luckily you know how to fix corrupt files after reading this guide. Unfortunately it's not so easy when you are missing tarzan.rar. In that case you can't just copy another part and rename it. You'll have to take another file with the exact2&3 same size and filename length as tarzan.avi and split it with RAR. The created .rar file can be used as a replacement for tarzan.rar to extract the movie, which will be corrupt at the beginning off course.

Please keep in mind that I cannot garantuee these tricks will always work. I did a lot of testing but there are so many different options and situations possible I can't possibly test them all. Now if only people would stop using compression programs to split up large files like movies. Compression does not have any effect anyway and it is much better to just use a regular filesplitter. That way, a missing part can be easily obtained from anyone with the complete movie.

note1: This only seems to work if the RAR was made using STORE - NORMAL compression. Anything above will result in corrupt data beginning at the missing part.

note2: If you do not follow these 2 requirements the extracted file will not have the same size as the original movie. You wouldn't be able to repair it afterwards because none of the described repair methods can resynchronize two files after an error.

note3: To find out what the filesize and filename is you have to open one of the other parts (e.g. tarzan.r03). This is possible in any program that supports RAR extraction. To create a file with the same size you can use Topsplit.

6.5. Out of synch sound

This means that the sound you hear does not correspond with the image shown, most noticable when watching people talking. The sound can either come to soon or to late. It is possible the movie is OK but that your system is too slow for proper playback. In that case read section 6.1 to try and solve it. However, it can also happen because the movie was ripped by an amateur who did not check his rip before releasing it. Fortunately you can often fix it yourself. Read everything you need to know in xprog's Guide To Fixing Desync. Beware though, lately a lot of rips have been made using VBR (variable bit rate) MP3 audio. You can't edit these AVI files using the official VirtualDub version since that only supports CBR (constant bit rate) MP3 audio. I suggest you use Nandub for this.

6.6. Bad aspect ratio

If the movie was ripped with the wrong width or height the image wil look either squished or stretched. You could re-encode the movie to fix it but that will take a long time and degrade the quality. The best thing you can do is get BSPlayer (or any other player supporting this feature), define your own aspect ratio (Right click Options Preferences · Custom aspect ratios) which corrects the bad one. The aspect ratios 4:3 and 16:9 are already defined in BSPlayer. Other common ones you can try are 1.85:1, 1.66:1 or 2.35:1. Then use this for playback (Right click · Aspect ratio) and your movie is resized in real-time to the correct width and height.

6.7. Weird colours

I know of 3 possibilities why you could be getting strange colours during playback:

6.8. ASF files

I always laugh when I hear people talking about how the quality of movies in ASF sucks, and that DivX ;-) is so much better. This is funny because these people have no idea what ASF is. It is NOT a compression format but the streaming version of the AVI container file format. The only reason DivX ;-) exists is because of the lock Microsoft put in their MPEG-4 codec. This lock allowed the use of the codec in ASF but not in the well known AVI format. Since there are many freeware tools to edit AVI files and because ASF is a proprietary format which can only be created by Microsoft's own tools the lock was removed by a hacker and DivX ;-) was born. Movies in ASF can also be compressed with DivX ;-) and have the same quality as movies in AVI. ASF has some benefits over AVI like the possibility to use the original non-hacked codec, adding chapter bookmarks much like a real DVD, being streamable, etc. However, the fact that this format is proprietary means no one can write tools to create or edit this format and it's only available for the Windows OS. Since AVI files can be edited by many programs and can be used on other OS it's the preferred format these days.

Here are some things that could be usefull when dealing with ASF files:

6.9. Codecs

Codec is short for compressor/decompressor and is very common in multimedia applications. You can regard it as some sort of plugin all software can use to encode and decode images or sound in a certain format. When you try to play a multimedia file and you get an error such as "Unable to download an appropriate decompressor" you don't have the correct codec installed to display the file. Each AVI file contains 4 bytes, the FourCC or Four Character Code, which tell a player which codec to use for playback. The FourCC for DivX ;-) Low Motion for example is DIV3. The FourCC can be manipulated to do evil things as I will show you in this and the next section. I will now give a short overview of DivX ;-) related codec packages (video as well as sound) you might have to (un)install.

6.10. FourCC

In the previous section I already explained what FourCC codes are and showed how some people are using them to invent new formats. Because I have advised you not to install codec packages like Angelpotion and SMR, you might be wondering how to play downloaded movies encoded in those formats. The answer is simple: change the FourCC into the code for DivX ;-). Doing this will cause your player to use the DivX ;-) codec to decompress the file instead of looking for the Angelpotion or SMR codec. You can change this easily using a little program called AVI FourCC Code Changer. Make sure the AVI file you want to change is not write protected, open it and change the FourCC from MP43 or AP41 into DIV3 or DIV4 from the dropdown box, both will work.

For more information about FourCC take a look at The (Almost Definitive) FOURCC Definition List.

6.11. Video overlay

For playback of movies most video cards make use of something called overlay. This way they can use hardware functions for stretching the video to fullscreen and for advanced image filtering. However, some video card have bugs in their drivers. When the width of the movie isn't divisible by 32 pixels, hardware overlay initialization fails and the player has to resort to much slower software routines for stretching. This is a common problem for nVidia and Matrox cards. Without overlay, the fullscreen picture will probably not look (jagged edges) or play smooth. To fix it you can try one of the following things:

7. Conclusions

7.1. Why repair movies?

The motivation for this is mainly personal. Maybe you don't mind the errors or you feel it is too much work to repair and rather download the movie again on your super-fast T3 connection. This is fine by me but let me give you some reasons why some people would prefer to repair the movies:

7.2. The reason for this document

Very simple, to become rich and famous. No seriously, up until now I had to fix 10% of the movies I downloaded. This is quite a lot and I hope you have been more fortunate than me. Almost all of them were already corrupt on the server so it wasn't my own fault and means there are a lot of people out there experiencing the same problems. Now I thought the time was right to share my findings with the rest of the world. Mainly because I don't think the method can be optimised even further without someone writing a program (any volunteers?). Another reason is to get those corrupt movies out of circulation. I'm sick of them and I know I am not alone. And finally, I wanted to make people aware of current problems and show them how they can be avoided in the future (see section 2.3.). Even though this document describes a way to fix the errors, it's always better to prevent a disease than to find a cure afterwards.

7.3. Credits

I would like to thank all the people on IRC who took the time to help me fix my movies. You know who you are.

Congratulations to all the authors of some of my favourite programs mentioned and/or linked to in this text. Keep up the good work (and sorry but I can't afford to register :).

BIG thanks off course to all the guys of the Microsoft Corporation involved in the development of their wonderful MPEG-4 codec, and also to the hackers who made DivX ;-) possible.

To all the people that laughed and tried to make me look like an idiot when I proposed my method on Usenet, I would like to say FUCK YOU! You know who you are too. The same message goes to my pathetic ISP which imposes the use of a webproxy, limits traffic to 10GB/month of which maximum 2GB upload, caps my upload speed at 16KB/s, does not provide decent webhosting, etc. And to know this is the best internet access I can get in this country without paying a fortune makes me very sad.

I also like to thank the people that (proof)read this document for their comments and suggestions. And finally I'd like to say hello to all my friends both on- and offline.

Valid HTML 4.01! This document was verified by W3C to garantuee compatibility with ANY standards compliant browser.