[HOW-TO] Fix AVI files within Ubuntu with quick command
Once in a while you might download an AVI video file and, when you try to play it, are disappointed to see an error message stating that the video is corrupt so cannot be played. Free media players such as the popular cross-platform “plays everything” VLC media playerwill sometimes recognize the corrupt video and offer to fix it. While VLC does a very good job at fixing corrupt AVI files, the fix is not applied to the original video. Therefore, any subsequent attempts to play the corrupt AVI again through VLC will always result in this prompt being initially displayed. If you are running Linux (in this case I am using Ubuntu 10.04), there is an easy way to apply the fix permanently via a quick command.
Requirements
Obviously, this is geared for those running Ubuntu, so some flavour of Linux is involved. Additionally, you will need to have MEncoder installed. If you have already set up Ubuntu for multimedia playback, then there should be nothing to stop you from immediately jumping in to the fix. However, if MEncoder is not installed something has to be done about it. For multimedia playback I like to execute the following 2 commands. They will take care of installing VLC, MEncoder and a lot of codecs.
sudo aptitude install vlc mplayer
sudo aptitude install non-free-codecs libxine1-ffmpeg gxine mencoder mpeg2dec vorbis-tools id3v2 mpg321 mpg123 libflac++6 ffmpeg libmp4v2-0 totem-mozilla icedax tagtool easytag id3tool lame nautilus-script-audio-convert libmad0 libjpeg-progs libmpcdec3 libquicktime1 flac faac faad sox ffmpeg2theora libmpeg2-4 uudeview flac libmpeg3-1 mpeg3-utils mpegdemux liba52-dev
Instructions
- Launch a command terminal by going to Applications > Accessories > Terminal.
- Locate the folder containing the AVI file you want fixed. In my case it was located in the Videos directory, so I entered:
cd Videos
- Once there, enter the following command. Modify the file names to match the file names you are using:
mencoder -forceidx -oac copy -ovc copy corruptvideo.avi -o fixedvideo.avi
- Press ENTER and watch the magic take place! The entire process should not take more than a minute to complete.
Once complete, you can retry playing the video through your favourite media player to see if the file was fixed.
Alternative for Windows
If you are a Windows user, on the other hand, and prefer something with a graphical interface, give DivFix++ a try.
DivFix++ is nowadays also available on Linux and Mac environments
Edwin Siebel
18 July, 2011 at 2:46 PM
Hi
I got it done by adding:
-ovc copy
to the said command
Khurram
9 November, 2011 at 4:09 PM
Thank you, buddy, saved my day! 😀 I recorded a video using my astrowebcam and… it is corrupted 😦 Using your method I repaired it! Note: You can use Mencoder under Windows, it is ported successfully (I checked – it works).
Fliker09
20 March, 2012 at 7:59 AM
[…] [HOW-TO] Fix AVI files within Ubuntu with quick command …Sep 10, 2010 … While VLC does a very good job at fixing corrupt AVI files, the fix is not applied to the original video. Therefore, any subsequent attempts to play … […]
Mfix avi | Kimberlyanncol
1 April, 2012 at 11:03 AM
i recorded a video from webcam but before i save it my power shuts down 😦 and the file requires a codec but i am also unable to find any codec for the video because, it keeps giving me a message that file is corrupted or damaged. so, please if any body could tell me how to fix it?? kindly, mail me a software name or method on my mail bluedevil00@rocketmail.com.
sam
22 May, 2012 at 7:59 PM
And file is in avi format.. soo please help me out here
sam
22 May, 2012 at 8:00 PM
[…] https://falcon1986.wordpress.com/2010/09/10/how-to-fix-avi-files-within-ubuntu-quick-command/ […]
Recovering lost footage from the ACT20 action camera | SanskritFritz's Blog
26 July, 2014 at 6:44 AM
[…] Fonte : https://falcon1986.wordpress.com/2010/09/10/how-to-fix-avi-files-within-ubuntu-quick-command/ […]
.: Corrigir índice de de vídeos | Comunidade GNU/Linux SempreUpdate
19 November, 2014 at 11:44 AM