Home
Video Editing
What's New
Links
Search
Sparky?
Feedback

Or Press the BACK button 

on your browser

AviLab v1.0 for SDV 

 

Click to download AviLab for SDV - FREE

 

Background       

I am currently writing a shareware application that generates synthetic .avi files to use for calibration, codec evaluation, and to provide animated inserts and overlays for home movies. 

The first stage, which is now complete, entailed developing the 'engine', that scales and renders the .avi movie frames, the User Interface, and a dedicated 'player' that allows the movie segment to be previewed, with accurate transport controls.

The next stage will be to add a plug-in interface, and produce a range of plug-ins such as -

  • System Resolution Calibrator
  • Codec Evaluator (and avi-mpg conversion evaluator)
  • Configurable Mood backgrounds for titles (abstract, rain, snow, fireworks, clouds etc.)
  • Route-Map animator
  • 'Old Movie' effects (count-in leader, scratch, dirt, etc.)
  • Screensaver - avi converter
  • etc.

The completed application should be released around Christmas 2001.

 

AviLab for SDV       

A few months ago, I noticed on the Pinnacle StudioDV webboard that users had become aware of undocumented registry entries that allows the physical timing relationship between Editor events and Camcorder (VCR) commands to be adjusted. This is to ensure that the first few seconds of a movie are not lost during the mechanical initialisation of the camcorder transport mechanism. 

These adjustments can also be used to splice together movies made in multiple sections. In order to do this accurately, however, it is also necessary to have knowledge of the Camcorder (VCR) Pause Delay, an adjustment that does not form part of the registry entry.

Those SDV users who migrated from Studio400 may recall similar difficulties with the VCR Record and Pause delay adjustments, and have probably used the Glitch Doctor freeware utility that I produced in 1999.

Realising that AviLab could provide a similar facility for SDV, I decided to prematurely release the current build, especially tailored for SDV users. This contains an embedded animation generator that produces an .avi file suitable for measuring the SDV Record Delay (3), and the camcorder's own Pause Delay. Although AviLab is a commercial venture for me (it has applications beyond the Studio range of products - and I have to make a living), I am making this version free to SDV home enthusiasts.

  • P166 and above
  • 16Mb Ram
  • PCI/AGP Graphics card
  • Win95/98/ME/NT (not tested on Win2k, but should work)

 

The Delay Settings       

When a camcorder is used to videotape real-world action, pressing the 'trigger' will join a new scene onto the previous scene with no visible 'glitch' at the join - the camcorder control logic sees to that. The camcorder does not respond instantly however, and you will no doubt be aware that the first second or two of the new scene does not appear on the tape. Less obvious, but no less the case, is that the last frame of the previous scene (at the new join) is unlikely to be the actual frame you previously paused on.

Whilst this behaviour is acceptable during a real-world 'shoot', it can be disastrous if you use your camcorder as a VCR for video 'assembly editing', such as splicing together multiple segments of a movie with StudioDV.

The Camcorder Pause Delay       

When you press the Pause or Stop button your camcorder, the mechanism continues for a few frames, then 'backs-up' for about one second, and stops. The next time you press the 'go' button, the camcorder 'plays' forwards for a bit (pre-roll), which lets the mechanism synchronise itself with the underlying video frames, then switches instantly to Record when it gets to the frame it thinks you paused on. The frame relationship between the frame you paused on, and the one the camcorder chose to join the new scene to, is called the Pause Delay. This is measured in Frames, and can be either positive or negative since the new scene may start on either side of your original paused frame. 

AviLab for SDV will measure this delay for you, such that you can manually compensate for it when setting up your camcorder, ready for a new section to be added by StudioDV.

The Camcorder Record Delay       

When a command is sent to the camcorder (in VCR mode) to start recording, there is a delay before frames begin to appear on the tape. This is whilst the mechanism initialises itself mechanically, and the 'pre-roll' activity is completed. StudioDV has a delay parameter built into the registry (Record Delay 3), which is designed to compensate for this. It delays the video output until the camcorder physically switches itself into record mode (as described above). Measured in milliseconds (1/1000  sec), this delay should ensure that the first frame appearing on your tape is the first frame of your movie.

AviLab for SDV will measure this delay for you, including any contribution from SDV itself. The value can then be entered into the registry manually, or by using the excellent SDVDelay facility provided by Jos Roijakkers.

Other Delays       

