How To Make Small Non-interlaced AVIs From Video Using Speed Razor
3.51
1/ TEMPORAL RESOLUTION: It is often important
to deinterlace a full resolution interlaced video clip to prevent
blurring between the two fields wherever there is motion (called
destruction of temporal resolution). You usually should turn off
one of the fields (when making small AVIs such as 320X240). It's
usually not a bad idea to do the same for 640X480 AVIs intended
for playback on computer screens, unless the aliasing on graphics
is more undesirable than the blurring of motion between fields.
There are 3 ways to turn off one of the fields. You can put one
of the repeat field effects under any video clips that are being
converted to AVIs, or you can go under Project/Editing Settings/Setup
& set Playback to Field 1 or 2, but don't forget to set it back
to Frame when you're done. The third, most often used way is if
you use the "Import Scale" feature to
trim off excess black from the sides of the picture (usually required
for PVR users when making small AVIs), then you should also have
"Source is fielded" X ON. Use only one
of these methods, usually the last one.
2/ IMPORT SCALE: When making AVIs from PVD clips,
the import scale function is usually necessary to trim the black
edges off the PVD clip. The import scale function may also be necessary
to trim lines below the head switching point at the bottom of the
screen or for trimming off closed captioning, VITC & other data
that may be at the top of the picture. The import scale function
will considerably increase your rendering times because it causes
Speed Razor to scale TWICE (i.e. scales it from the trimmed version,
up to 720 pixels wide by 480 pixels wide for a PVR, then scales
it down to your final size, often 320 X 240 pixels). When in:sync
programmed the "Import Scale" feature, they were not thinking
in terms of the final file width being anything other than the width
that your video card puts out (i.e. 720 X 480 pixels). The ideal
solution would be if in:sync programmed Speed Razor so that the
"Narrow Image" feature could be used when making small
AVIs. That would only require one scaling (not two) so the image
quality might be slight better & the rendering time for AVIs
would be dramatically less (almost half). To be as versatile as
the "Import Scale" feature, the "Narrow Image"
feature should be redesigned so that you can trim a different amount
off each edge.
3/ GAMMA CURVE: When making AVIs from NTSC video
in Speed Razor, only the 7.5 to 100 IRE luma range is normally used
(superblack off), so make sure no black detail is below 7.5 IRE
when capturing. Most of the AVI codecs have a NONLINEAR GAMMA CURVE
that is a little different than video (video is 2.2), so it will
cause the detail in the blacks to be clipped or crushed (some detail
in black areas will seem too dark or gone altogether). Depending
on the picture content, you may want to countercorrect for this
in Speed Razor by putting the Gamma effect under the video clip
& doing a black stretch. For a mild black stretch of about 4
IRE set the effect at 0.9. For a medium black stretch of about 5-7
IRE set the effect at 0.8 (I recommend this setting). For a heavy
black stretch of about 8-11 IRE set the effect at 0.7. Here is my
preset for the Speed Razor
gamma effect.
4/ AVI AUDIO OUT OF SYNC: It has been my experience
when making small AVIs from PVDs using "in:sync's" Speed
Razor, that the AVI audio & video are consistently "out
of sync" by about 7 or 8 frames (based on 30 frames/second)
with all Indeo & Cinepak codecs when played back on the old
version 4.0 Microsoft Media Player in NT, or about 3 to 4 frames
off using the Microsoft Media Player in Windows 95. Were not talking
about audio drift, but a consistent offset of the AVI audio to video
from the beginning of the clip to the end, regardless of length.
The audio occurs before the video. I don't think this is a problem
with Speed Razor, but I'm pretty sure it is a problem with the Microsoft
Media Player version 4.0. If you play the same AVI file back using
the Active Movie Player (or the even newer Windows Media Player
Version 6), it seems to be in sync. There are two workarounds to
bring it back in sync if you have to play it back using the old
Microsoft Media Player 4.0. If your original PVD & WAV files
are single clips, separate the audio from the video & slide
the audio to the right along the timeline by about 7 or 8 frames.
If your original is many clips, render the small AVI as you normally
would, then pull the AVI back into SR (after changing the settings
to edit an AVI), separate the audio from the video & slide the
audio to the right along the timeline by about 7 or 8 frames, then
export it to a file. If the AVI is in 14.985 frames per second mode,
just remember that each frame now really represents two frames,
so only move the audio clip 4 frames to the right. There will be
no quality loss when exporting AVI to AVI since it is only copying
the file.
5/ COLOR BIT DEPTH: In Speed Razor, use 24 bit
AVIs because 16 bit doesn't seem to work right (at least for Indeo
codecs). Actually, I don't think 24 bit AVIs really are 24 bit (16.7
million colors). I've recently learned that some AVI codecs use
YUV9 color space which makes them less than 24 bit. I'd like to
learn more about this area because I suspect this is one of the
reasons that small AVIs aren't particularly efficient with data
size.
6/ FRAME SIZE: 320X240 is the usual pixel size
for an AVI for CD/kiosk applications & it fits the correct screen
ratio of 4:3 so that the picture is geometrically correct. Smaller
sizes (i. e. 160x120 or smaller) are sometimes used when extremely
small data rates are required such as for internet downloads of
AVIs. 640X480 AVIs are more likely to skip frames during playback
unless you have a very powerful CPU, a defragmented hard drive,
are using the Active Movie Player or new Windows Media Player 6.0
& have little or nothing else running at the same time. Older
codecs like Cinepak & Indeo 3.2 don't require as much CPU power
& are less likely to skip on 640X480 X 15 frames.
7/ FRAME RATES: If you decide to use a lower frame
rate than the original video, set it at EXACT divisible numbers
of the original frame rate so you don't get any black frames or
unevenness of motion. For example, if the original frame rate was
29.97 for NTSC, set it at 14.985 (not 15) if you want to have new
frames half as often. If there isn't much motion, you might be able
to get away with a frame rate of 9.99 (not 10). Most clients seem
to find a frame rate of 14.985 per second to be a reasonable compromise
(& it halves the video data size of the AVI). Sometimes the
frame rate will revert to an earlier setting if you enter/exit the
"AVI compression setup" area, so verify before clicking
OK in the "export file settings box".
8/ EXPORT FIELD RENDER OFF: In the Export File
settings area, it is VERY important to turn OFF "Field Rendering"
when making non interlaced small AVIs. This should not be confused
with the Import Scale area where "Source is fielded" should
be left ON. The combination of these two different field settings
are interactive & the position you should set them to will vary
depending the frame rate (i.e. 29.97 Vs 14.985), the size of image
(i.e. 640X480 Vs 320X240) & whether you want to blend the two
fields together or not.
9/ TYPES OF CODECS: The Intel Indeo Video INTERACTIVE
4.3 & 5.06 AVI codecs are the best AVI codecs by a country mile
(especially for lower data rates)(very similar in quality to the
Sorenson codec for Quicktime), but they do require significantly
more CPU processing power to play back without flaws (a 486 at 33
MHz isn't fast enough for 320X240 X15 frame/sec & even a low
end Pentium may not be enough for some Indeo INTERACTIVE AVIs).
These INTERACTIVE codecs are not included in NT 4.0, but you can
download them for free at http://www.intel.com/ial/indeo/video/driver.htm
Intel now has a 5.06 version with additional improvements.
The Intel codecs may also be freely distributed with your product
for the benefit of those who can't download them (the free QuickTime
player needs a license if you distribute it). If you don't know
what processing power will be used to playback, then it is often
safest to use Cinepak (newest version is 1.10.0.26) or Indeo 3.2
codecs which are built into every Windows operating system. Cinepak
is a more universal codec, but Indeo 3.2 has skin colors that look
more natural (more red) & a bit higher contrast. Indeo 3.2 can
look extremely blocky on solid luma levels in the 57 to 95 IRE range
(try a 85 IRE solid white screen & you'll see what I mean).
Cinepak doesn't have this problem, but the original version (1.8.0.12)
that ships with each PC operating system does have a known bug at
100% of data rate that can cause objectionable large pixels blocks
in areas with slight gradations or flat colors (such as faces).
Cinepak has slightly greener skin colors, lower color saturation
(especially for subtle colors), better anti-aliasing at low data
rates, but it also looks a bit blockier & has noticeably more
noise (or granularness). The Quicktime3 player on the Mac or PC
will only play Cinepak AVIs not (Intel Indeo 3.2 AVIs), however
the newer Quicktime4 player will play Indeo 3.2. The Quicktime3
player on the PC (not the Mac) will also play Indeo 4 versions but
not 5.
If you are producing an AVI to be imported into another utility
for further processing & compression (say MPEG-1 or Quicktime3),
choose "Uncompressed RGB" so it doesn't suffer additional
quality loss from compressing & uncompressing another generation.
This will create a very large file (about 3.46 meg/sec without audio
for a 320X240 X15 frames/sec AVI) so make sure you have enough hard
drive space. Since AVIs currently have a 2 gig limitation, you will
only be able to create an uncompressed 320X240 X15 AVI of about
9:38 minutes (8:25 minutes if 22 kHz 16 bit mono audio is used).
There are newer paid Windows Cinepak codec versions available at
http://www.cinepak.com/begin.html
The readme file for the new version says "This version
improves compression quality, adds some new modes to improve playback
in different bit depths and formats, improves the quality of larger
frames, reduces the codec's memory footprint, and fixes a few obscure
GPFs."
You should be aware that if you take an RGB uncompressed AVI into
QuickTime3 Pro for exporting to a Cinepak .mov file, this QuickTime3
version of Cinepak is really just an AVI file. If you rename it
from FileName.mov to FileName.avi it will play on PC systems that
are not updated with QuickTime3 but have the new Windows Media Player
(recent attempts to rename a QuickTime3 Cinepak to an AVI on movies
made with Media Cleaner Pro 4.0 did not work). Unfortunately you
cannot take a Cinepak AVI created in Speed Razor & rename it
to a .mov for use in the QuickTime3 player. That's too bad because
it would save having to do the second render & the newer Windows
Cinepak codec (version 1.10.0.24) doesn't have the pixel block bug
mentioned above. While the older version of Cinepak for QuickTime3
does have that pixel block bug, I found the picture to be a little
less posterized than AVIs made with the newer Windows Cinepak codec.
10/ DATA RATES: About the lowest "fixed"
data rate that I found acceptable for 320X240 AVIs at 14.985 frames
per second, with no audio & a key frame every frame, was 250
k/second. If space is not a problem & you are playing back from
hard drives, or if you are including audio, use a higher data rate.
This is a very subjective thing & the data rate needed will
vary depending on the codec used, the detail in the picture, key
framing used & the amount of motion from frame to frame. You
have a choice of setting a "fixed" data
rate per second which includes any audio you might use (X data rate
box & fill in desired data rate) or a percentage of the compression
quality that the chosen AVI codec can handle (85% or higher is usually
pretty good for Indeo codecs). Choosing a percentage will end up
using "variable" data rates depending
on how much the subject material needs, which is a more efficient
use of data & hence your data size will probably be lower overall
while your picture quality in high detailed scenes might be higher.
I prefer the percentage setting, unless you have a situation where
a spike in the data rate above a predetermined point might cause
problems. If you need to conform to a minimum data rate such as
2X CD-ROM speeds (with no spikes above that rate) then you might
want to fix the data rate rather than use a compression quality
percentage. At 2X CD-ROM speeds, a fixed data rate will probably
lower your overall picture quality compared to a percentage that
results in the same total data size, but a fixed data rate would
be less likely to skip frames on a 2X CD-ROM playback. You'll have
to experiment to get the best results for your material & playback
hardware. At low data rates, it's always compromise.
The percentage settings are rather logarithmic for Indeo codecs
& relatively linear for the Cinepak codec. In other words, the
percentage setting using the Cinepak codec is more relative to the
data rate used. A percentage setting of 85% may yield adequate results
for Indeo. The same 85% for the Cinepak codec doesn't drop the data
rate as radically when you set a lower percentage. Both Intel Indeo
3.2 & Cinepak codecs give about the same quality at a given
data rate (but not at a given percentage). The Intel Indeo 4.3 &
5.06 INTERACTIVE codecs will give better quality at a given data
rate, but not every computer has a powerful enough CPU to play back
these codecs without skipping frames. You will have to experiment
to find the data rate settings that are suitable for your project.
If you are playing back from CD-ROM, you will be limited to the
data rate of the CD-ROM player your client is using. Even though
most computers have fast CD-ROMs (4X or faster), the slowest is
likely a 2X CD-ROM which has a theoretical speed of 344 kilobytes/sec,
but in practice shouldn't be expected to exceed more than about
2/3rds (or about 230 kilobytes/sec) without skipping frames, because
the CPU uses system time to uncompress the file & because CD
players seldom deliver their rated speed across the whole surface
of the disc. Since it is difficult to deliver quality movies at
2X CD-ROM speeds using older AVI codecs & since most modern
computers are equipped with at least a 4X CD-ROM player or faster,
I would recommend suggesting to your client that the minimum requirement
be 4X CD-ROM players (try not to exceed 460 kilobytes/sec).
It should be pointed out that some CD-R burners do not make very
good players for AVI & QuickTime movies even though they may
be rated as high as 16X play speed (like my Yamaha CRW4416SX). In
theory they should play back movie files with no trouble, but in
reality they often cause serious skipping problems. I really don't
know why CD-ROM burners have problems playing movies (if you know
why, please let me know). Usually any current cheap play only CD-ROM
will play movies without a problem.
11/ KEY FRAMING: If you really need to get the
data rates down so your AVI will play off a 2X CD-ROM without skipping
frames, or so the AVI will more quickly download off a web site,
or just to save hard drive space, experiment with setting your KEY
FRAME every 4 or 7 frames (rather than every frame). If you set
key frames at 4, what this does is store a full frame every 4th
frame & it just stores the difference data for the other 3 frames
in between. It is a pretty good compromise when you want to keep
the resolution up & the data rate down. The artifact that this
causes is low resolution in the 1 - 3 frames after a change in scenes,
until you get to the next key frame. Most clients don't even notice
this if your key frames aren't too far apart (i.e.. key frame every
4th frame at 14.985 frames per second, or key frame every 7th frame
at 29.97 frames per second). To demonstrate how effective changing
the key frame can be, I was able to get the data rate of an AVI
file from 352 k/sec, down to 169 k/sec by changing the key framing
from every frame, to every 4th frame & the client thought they
looked the same. The particulars were Indeo 3.2 codec, 320X240 X
24 bit, 14.985 frames per second, audio at 16 bit mono 22 kHz. If
your key framing is left on, do not set it to zero as this will
cause only the first frame to be keyed & the image may get progressively
poorer in quality the further you play into the file.
When using keyframes of higher values it also limits whether you
can look at specific frames in applications like Microsoft Media
Player. i.e. keyframing set to 15 only allows you to stop at every
15th frame. Speed Razor can look at each frame regardless of key
frame frequency.
12/ PADDING: If your AVIs will be playing back
from hard drives, set the padding to meet byte boundary on 512 &
if it's playing back from CD-ROM set it at 2048. If you're not sure
which it will be playing back from, set padding to 2048 (for Indeo
3.2 & Cinepak). Indeo 4.3 video INTERACTIVE should almost never
be set at 2048 as it may adversely affect playback quality.
13/ AUDIO DATA RATE: You will have to determine
which audio quality is suitable for the material you have. Changing
stereo 44 kHz 16 bit audio 176,404 bytes per second (172.27 kilobytes/second)
to mono, cuts the audio data rate to half (about 86.1 KB/sec). Changing
the sampling rate from 44.1 kHz to 22 kHz will cut the data rate
by half again (about 43.06 KB/sec) & will handle audio analogue
frequencies almost up to 11 kHz, which is not a serious compromise
even for music. After this you start to make serious compromises
in your audio. Cutting the sampling rate to 11 kHz will cut the
frequency response to 5.5 kHz which is about telephone voice quality
and cuts off high frequency music (about 21.53 KB/sec data rate
size). Cutting 16 bit back to 8 bit approx. halves your data rate
again (about 10.76 KB/sec) but it has such few samples that 8 bit
audio sometimes has an objectionable noise floor when the audio
is quiet. I recall someone saying that if you use 8 bit audio, you
can clean it up a bit so the noise floor doesn't sound so staticy,
in sound programs like Sound Forge or Cool Edit. If you use audio
when making AVIs, make sure you turn on "Interleave audio with
video" when exporting to a file so you don't get a separate
audio file.
Intel Indeo 4 & 5 version codecs now also have an audio compression
codec version 2.05 which can considerably reduce the size needed
for audio data, however you must make sure that the target audience
also has the codec on their system.
14/ BATCH PROCESSING: If you need to batch process
a bunch of short PVDs to AVIs since there is no batch processor
in Speed Razor, the best way is to render all your PVDs to one huge
AVI file, then bring that AVI file into SR as a new project &
chop it into the original lengths. You can then "Export to
a file selected area" to make individual AVI files (use load
settings from file). AVI to AVI at matched settings can be rendered
(copied) in faster than real-time & there is no quality deterioration.
Try to make your original clip length in even number of frames if
you're reducing the frame rate in half.
15/ PLAYING AVIs IN SPEED RAZOR: If you cannot
get the AVI to play in real-time on the computer screen (while editing
in Speed Razor), this is no longer a DPS codec bug (since PVR codec
2.53 July 96). All you have to do is open the "Perception AVI
Codec Configure" & unX "Play to Video Monitor".
In Speed Razor under Project/Editing Settings, change the video
device to Video (*.avi), then click on "Load settings from
file" & reference it to the file you're editing.
16/ DO A TEST. If your video (PVD) to AVI render
is a real long one, do a short "Export to a file" test
first to make sure it looks right, as rendering times can be pretty
long.
17/ SKIPPING FRAMES: The Microsoft Media Player
4.0 in NT 4.0 will not tell you if an AVI file is skipping video
frames when the hard drive can't keep up because of fragmentation
(& you might not notice this). If you play the AVI file in Speed
Razor, it will give you a message whenever it's skipping frames
because it uses a different player. Higher AVI data rates (often
above 300 k/sec) will often skip frames if the drive is fragmented
or if the software codec can't uncompress fast enough, so if this
is happening, defragment the drive or copy the AVI to an empty partition.
If you download the free new Microsoft Windows Media Player version
6.0 at www.microsoft.com/windows/mediaplayer/download/default.asp
you will find this a much better player & it can tell you if
the movie file is skipping frames (under View/Statistics).
18/ AVI AUDIO DRIFT: The AVI player in Speed Razor
is different than the Microsoft Media Player 4.0 in Windows NT 4.0
& audio will frequently drift out of sync with the video when
playing from Speed Razor (audio plays too slowly & won't be
finished by the time the video is finished). The larger the data
rate, the more it drifts (starts to be noticeable on a 30 second
AVI clip above 150 k/sec) Audio does not usually drift out of sync
in the Microsoft Media Player (instead it drops video frames). I
was using a Pentium 133 & padding to meet byte boundary of 2048.
Your results may vary. This AVI audio drift is not to be confused
with the 8 frame consistent audio offset sync problem mentioned
earlier.
19/ GRAPHICS CARD RESOLUTION & BIT DEPTH.
Having a high quality graphics card with acceleration will help
display the AVI files without skipping frames. Make sure your graphics
card has the latest graphics drivers. If support for Microsoft's
"Direct Draw" is available, install it. It is preferable
to run your computer screen color depth at more than 256 colors
(8 bit) as the picture could look more posterized at only 256 colors,
especially if the graphics card doesn't do a real good conversion
from the 24 bit AVI. 65,000 colors (16 bit) or 16 million colors
(24 bit) will make your AVI look better.
20/ RECOMPRESS I do not fully understand the "Recompress
always" & Recompress to match data rate" features,
so the follow statement in from Christopher Bond. "I believe
recompress always means that when creating a clip it will recompress
everything when compressing your files. An example is say you open
a 30 sec AVI clip and you change the audio and reoutput it; if you
recompress the video will degrade. This also [at least] was an option
in animator studio, and you could force it to not recompress some
portions of the video that didn't have changes - i.e. an AVI clip
where half had a new layer added [composite] it wouldn't recompress
the frames before the new stuff was added - which meant better quality
during that first portion, but the compression wouldn't match."
There are many other pieces of advice that could be given for processing
small non interlaced AVI files but these should get you on your
way. Other users might wish to pontificate on the "Recompress
always" & "Recompress to match data rate". If
you have corrections or improvements to this tutorial, please forward
them to me.
By Doug Hembruff.
Last updated June 14/2000
|