Making streamable AVIs

Original Page URL: http://www.divx-digest.com/articles/avi_streaming.html
Author/Publisher: Abducted from The Netherlands
Date Added: Apr 16, 2001
Date Updated: Apr 16, 2001


You can do this with any "normal" AVI, that means no VBR MP3 and no other bitrate WMA (DivX) codec than normaly can be used.

Ofcourse you should make try and make the file size really small, to make it possible to view it while downloading ("streamable") I ussualy use an average of 30kb/s, making a 90min movie 162000kb.

So you see it has to be alot smaller then normal DivX movies and ofcourse the quality can't be as good as a normal DivX movie. But it's better then anything els i've seen at 30kb/s (only 240kbit/s).

Back in the old days most ASF movies were done at 350kbit and max resolution of 352x288. You can make a small DivX movie by using some tricks like only 15frames/sec instead of 23,976fps - 30fps, only use mono sound and the WMA (DivX) codec ofcourse. And i always use the highmotion codec at a high resolution. The fast motion codec is more sensitive to "motion" then the low motion codec. For instance when u encode the same scene with fast and low motion in it, the fast motion codec would use 40kb/s for the fast motion parts and only 20kb/s for the low motion parts, where as the low motion codec would use 35kb/s for the high motion parts and 25kb/s for the low motion parts. Because of this the low motion parts with the fast motion codec will look good but not perfect like with the low motion codec, but fast motion parts will look good too and those parts are totaly screwed with the low motion codec at this bitrate. I recommend FlasKMPEG to make the first 'full size" AVI because u can convert any movie at 29,97fps while keeping the sound in sync. With mpeg2avi u can only convert at one fps and that's 23,976fps vor NTSC and 25fps for PAL. If you use 29,97fps the video clip will run too fast and you'll never get the audio totally in sync. You rip the AVI at full resolution and full bitrate, so you'll get a giant perfect looking AVI, also the sound should be at a high bitrate MP3. Why do you need this, because you're gone make the small avi with VirtualDub.

What to do in VirtualDub:
    1. Open the giant AVI. Under video -> "filters" you select "rezise" and rezise to about 640x . . . (if your movie turns out way to big and u can't really lower the bitrate you should try decreasing the resolution a bit, but lower resolution will make the picture more blocky, that's just a side effect of the fast motion codec)
    2. Next, video -> "frame rate" you select "Process every other frame (decimate by 2)" this will gine u the 15fps (14,98fps) and that's why you need the giant AVI to be at 29,97fps or 30fps.
    3. Next, video -> "color depth" select 32-bit. mpeg-4 codec only is 24bit but the better it hits the codec the better the result is d:-)
    4. Next, video, "compression" select the fast motion codec and play around with the bitrate till u get the picture quality and filesize you want. It should probably be around 800kbit. With the 3.20 version DivX codec you should set the keyframe interval at 9999.
    5. Of course the videoprocessing mode should be set to "full processing mode" Now for the audio. I recommend eighter the 48kbit 48/44,1khz MP3 or the 32kbit 32khz WMA (DivX) codec. MP3 sound a lill better but also is 6kb/s compared to the 4kb/s needed for the WMA (DivX) codec.
    6. If you pick the WMA (DivX) codec you have to convert the 44,1khz or 48khz down to 32khz. You do this under audio -> "conversion" You select the custom for sampling rate and fill in 32000.
    7. No matter if you use the WMA (DivX) codec or the MP3 codec, precision should be at 16bit and channels at mono, also select high quality. (precision ans channels also in the audio -> "conversion" tab)
    8. Next, audio -> "interleaving" I suggest 1000ms or 1500ms (make sure it's at "ms" and not "frames")
    9. Next, audio -> "compression" Eighter MP3 at 48kbit 44,1khz /48khz or the WMA (DivX) codec (DivX ;-) Audio) at 32kbit 32khz.
    10. Also audio should be at "full processing mode" Now you're all set up and ready to convert. In the VirtualDub progress window u can see the data used for video in KB/sec it should END at about 26kb/s with the 4kb/s for the sound with WMA (DivX) codec or at about 24kb/s with the 6kb/s for the MP3 codec to add it all up at 30kb/s.
Big Note! because of the fast motion codec being so sensitive to motion the bitrate can change a lot and often. So when you see 40kb/s after 30minutes of converting don't stop the converting, the movie might just start out with alot of fast motion and there for the bitrate is higher at the start.

Oke now you have the small movie, as you might now normaly an AVI file has to be totally finished (downloading) before you can play it. If you add another sound stream (1 video 2 audio) to the AVI it will behave like a MPG file. When you open the internet address of the file in your Windows Media Player (only tried 6.4) it will start downloading it as fast as it can and it will start playing the file as soon as it has a few seconds in it's buffer. Because Windows Media Player will just continue downloading the file while you're watching it it can increase it's buffer. if the movie starts out with 5min at 20kb/s because it low motion at the start and you are downloading at 30kb/s the next 5 minutes can be at 40kb/s with fast motion because u already downaloaded that part while u were watching the low motion part. Because of this your movie can hold parts with very high bitrate but still you don't have to be able to download at that speed, just aslong as you have enough buffer. If the movie starts with high motion and there for high bitrate you might just wanna pause the movie for a few minutes. the downloading will just continue and your buffer will increase.

Back to the 2 audio streams part. I used to use Graphedit to mux 1 video and 2 audio streams together. But AVImux can do it alot easier. (downloadable from www.digital-digest.com) What u need is a 2nd audio stream and a silent one ofcourse. The 2nd sound stream doesn't have to be just as long as the movie is but just a fes seconds. So i made a little 3 seconds silance compressed wav file, only 6kb.

Just open AVImux, click "Open AVI" and select your AVI. At "first audio stream" you click browse and select the small wav file. (the 2nd audio stream already is in the AVI) You type in output AVI name and click GO! DONE! the AVI you just made is streamable like MPG that means you can download it half and take a look at it and you can put it onto a server and stream it over the internet!

About Digital Digest | Help | Privacy | Submissions | Sitemap

© Copyright 1999-2011 Digital Digest. Duplication of links or content is strictly prohibited.