There are two other delays (Record Delay1, and Record Delay2), that need to be set. The first is a delay between SDV starting to search for the first frame of the movie, and the command being sent to the camcorder to place it in Record/Pause mode. The second is between this command being sent, and the camcorder being ready to go.

Providing these delays are long enough to ensure the relevant activities are complete, the values are not critical. It is, however, better to err on the generous (cautious) side when setting these delays, even if it means waiting a few extra seconds before the moviemaking gets underway.

Record Delay 1 can be set to 2 seconds (2000ms). This should be enough

Record Delay 2 needs an estimate from you. With your camcorder in 'camera' mode, look through the viewfinder, and switch from the Lock position to Standby. Estimate the time it takes for the camcorder to be ready to shoot a scene. Add one second to this, and round up to the nearest second. Convert to milliseconds (multiply by 1000), and this should be a safe setting for Record Delay 2.

 

How Does AviLab for SDV Calibration Work?       

AviLab produces special movie clips that contain numerical animations, counting in frames and milliseconds. You need to make two of these clips, each with a contrasting appearance so that the join between them can easily be identified when you view the made movie.

One of the clips is intended to be made directly to your camcorder (in VCR mode) as your first movie section. The second is also made to your camcorder, but joined to the first - as you would with real movie sections. By viewing the frames either side of the join on your camcorder, you can read off directly the values of Pause and Record delay. The full procedure will be described shortly, but first - here is a brief view of AviLab itself -

 

A Brief Look At The AviLab Application       

 

The User Interface       

AviLab is not a full-screen application, but rather a fixed-size dialog window, with all important options and settings available in one single view.

There are 3 steps to making an AviLab movie

  • Step 1 - Enter a new filename and destination, or choose an existing one to be written over. You may also view a movie file here if it exists already, or you have just made one.

  • Step 2 - Choose how you would like your movie to be made - the physical properties of your movie.

  • Step 3 - Make your Movie. You will first be given the opportunity to select the compression method (codec) before the movie is actually created on disk.

The Built-In Viewer       

If you select 'view' in Stage 1, the built-in viewer is opened, using the file in the Filename box. The image size will be automatically adjusted to agree with the file properties.

This shot shows the viewer displaying a frame from Pinnacle's 'A Day In The Park'. Normally, you would be previewing files produced by AviLab, but you can also view any other Video For Windows compatible file like this one.

There are transport controls for Play/Pause, Stop, Begin, End, Frame Forward, and Frame Backward. There is also a progress-bar, which doubles as a rapid transport control.

To the right of the transport controls are digits showing Hrs:Mins:Secs.Millisecs, and a Frame Number counter. You may wonder why a hh:mm:ss:ff format is not available? There is a discussion on this aspect later.

 

AviLab For SDV Calibration Movies       

Here are examples of frames taken from calibration movies made with AviLab. The only difference between them is that various colour schemes have been chosen to make them easily identifiable in use.

The animations are very simple to explain. These comprise -

  • A rotating '1-second pie' image

  • Millisecond Counter (centre)

  • mm:ss:ff Counter (bottom)

  • Auto Frame Corrections (Top Left/Right)

The animations are 'smart' - they automatically scale themselves in font size and position to match the frame size you choose (Large characters have been chosen, so that modest frame-size movies are quite adequate for SDV calibration. 160x120 works well).

 

How To Use AviLab for SDV       

1. Create your calibration clips

You need to use AviLab to create two short calibration clips, that you will treat as two separate movie segments, to be joined together by SDV. Here's how you do it -

  • Launch AviLab

  • In Step 1, click on Browse, and use the standard Windows Dialog Box to choose a path and filename for your first clip. Let's call this Clip1

  • In Step 2, set the Base Frame Rate to your national video standard, all other settings can be left at default values.

  • In Step 3, Click 'Go For It'. You will be asked to choose a codec. Unless space is at a real premium, choose Uncompressed. (Suitable compression alternatives are Indeo5, or Cinepak). Click OK.

  • After the AVI is complete, the file will be on your hard drive, and you may view it with the 'View' button.

  • Now go back to Step 1, and enter a new filename. Let's call this Clip2

  • In Step 2, select 'Negative' in the lower RH corner

  • In Step 3, Click 'Go For It' again to produce a new clip on your hard drive. View it if you want.

You now have two contrasting calibration clips on your hard drive, which will shortly be used with SDV. A variation on this would be to create just one clip, using the 'Colour' option, and a length of say 25 secs. This will produce a movie with 5 changes in background colour, which you can cut to your liking in SDV.

