Sunday, February 28, 2010

Using AviStack to Create a Lunar Landscape - Part 1

Introduction

In the February 2010 issue of "Sky and Telescope" Sean Walker reviews the freeware program AviStack (by Michael Theusner) in his article entitled "Lunar Landscapes with AviStack".  Since I was just getting started with some lunar imaging of my own I decided to give AviStack a try.

When an astronomer looks at an object through a telescope, they are looking through a thick layer of atmosphere.  There are constant fluctuations of density in that atmosphere (from wind turbulance, rising heated air, etc), each eddy of which acts like a lens to blur, distort - and occasionally sharpen - the image that the astronomer (or camera) sees through the telescope. AviStack (and a similar product called RegiStack) are products that attempt to process streams of video images (or sequences of still images) in order to remove or compensate for the detrimental effects of "bad seeing", and to exploit those few images where, by luck, the focus has been sharpened either across the entire image or in regions of the image.  

Installing the AviStack Software

The software install sequence was the following:
  1. Go to the AviStack Homepage, where you can download and install AviStack Version 1.81 (29 January 2010).  I downloaded the Windows Stand-Alone version.
  2. AviStack reads input video in ".avi" format (naturally!), and uses a couple of software library modules called KRSgrAVI.dll and KRSgrAVI.dlm (written by Ronn Kling of Kilvarock) to find and make the AVI codecs that you already have installed on the computer available to AviStack.  However, this library needs to be downloaded separately from AviStack and the .zip file containing it is found here.  Unzip the file and copy the KRSgrAVI.dll and KRSgrAVI.dlm files into the AviStack program directory.
  3. AviStack should now run, and it did for me.
Making .avi Files for AviStack from Canon T1i .mov Files
    The next step is to provide an input video file for AviStack to work on.  For me, this proved to be a lot harder than expected.

    The input video I decided to use for this test was High-Definition 1280x720 @ 30 fps Video created by the HD video mode of the Canon EOS Rebel T1i DSLR.  This video is in the Quicktime .mov format.  The AviStack page says that if you install the AviSynth Frame Server then the KRSgrAVI.dll will ensure that most .mov and .mpeg files will be read into AviStack correctly.  Unfortunately, this did not work for me. Instead, the .mov files were misread as 1136x366 8-bit RGB of codec *MOV and looked like this:

     

    If you look closely you can see that the movies generated an IDL  "Unspecified Error" (Idl.mpg.avs, line 1)., so it seems that something has gone wrong.  Presumably I could learn IDL and sort things out; however, I didn't feel like doing it at that moment.  So on to plan B.

    Since AviStack was having trouble reading in my Canon T1i .mov files, I decided to see if I could give it an .avi instead.  After all, that is what it was made to accept!  Unfortunately, the rudimentary program that shipped with my Canon camera (ZoomBrowser EX/ImageBrowser) - in addition to being basically pointless in every other way - did not provide a format conversion capability.  Fortunately (or so it seemed), a quick google suggested that there were many free (and cheap) video format converters to turn a .mov into a .avi file.

    First up was "Convert MOV to AVI". What could be simpler?  Unfortunately, none of the .avi files that it created  from my Canon .mov videos were  readable by AviStack.  I tried MPEG4, Xvid, and DivX,  (as well as trying out the NTSC DVD and VCD formats, just for fun).  All of these created files were readable by other software, but not AviStack. Turns out that the .mp4, .divx, and .vob extensions are not even seen by the AviStack "Open Movie" dialog, and the xvid codec is not supported.  It was worth a try...

    Next up was Avidemux.  On loading one of my Canon T1i .mov files it immediately warned me that it had detected H.264, and that if the file was using B-frames as a reference that it could lead to a crash or stuttering. Did I want to use that mode, or a different safe mode? It turned out that it did not matter; using either the "unsafe" mode or the "safe" mode it read in the file as Codec 4CC: H264 with a correct image size of 1280x720 @ 30.001 fps.Unfortunately, I could not make Avidemux output .avi files that AviStack would accept.  Maybe it was just me.  Anyway, the codec AviStack wanted just did not seem to be available from the Avidemux...

    To make a long and painful story shorter, after experimenting with a few more programs I found a couple that worked; these programs were not free (I hate it when that happens!) but they were not silly expensive either.

    It turns out that AviStack likes .avi files created with the ancient video codec "Cinepak by Radius" (last updated to the publicly available version 1.10.0.11 in 1995).  I was able to create a source file in this format, which shows up as codec *cvid in the AviStack Open Movie window, using AVS Video Convertor and VideoZilla.  VideoZilla created this format using its .mov to .avi converter by default; I had to go deeper into AVS Video Convertor to create a custom profile to make it work.  (Go to the "Edit Profile" dialog, then to the "Video Codec" pick box to select "Cinepak by Radius".)  The biggest problem with using this very old codec is that it takes a very long time to process a segment of video; for example 722 frames took 17:22 minutes to process.

    As an experiment, I tried doing the same thing with the Intel Indeo Video 4.1 codec.  Success!  This file was also readable by AviStack, with a codec of *IV41.  Again, the conversion took just short of forever: 518 frames in 15:12 minutes.  Next I tried Intel Indeo 5.0 Wavelet codec, which did a bit better: 518 frames in 6:36 minutes.  And it was readable, reporting a codec of *IV50.  I could live with this.  

    So I bought the software from AVS4YOU, $41.35 Cdn for one year access to all of their offerings.

    Using the batch functionality in AVS Video Converter I converted my six test .mov files into .avi, and copied them into a working directory to play with them in AviStack.  Finally, I was ready to get started!

    Next post - AviStack Noob


    No comments:

    Post a Comment