| |
Tutorial: Handling Video files from Usenet
There is an abundance of video available in Usenet binary
groups. In a perfect world, if you saw something that you
wanted to watch, you could just download it and watch it.
If you wanted to save it, you could just burn it to a video
CD or DVD and watch it again later, either on your computer,
or just by popping it into your DVD player. Sometimes, it
is just that easy - you download the file and there it is,
Windows Media Player or some application already on your
system will play it, The software that came with your CD
or DVD burner recognizes it and you burn it to a VCD or
DVD and your DVD player has no trouble with it. Unfortunately,
that is very much the exception rather than the rule.
I'm going to give some tips, tricks, and procedures for
downloading and watching various different kinds of video
files. The details of downloading and combining posts I've
covered in another
article along with conversion of disc images to video
files. Here's another good resource for anyone downloading
binary files as well: www.timdoc.com.
In this article, we'll concentrate on what to do with video
files once you've got them, to render them playable on your
system, and to convert them to formats that can be written
to VCDs and DVDs. Some DVD players can recognize regular
CD-Rs that have had AVI or MPEG files of various types simply
copied onto them. As far as I know, however, these all have
some limitations, and while some files may work as downloaded,
others may not - in these cases, the troubleshooting tips
in this article about converting files to "standard" VCD
or DVD files may be helpful as well. My aim when doing these
conversions and fixes is generally to "dumb down" files
that are encoded in a complicated way to a simple MPEG format
that is usable on almost any DVD player. If you are interested
in generating DVDs or files that support 6 or 8 channel
surround sound or optional languages or any of those things,
this guide won't cover those kinds of setups. The scope
of this article is to cover basic usage of reasonable quality
videos, which is complicated enough!
I'll be discussing how I do things, and my experiences -
when performed on a different machine or with different
software, many of the facts, statistics, times taken, file
size issues, etc., may well come out different - your mileage
may vary! I hope though, that the information will be useful
to most people who are trying to figure out basic video
issues. This article will not, however, discuss how to copy
or convert copy-protected works. Sorry. In my examples,
I'll be talking about "NTSC" format - if you are in a region
where the PAL standard is used instead, just substitute
"PAL" wherever I say "NTSC" and that will work for you in
almost all cases. If you don't know what I'm talking about,
you are almost certainly in a region where NTSC is the standard,
so don't worry about it.
Hardware:
Can I convert video files from Usenet on my 386 sx-25? Um,
No. For an example, I do all my video processing on a Pentium
IV 3ghz, 1gb RAM, 120gb Hard Drive, ATI RADEON 9200 128mb
video card, Windows XP Professional operating system. That's
not the highest powered machine, but I find it to be pretty
adequate. I will probably get another gigabyte of RAM soon,
more RAM would be a help. In most cases only a reasonable
video card is necessary for viewing and converting video
files, the one I have now is fine - I may upgrade soon but
mostly because I have been playing around with capturing
video, not because I need a better one to watch or convert
files.
Here's a quick test that's useful to tell if you need more
RAM (on a Windows machine) - right-click on a blank space
of the taskbar at the bottom of the screen. Choose "Task
Manager" from the context menu, and click on the "Performance"
tab. Now start watching or converting a video. If the number
listed for "Commit Charge" regularly peaks at higher than
the number for "PhysicalMemory>>Total", you need at
least that much more RAM. This means that your machine is
regularly "running out" of RAM and the machine is using
space on the hard drive to emulate RAM, which is VERY slow.
This is a "Bad Thing".
If you are trying to watch, much less convert video of reasonably
high resolution on a machine that's say, a Pentium II 300mhz
with 128mb of RAM, you will find it a very slow and frustrating
process, even though it will be possible with patience.
I would consider that the absolute bottom end machine that's
useful for this process. Some high resolution DivX videos
may not even be viewable on such a system, and must be converted
to say, Video-CD MPEG before the system will be able to
render the frames fast enough to watch the video. Converting
a two-hour Divx file on a machine of that configuration
might take 6-8 hours, as opposed to say 1-1.5 hours on my
Pentium IV. Of course the more RAM you have, and the faster
processor or dual processors you have, the easier and faster
it will be. The biggest helps are faster and more processors,
more RAM, and big, fast hard drive.
You will want to have a LOT of free space on your hard drive.
I would consider that having 20 gigabytes free at all times
before attempting converting or editing a video of any size
should be the minimum. Temporary files, converted video
output, all take up a lot of room - and in some cases you
may convert a file more than once into intermediary formats
before being finished - and you certainly don't want to
delete previous files at each step in case of a mistake
or error that you don't catch right away.
If you are using a Macintosh or Linux machine, much of the
information in this article will still be useful, but you
will need to use different applications and techniques to
perform the functions I'll describe. Where there are Mac
or Linux versions of utilities I'll try to list them and
their sources - most of the sites I list as sources for
utilities also list the Mac and Linux versions right there.
Codecs:
What are codecs, and why should I care?
From Webopedia:
-codec-
(1) Short for compressor/decompressor, a codec is any technology
for compressing and decompressing data. Codecs can be implemented
in software, hardware, or a combination of both. Some popular
codecs for computer video include MPEG, Indeo and Cinepak.
You will encounter a number of different video formats in
the binaries newsgroups. Some groups are specifically set
up for files of a particular type, like "alt.binaries.multimedia.divx"
or "alt.binaries.multimedia.vcd". You will see two main
types of video - "MPEG", and "AVI", with a large number
of various 'flavors' available for each. What 'flavor' a
particular video is depends on which CODECs were used to
create it - and to play it, you must have a compatible codec
to decompress it. The reason that codecs are used at all
is that without compression, digital video files are huge
to the point of being unusable.
A video file consists of one or more "streams". Most video
files have 2 streams - video and audio. We'll go into others
later on in the article. For purposes of illustration, I'll
use a basic, uncompressed AVI file as the simplest form
of video. The video stream is basically a succession of
bitmap pictures, one for each frame. The audio stream is
simply an uncompressed PCM WAV file. If the frame size is
640x480 pixels, with a color depth of 24 bits per pixel
(24bit) and around 30 frames per second (30fps), a video
file will take a shocking 97 gigabytes per hour to store.
Think about trying to download that! When compressed as
an MPEG Super VideoCD (SVCD) file, it will only take about
800 megabytes per hour to store - a massive improvement
with some loss in quality, but not much - barely noticeable.
Going further, a DivX 5.11 AVI file will only take about
300 megabytes per hour for the same video, again with very
little loss in quality.
So we need to use codecs, but why so many? In my opinion,
there are too many in use, and it makes the process of viewing
and converting downloaded video much more complex than it
needs to be - but that's my opinion. Different people have,
in many cases, very good reasons for preferring one over
another - and different software packages used to create,
capture, or convert video often use different codecs simply
because they don't have a license to use someone else's
codecs. MPEG is an "Open Standard" - so usually MPEG video
will be compatible on most systems. AVI can vary a lot,
so AVI video often needs special attention. In many cases
simply having the right codec installed will allow you to
view and convert a downloaded video file. If you download
a video file, and when trying to watch it you can see video
but get no audio, or you can hear audio but get no video,
or the video is distorted or blocky, you almost certainly
do not have the correct codec for it. Installing the proper
codec will solve the problem.
Nearly every AVI format that you will see in videos from
Usenet binaries groups including DivX, nAvi, Angelpotion,
SmR, etc., was originally based on MS Windows Media Video
V3. Originally, the "new AVI codecs" released by these groups
were simply the Microsoft codec that had been hacked - changed
by editing the actual compiled file with a hex editor or
other tool. The reason that these hacks were done was that
Microsoft did not publish the codec for use with Windows
Media Player or other player applications with the ability
to encode files (record video) - it had been disabled so
that the published codec only had the capability to decode
files (play video).
The only real differences at first were the re-enabling
of AVI encoding, the name change, and usually a different
settings window. The codecs "developed" by these various
groups have evolved a great deal however, in the case of
DivX now having a completely different, open source codec
no longer using the hacked MS codec, and various fixes and
changes having been made to some of the others. Of course
there are a large number of other codecs as well with more
"respectable" roots, I mention these because it's an interesting
story. :-)
In order to watch video that has been encoded with these
various schemes, you need to have the proper codec to decompress
it installed on your system, or you need to actually change
the "FourCC Code" in the file to associate it with a different
codec, that can play it. The FourCC code is a property buried
in an AVI file which identifies what codec to use to decompress
it.
In my experience, the simplest and most efficient way to
install almost all of the codecs in use for video files
available on Usenet is simply to install the K-Lite
Codecs Pack available on Free-Codecs.com.
There are a lot of freeware and shareware tools available
on that site as well that are quite useful.
In the particular case of an "Angelpotion" AVI file, however,
you should use the FourCC Changer to actually change the
FourCC code to DivX or another codec you have installed
instead of installing the Angelpotion codec package. The
AngelPotion codec package is known to be unstable and can
cause system problems. Hint: The FourCC code for DivX 5
can be "DX50" or simply "divx" - and the DivX 5 codec can
play almost all of the "rogue" AVI formats. Try that first...
The FourCC code can be changed with a utility called "AVI
FourCC Changer". This tool can make an AVI file unplayable
- so always make a copy of the file to experiment with,
and have patience and understanding. The computer is only
a machine. It is not conspiring against you. :-) This is
sort of a last resort option, a tactical nuclear weapon
to use if all else fails. A tool that can show you what
codecs and filters your video file is set to use is GraphEdit
- it may be more information than you want, but it may provide
some clues.
Other sources of codecs and codec information: MovieCodec.com
DivX.com FourCC.org
VideoHelp.com
OK, I've read or at least scrolled through all that stuff,
how to convert a video file, and write it to a disc for
my DVD player?
I use almost the same process whenever I get a video file
of almost any type. I download and mess around with video
files on my computer, but usually I want to collect them
up and watch them on my TV, via my DVD player. I have a
DVD recorder now, but when I only had a CD recorder I would
make VCDs or SVCDs to watch. A VCD or SVCD will hold only
60-80 minutes of video though, so if the video file is longer
than that it must be split if that's what you want to do.
I use 2 applications for basic file conversions - TMPGEnc
(Tsunami MPEGEncoder, by Pegasys, US$58.00, and worth every
penny) and VirtualDub
(Freeware, and worth giving a contribution). I use TMPGenc
DVD Author (US$68.00, trial version can be downoaded)
to write DVDs on my HP DVD420i DVD writer. This will work
for many MPEG and AVI formats without any need for extra
steps. Unfortunately, there is often a need for extra steps,
we'll handle those individually while going through the
process, which is fairly quick and easy if there are no
errors or problems. I've also bought Cucusoft's
MPEG/AVI to DVD/VCD/SVCD/MPEG Converter Pro, and while
it is easier to use than TMPGEnc in many ways, it also lacks
many of the features that allow you to use TMPGEnc to work
with files that have trouble. It won't allow you to specify
separate Audio and Video source files for input, for example,
which is useful in some cases as you'll see below. There
are free trial downloads of the converter, a Lite version,
and other software at their website.
Testing a downloaded file, and performing a conversion with
TMPGEnc:
1) First, download and assemble the video into its original
file format. This might be AVI or MPG, ASF, WMV, or any
of several other formats.
2) Play the video, in Windows Media Player or your favorite
player if it's something else. Usually just double-click
the file.
3) If it has both audio and video, great. Skip ahead and
sample the file in a couple of places. Does the audio match
the video (synched up)? Great. If not, if playback is with
bad- none- or mismatched- audio or video, there's a problem.
You may be missing the codec for the file (see above) or
the file may be damaged in some way, or require extra processing
(see below). Otherwise, continue.
4) If you wanted to simply watch the file on your computer,
you are done. Watch it at your leisure.
5) If you want to make a VCD or DVD with it, you'll need
to get it squared away.
6) If it's an MPG, see what size it is. If you are using
Windows Media Player, you can click onFile>>Properties,
and it will tell you the frame size. If it is (anything)x240,
it is probably MPEG-1 VCD format. If it is (anything)x480,
it is probably MPEG-2 SVCD format. If it is (anything)x(more
than 480) it is probably in MPEG-2 DVD format. It will probably
be able to be written to a VCD, SVCD, or DVD directly and
easily. I say probably advisedly, we'll see later. I usually
simply try to burn it and if the authoring software gives
me an error (such as if the video is in PAL format in my
case as I want NTSC video), I return to this step and convert
it to my desired target format, NTSC Video-CD, S-Video-CD,
or DVD.
7) If it's an AVI, it should be converted to MPEG. To convert
to MPEG, Start the TMPGEnc "Project Wizard" and select the
target format. for SVCD,choose "Super Video-CD>>NTSC",
for VCD or for 8 hrs video per DVD,choose "Video-CD>>NTSC".
For a high resolution DVD, choose"DVD>>NTSC". If the
quality of the source file isn't DVD quality, you won't
gain anything by that. I usually burn 4 two hour videos
per DVD by using "NTSC VCD" quality. This is hard to tell
from a commercial quality VHS tape if the source video file
is even that good. Click Next.
Choose the format
8) Choose the input video file. This is one place where
you might see a problem - the Video and Audio sources should
both fill in from the video file you choose. If the video
has a problem and an error is reported, you will need to
re-rip the video (see below). If the audio portion reports
an error, OR if the audio source path comes back blank,
you will need to re-rip the audio (see below). Otherwise,
continue by pressing Next.
Select the source video file
9) You'll see a Filter Settings page with various options
to set while ripping the file to MPEG. If the file you are
converting is in regular, TV screen aspect ratio (roughly
4:3), and everything else seems OK with it so far, simply
press Next and skip this screen, leaving the advanced settings
at their default values.
Filter Settings Page
If the video is in widescreen format though, you need to
take an extra step here or the converted video will be created
"squished up" to the size of the TV screen, instead of "Letterboxed"
so that it will view correctly. To set this, Click on the
"More Settings" button. This will give you a dialog with
a series of tabs. Choose the "Advanced" tab. Here you can
change a number of things - the aspect ratio of the output
file is what I regularly wind up using here though. We'll
set TMPGEnc to create a file that is letterboxed from a
wide, narrow "widescreen" format source file. In the "Video
Arrange Method" pulldown box, you'll see that the default
scaling is "Full screen". This means that whatever the shape
of the frames in the original file, it will be rescaled
to fill a TV screen. Choose "Full screen (keep aspect ratio)".
This will scale the picture to be as wide as your TV screen,
but rather than scaling it vertically from top to bottom,
which would make everything appear unnaturally tall and
thin, it will leave black bars at the top and bottom and
"letterbox" the picture in its proper scale. The reason
that you may not always want to use the "keep aspect ratio"
setting is that some AVI files that are clearly full screen
TV size sometimes mis-report the aspect ratio and will be
created "squished in" from the sides in improper scale -
if you leave the Video Arrange Method at "Full screen" this
will automatically be corrected. The only time you need
to set it to "keep aspect ratio" is if the input file is
in widescreen format. Press OK to leave the "Advanced" dialog,
and "Next" to leave the Filter Settings page of the Project
Wizard.
Filter Settings Dialog for Widescreen /
Fullscreen choices
10) Next you'll see a page showing the Bitrate settings
for the output video. This page also shows you the size
that the finished file will take up on the disk. Usually
you won't need to change anything here, but this page indicates
several things that are important to determine whether you
might need to back up and make changes to get the result
you want. First, look at the size in megabytes of the output
file. You should expect the output for VCD format to be
about 500-600 mb per hour - so a two hour video should be
somewhere around a gigabyte, about 130% of the size of a
Video-CD.
Size of the output file
Too large for a CD, but OK if you are saving
for DVDs
If the file size is reported as many times larger than that,
say 3 or 4 gigabytes for a 2 hour VCD, it is almost always
because the audio stream cannot be accurately decompressed
(usually because of a variable bit rate) - you will need
to back up here, and convert the audio to a WAV file as
outlined below. Otherwise - if you want to use the output
file on a DVD, it's fine as long as it's less than 4 gigabytes.
Pressing Next will show you an error stating that the file
is too large for a CD, but that doesn't matter. Just press
OK and continue - the file will write to your hard drive
just fine.
Too large for a CD Error
If you do want to use the output for a Video-CD though -
you will need to split the file. You can do this by pressing
"Back" to the Filter Settings Page,
setting the Source Range by entering Start and End Frames
for each segment,
and running the wizard twice, once for the first section,
and once for the second section. Otherwise, press Next to
continue.
11) The final page of the wizard allows you to choose the
location and filename of the output file. By default it
will be a file in the same directory as the converted file,
with the extension "mpg" instead of AVI or what it might
have been before. If you are converting an mpg file into
an mpg file of a different format, change the filename so
that you won't overwrite the original. You shouldn't delete
or overwrite original files until you are sure that the
output file works and has been made properly! Believe me,
I've suffered for doing that. If you want to set up multiple
conversions in the same session, for example if you are
converting a file for VCD and you want to run through once
for the first CD and again for the second CD, you can select
"Create another project(s) for batch encoding". Pressing
OK on this screen, you should get a message that says "File
does not exist..." and you can press OK. If you get a message
that says "File exists, Overwrite...", you should cancel
and go back and rename the output file, unless you are sure
that the file to be replaced is no longer needed, like a
previous output file that was bad for some reason. If you
selected batch encoding, you'll now go back to the first
page of the wizard, select output format. Continue to add
files or specify segments for output until you are ready,
then on the last one, once you return to the first page
of the wizard, select cancel, and you'll see a list of the
files to be processed. If you selected "Start Encoding Immediately",
the file will start processing.
Final processing options
You now have a file or set of files that can be used for
VCD, SVCD, or DVD burning. To burn VCDs and SVCDs using
MPEG files created as outlined above, I use an application
called VCDEasy
to write to CDs. Early versions (Up to about 1.1) were freeware,
and it has evolved into a commercial product that must be
paid for. There is a free trial version available for download
at their website.
VCDEasy
To burn DVDs, I use TMPGenc DVD
Author, which allows burning DVD format (around 2 hrs
per DVD) or VCD format (around 8 hours per DVD) files to
DVDs with the ability to create navigation menus and chapter
points for navigating inside the file. There are several
authoring programs available for doing this with varying
feature sets.
Troubleshooting:
The first thing to mention before doing any of the troubleshooting
and fixing steps below is that you should always make a
copy of the file you are working with and set it aside before
doing things that will overwrite it. Sometimes you may want
to try some of these steps several times with different
settings to see if the results are better, and some of these
steps could potentially damage or ruin the file. So make
a backup, and if worse comes to worst, you can just delete
all the working files and versions and test files and start
over with the original.
A tip for easier use of utilities mentioned below like VirtualDub,
VirtualDubMod, DivFix, and AVIdeFreezer: Since these utilities
don't install themselves into the Windows registry and associate
themselves with the AVI and other file types, it starts
to be something of a pain to browse to the install directory,
open the utility program, and load a file everytime you
use them. Under Windows 2000/XP you can add these utilities
into the right-click context menu "Open With..." option
for AVI files, so you won't need to navigate to the install
directory for the program and manually start it every time.
To do this, right-click on an AVI file, and choose "Open
With...". Then click on "Choose Program..." and browse to
the location of VirtualDub or other utilities, double click
on the "exe" file, being sure that "Always use the selected
program..." is not checked. The utility will open with the
file loaded. You can perform a fix on the file or not and
close the application - from now on, you'll be able to choose
that utility from the list available in "Open With..." every
time you right-click on an AVI file.
The context menu with tools for AVI files
set up
Incomplete AVI file:
AVI files have an index of all of the frames in the file,
which is located at the end of the file. If you've downoaded
an incomplete AVI file, most programs can't play it, as
it will be missing that index. Simply open the file with
DivFix,
a free program, and choose "Rebuild Index". After DivFix
is finished, the file should be playable and convertable.
Audio Missing or unsynched:
One of the most common reasons for audio missing from playback
with DivX files is that the audio is in AC3 format and you
do not have an AC3 Filter installed. You can get this from
SourceForge. Often
even with the filter installed, the audio will play back,
but won't convert properly. You'll need to convert it separately
as outlined below.
The audio may be in a format that the conversion tools can't
handle. Often this is because the audio was saved in Variable
Bit Rate (VBR) format to save space. VBR is great if you
just want to view the file, but it can be big trouble if
you are trying to convert it. It also might be encoded in
a format that the converter can't handle, but that we may
be able to convert by other means. Exporting the audio file
from the video, messing around with it and converting it,
and re-combining it with the video, surprisingly, will not
damage the video. Often it will make the video usable, and
rather than introducing "synch" problems, sometimes it will
actually fix them. The main thing to remember is not to
do things that will change the length (in time) of the audio
file when it is separated from the video file. Any cutting
and pasting or removing sections needs to be done while
the audio and video streams are joined.
First, try to save the whole video file with a plain, uncompressed
PCM WAV audio stream in it. This is the simplest audio fix.
Open the file with VirtualDub, or VirtualDubMod. VirtualDubMod
is simply a branch version of the VirtualDub program that
has been altered to handle more audio stream formats. In
the following examples I'm using VirtualDub, VirtualDubMod
may have different menus and options. Under video, choose
"Direct Stream Transfer". Under Audio, choose "Full Processing
Mode", and "Compression..." and set the compression to "Uncompressed
(PCM)".
Just copy the video to the new file (much
faster!)
Set VirtualDub to convert the audio track
Save the AVI with uncompressed (PCM-WAV)
audio
Under File, choose "Save As AVI" and enter a new filename
(Not A Good Idea to overwrite the original file, in case
of errors!). Now try again to convert the file, simply resume
at step 7 above. If you get an error at this point, you
will need to export the audio and try to convert it separately.
Sometimes, if the audio can't be converted to a WAV stream
by VirtualDub, you'll need to use another program. This
is a little trickier, but not terrible. In Virtualdub, under
Audio, select "Direct Stream transfer" and then under File,
choose "Save WAV". This will save the audio stream to a
file, but it will not be a WAV format file, no matter what
you name it. It will be a file of the same format as the
audio stream in the video - if it is AC3, it will simply
be an AC3 file - if it Ogg Vorbis, it will simply be an
OGG file, etc. You can find out what format the audio is
in the stream by using VirtualDubMOD.
Save the uncompressed audio as a "WAV"
file
Save audio progress screen
You can convert this audio file to an uncompressed PCM WAV
file using a program made for the purpose. A good, simple
AC3 converter (PX3) is available for free at Digital-Digest.com.
It's simple, straightforward, and easy to use. Ogg Vorbis
files can be converted by several different commercially
available applications, and there is a freeware utility
called BeSweet,
which is somewhat complicated to use. There is a Windows
User Interface for it available (BeSweetGUI) which makes
it a little easier. I use GoldWave,
which can be downloaded as a fully functional try-before-you-buy
version, it works very well and is extremely easy to use.
Now that the audio is in the simplified format, you can
use TMPGenc as you normally would with the avi as your video,
but loading the WAV file as the audio, replacing the unconvertable
stream in the video with your converted audio. When you
load the AVI as the video, TMPGEnc will automatically load
the same AVI file as the audio source. Click on the "Browse"
button next to the audio source file path and choose the
WAV file you created as the audio source. Now you can continue
at step 10 in the procedure above. If the audio doesn't
match the video anymore though (lost synch), you'll have
to take another step. You can do this in TMPGEnc as well,
starting from the next screen from where you've specified
the video and audio input. This will also work if the original
file was OK except for bad synch between the audio and video.
Load the video from the AVI, but the audio
from the converted WAV file
Click on the "More Settings" button. Under the Advanced
tab, select Source Range, and double click on it to bring
up the Source Range dialog. The default settings should
be zero for the start frame and -1 (negative one) for the
end frame, this means to start at the beginning and continue
to the end of the file. Changing these will allow you to
"crop" the video. If you check the display audio box and
move the slider some you should see the audio levels in
green on the display bar. Large files/slow machines and
divx files might take a while to search when you move the
slider. Changing the audio gap setting will make the audio
move back and forth in relation to the video - this will
allow you to correct a synch problem. A trick that I use
is to find a place in the video with a short, loud noise
linked to a visual cue - like a gunshot or something striking
something else. The loud noise will appear in the audio
display as a peak in the amplitude, you can adjust the audio
gap until the noise occurs at the same time as the visual
cue. If the sound is behind the video, use a negative number
to move it back, if the sound is ahead of the video, use
a positive number to move it forward. Click on OK in the
Source Range dialog, and OK in the More Settings dialog,
and return to step 10 above. To get the audio and video
perfectly synched, you may have to adjust this figure and
re-rip the file a couple of times. Be patient and you will
get great results.
Change the Audio Gap setting
Corrupt frames:
Sometimes you will get a video file that plays fine, but
when you try to convert it to a different format, TMPGEnc
or other conversion programs will crash or come up with
an error at some point in the file and be unable to continue
- or in some cases the file may appear to convert, but after
some point the video is distorted or missing, and often
the audio portion is out of synch with the video. When you
load the file into VirtualDub, and run the slider along
to preview the file, it will report an error decompressing
the frame of video that causes the problem. The frame number
can be used in various of the fix strategies we can try,
as well as the number of the keyframe before and after the
damaged frame. Depending on the nature of the damage to
the file, it can be easy to fix, or more difficult to fix.
We'll look at several methods of dealing with this type
of error, starting with the easiest and working our way
up.
Error - corrupt frame data
Sometimes this is caused by invalid entries in the index,
which is basically a list of frames in the video that is
located at the end of an AVI file. The index contains some
information about how to decompress each frame, so if the
index entry is corrupted it can make it seem as though the
frame is corrupted. Simply open the file with DivFix,
a free program, and choose "Rebuild Index". After DivFix
is finished, IF the problem was the index, the file should
be playable and convertable. DivFix will display errors
too about invalid frames and frame data in some cases that
might be useful in troubleshooting the file. I've seen it
report every frame after a corrupted one as invalid though,
which isn't very useful.
Usually however, the corrupt frame problem is caused by
actual corrupt frames in the video. There is a program that
can fix some video files with corrupt frames, and it's worth
a try. Often it will fix the file and the problem is solved.
It's called AVIdeFreezer
(this link will take you to a page with a number of utilities
on it, look for AVIdeFeezer to download it), and it's a
free program. The zip file of the program contains a help
file in HTML that details how to use it, using VirtualDub
to find the corrupted frames, locating the keyframes before
and after the corrupted frame, and fixing the corrupted
frames with AVIdeFreezer.
If neither of these methods work, you can split the file
at the corrupted frame and process it as separate files.
Sometimes this is necessary even after a successful repair,
because sometimes the video and audio are fine until the
point where the corrupted segment was and then they are
out of synch. This often happens when a file was opened
in VirtualDub or some other program and a section of it
is removed, like deleting commercials from a taped TV program.
For this reason, opening the file in VirtualDub and simply
selecting and deleting the corrupted frames and saving as
AVI often doesn't work, because then the audio goes out
of synch at the cut point. It will work sometimes though,
so it can be worth a try - I've just never had much luck
doing it that way.
First, Open the file in VirtualDub, and use the frame scroll
bar to go to a point near the error, and playback until
the error occurs. Record the frame number, and use this
as your end, and new start point, to split the file into
sections.
Select the invalid frame and everything past it by placing
the frame scroll bar on the frame before the bad one and
pressing "Start Selection", then moving it to the last frame
and pressing "End Selection". Delete the selected frames
using the delete key or Edit>>Delete Selected. In
the Video pulldown menu, choose "Copy Stream" mode. In the
Audio pulldown menu, choose "Full Processing Mode". Now
save the good "part 1" video to a file using File>>Save
As AVI. Remember, don't save with the same filename, if
you overwrite the file at this stage, you will not be able
to make the good "part 2" of the file!
Select and delete the corrupt frame and
everything after it to make "part1"
Load the original file again and repeat the operation, this
time selecting everything up to and including the bad frame,
and delete the first part of the file. Now save the second
part of the file as the good "part 2". If there is more
than one bad frame in the file with good video that you
want to keep between them, you will need to do this for
the sections between bad frames as well, selecting the bad
frame and the part before, and the bad frame and the part
after, each segment.
Select and delete the corrupt frame
and everything before it to make "part2"
Now you have multiple parts of the video, each of which
should be valid. You can rejoin them by opening the first
section in VirtualDub, then using File>>Append AVI
segment for each segment in turn, then saving as a new AVI
file. You should do this with "Full Processing Mode" on
for the video and for the audio. Choose a compression for
the video that will keep it from being "uncompressed" which
will result in a monstously huge file. I usually use "DivX
5.11", or "MPEG4 Video Compressor V1", either works quite
well for an intermediate file to convert to VCD/SVCD/DVD.
Uncompressed audio will make the file fairly large but not
unmanageable if you are just going to convert it anyway.
If you want to save the file as a DivX you should choose
MPEG or AC3 compression to keep the file size down - for
best compatibility and ease of conversion use CBR (Constant
Bit Rate) rather than VBR (Variable Bit Rate) encoding.
Rather than rejoining the files, you can also simply convert
each one to mpg, and burn them all in order as the same
"title" to a VCD/SVCD/DVD. Most software for authoring will
let you do this, and each file just becomes a chapter in
the same video. Sometimes there will be a slight flicker
when the player moves from file to file, but in most players
this is not even noticeable.
I hope that this article has helped get you started working
with video files.
As always, back up early, back up often!
--technogeek |
|