2. Prepare SDV for Calibration       

Using Jos's SDVDelay program, set Record Delay1 to 2000, Record Delay2 to the value you estimated earlier (see above), and Record Delay3 to zero. Alternatively, you can set these in the Windows Registry yourself, remembering to use hex (base16) values, but I recommend you use SDVDelay as it is much more convenient.

3. Using The Calibration Clips in SDV       

I am not going to describe how to use SDV here. I assume you know this.

  • Import Clip1 into SDV, place on Timeline, and make a movie out to your camcorder. You may include a black leader if you like, or if you think the 5 second segment needs it.
  • Delete Clip 1 and Import Clip2 to the timeline. This clip should start with zero milliseconds as the first frame. DO NOT add a black leader to this clip.
  • Position your camcorder somewhere in Clip1, where the frame reads Zero in the top line (The Pie graphic will be a full circle).
  • Make your second movie (Clip2) to the camcorder, over Clip1.

4. Now It Is Time To View The Results       

Search the camcorder footage for the join between Clip1 and Clip2. You should see the two frames, something like this -

 

 

The frame on the left was the last frame of Clip1. The only digit that we are really interested in here is the +7. This tells us that each time we make a movie, we should set the camcorder 7 frames forward from where we want the new section to start.

The frame on the right was the first frame from Clip2. The important digit here is the middle one. This tells us that Record Delay 3 needs to be set to 4,360 milliseconds. Use SDVDelay to adjust this value in the registry.

That is IT. Job Done!

To Download a copy of AviLab for SDV, click here

Questions That Arose During Beta Testing       

Why is the viewer timecode display not in HH:MM:SS:FF format?

If the viewer was only used for AviLab files, then I could have done this. Unfortunately, many people that create .avi files do not use consistent Rate and Scale factors in the .avi file header. This is also aggravated by files that have been captured from video sources that include dropped frame errors. Consequently, all that can be extracted from the headers is the average rate at which the images change, which is not necessarily the same as the video Frame Rate (30, 25, etc). You may recall that the author of VirtualDub had to deal with this problem too, as I have done. In the next (shareware) release of AviLab, I may include the option to choose a format, based on  'assumed',  'predicted', or 'actual'  frame rates. We shall see......

Why is the 'Frame Back' button sometimes slower than 'Frame Forward', and a bit 'jerky'?

This is because some movies use sparsely spaced 'Keyframes'. This is a way of reducing the size of .avi files. A keyframe is a complete frame of data, which may then be followed by several other frames that are just incremental changes to the preceding frame(s), and hence contain reduced data. Large changes in scene content, or after a suitable time period, a new keyframe is created. This is fine when moving progressively forward, but when going backwards the codec has a hard job to keep up because it has to find the previous keyframe, then build the frame you want by scanning forwards again. If you keep your mouse button down on the 'Frame Back' button, you will see this process in action - as you approach a keyframe, the update rate progressively speeds up until you pass it, then it slows down again.

In AviLab, every frame is a keyframe, so this problem does not arise.

Sometimes I get a message that 'The Codec Is Not Producing Data'. Why?

It is possible to set some things up in Step2 that are not supported by your chosen codec. For example the RLE (Run Length Encoded) codec will only work with 8-Bit colour. There are too many combinations here for AviLab to report the actual cause, and I have no idea what codecs you have, so AviLab just reports that no data is being produced. If you stick to Indeo (V5+) and Cinepak, you should have little trouble.

I tried to make a very small frame size movie but did not get what I expected!

Not all codecs allow odd, or very small pixel sizes. Don't ask me which ones!

I agreed to overwrite an existing file, then cancelled the process at the following  codec window. My existing file disappeared off my disk. Why?

So? You didn't want it did you? Actually, I may try to change this in the next version, but it is not at the top of my 'to-do list'.

Acknowledgements       

This program has taken some time to develop, and I would like to thank all those that have taken part in the beta testing phase over the last couple of months. I would particularly like to thank Mike Shaw and Jos Roijakkers  for sticking with me, and for providing encouragement and helpful suggestions. Thanks guys! 

(I know you all think I am mad to have stalled so long getting this thing out on the streets, but I really could not afford the embarrassment, or the time, to embark on a humiliating public bug-fixing activity - I have a whole bunch of new stuff that I want to get started on, and I needed to get this 'one tucked up in bed' first).