AfterDawn.com

Repair broken or corrupt MPEG files


This article will walk through a few ways to handle potentially broken or corrupt MPEG/MPG video files (refering to file extension). This would apply to video files that are either out of sync (although this guide does not offer a permanent fix) where the picture and sound are off, sudden blocky video or a video that will simply not play. The software and methods used in this guide will help somewhat in 90 percent of cases but will not fix all problems with MPEG files.


Introduction & Requirements


Software you must download and install
Media Player Classic
Optional: Media Player Classic is included in this guide as a work-around solution to MPEG sync problems since it can change sync during playback. Download!
MPEG Corrector
Optional: MPEG Corrector can scan an MPEG file and fix any inconsistencies with the file headers which can result in playback problems. Download!
VCDGear
Optional: VCDGear can fix header problems as well as exclude bad or corrupt frames from an MPEG file, making it suitable to test bad MPEG files. Download!


You don't particularly need all of the software above, but it can't hurt to download them anyway. Media Player Classic is there as more of a way to "live with" broken MPEG files, whereas MPEG Corrector and VCDGear might just be able to repair them. You might need to download and install WinRAR to extract some of the software items above.

Dealing with sync problems




If your problem with the MPEG file is a sync problem (the audio and video don't match up), then this article offers no permanent way to fix it at the moment. However, this problem can be overcome by fixing the sync on-the-fly, during playback. Media Player Classic is a powerful application for playing back multimedia content, and one of it's tricks is its ability to apply a delay (including a negative delay) to an audio stream. If your problem is an audio sync problem, then read on. If not, you might be still surprised that Media Player Classic will play your file better than other media players. If it doesn't help at all, move to MPEG Corrector.

Download Media Player Classic and run it. If you have been using computers for a long time, you will notice (as it's name suggests) that it looks exactly like the vintage Windows 95 version of Windows Media Player -- but it's definitely better. Open your video file in Media Player Classic using the File menu.

Set Audio Time Shift




Once you have your MPEG playing, try to work out if the audio is before or behind the video. For example, do you hear somebody speak before the actors' mouth moves? If you, then you need to estimate the amount of time there is in the difference. Usually it is just a fraction of a second. Don't worry about estimating for a moment because it would be next to impossible to get it right on the first go anyway. Click Play (the menu) in Media Player Classic, and then move the point over Audio. From the sub-menu for Audio, click Options.

You will now see the window on your screen that is shown in the screen shot above. Firstly, tick the box beside "Audio time shift (ms)". You can now enter a time delay in a number of milliseconds (one thousand of a second). If the audio plays before the video, then the audio needs to be delayed. 500 milliseconds is half a second, so if you set "500", then the audio will be delayed by half a second on playback from its original timing. If the audio comes too long after the video, then you need to set a negative delay. if you were to set "-500", then the audio would play half a second sooner than the video, compared to the original timing.

This is a little tedious on the first try, but set something like "500" or "-500" based on whether the audio players before or after the video, and click Apply, then click OK. Now press the play button on your video and after a few seconds the difference will be noticeable. You can go back to the Audio Options again and change the time shift as much as you want, until you get it right. Remember that when you set the audio delay, it will be saved to the Windows Registry, which means the delay will automatically be applied to any other video you play unless you turn it off. This means that you might mistake videos for being out of sync, so bare that in mind.

Media Player Classic playing broken MPEG?


Media Player Classic might actually play an MPEG file that other software will not. Depending on several elements, even if the beginning of the video file is missing due to corruption, Media Player Classic can still seek out video and audio content and play it. If that does happen to be the case, then it might be more convenient than trying any repair method for the video.

MPEG Corrector




For a solution to actually attempt to fix a problematic MPEG file, a light-weight, quite-old piece of software is always handy to have in your software toolkit - MPEG Corrector (or MPEG Header Corrector). A problem with an MPEG file might be related to the MPEG headers, which might be corrupted, absent etc. Download MPEG Corrector and run the light-weight application.



Click File --> Open MPEG. Navigate to the folder that contains your MPEG file and open it.



You will be prompted immediately to set a filename and location for a potentially fixed version of your MPEG file. So type out a file name and choose your folder (same folder will be fine) and then click the Save button.



Make sure that the Input File and Output File values are correct in the program before we start (if not, go back to File - Open MPEG again). Now click the Fix It! button.



MPEG Header Corrector does not have any kind of indicator as to how much has been done yet. The only way you know it is working is the "Fix It" button changes to "Abort!", and eventually you will be alerts when it has completed it's task (this length of time depends on the speed of your computer and the file itself).



Once it's done, you know you have a new MPEG file in the location, and with the filename that you have previously chosen. You can now go and test out the MPEG file to see if the problem you had has been fixed by MPEG Header Corrector. If not, then you can always try VCDGear.

Attempting repair with VCDGear




Even though VCD / SVCD are not exactly widely used (at least online) any longer, some of the tools that were used to create VCD still have useful features. Once of those is VCDGear. In this case, VCDGear has a built in "converter" that can also fix common MPEG errors in due process. Download VCDGear and run the program. As shown in the picture above, set the Conversion to "mpeg -> mpeg".

Click the Load button to load up your MPEG file.



Once you have loaded in an MPEG file, you will be prompted for a location to save a potentially fixed MPEG file. Navigate to the appropriate folder and type a filename. Click Save.

Start Process




Before you start the process, make sure that the Fix MPEG Errors option is selected, as shown above. Once you have done this, click Start. A progress bar will indicate how much of the conversion has been completed as well as providing an estimated time remaining figure. Once it has completed, you can test your MPEG file and see if the processing was successful.

What if all options failed?


Sometimes an MPEG file can be notoriously hard to fix. Some problems may be unavoidable completely. One major source of "allegedly" bad MPEG files is P2P software such as Limewire, Sky Downloader, Ares etc. Some files are posted only posing as MPEG files but are really just dumby files or something else entirely with an .AVI extension. It is also possible that bad frames are not actually technically "bad", but instead are the products of bad encoding. This could also be the same for audio content.

One other example of an MPEG file that I cannot think of an easy way to fix is an MPEG-2 file that is broken badly from the start of the file. For example, if you receive an MPEG file from Usenet or BitTorrent, where the first chunk of the MPEG is missing, then it may be impossible for all of the above programs to even recognize the file as an MPEG file in the first place.

Almost everybody encounters a broken multimedia file at some point that we simply cannot "fix". The best thing we can do in that situation is look for a fixed file elsewhere with the same content.

Finally


The above methods will fix 90% of all problematic MPEG files. I truly hope this will be the case for you. If you want to talk further about broken files or playback / encoding problems, then please visit our Discussion Forums.

Written by: James Delahunty
Last updated: