VCF2AVS v1.2:
=============

What does this tool do ?
========================
It extracts the SelectRange argument from a
VCF file (Virtual Dub Config File) and
converts it to a AVISynth trim command.

So you can easily edit out the commercials
in your captured AVI(s) using Virtual Dub.

Also nulltransform aka cropping is extracted 
from VCF file if available.

Installation Prerequisites:
===========================
* AVISynth V >= 2.5.X
* VirtualDub 

How to use:
===========
1) Edit/Cut your AVISynth file in VirtualDub
2) Crop unwanted parts of the movie away with nulltransform
3) Save the settings in a VCF file
4) Launch VCF2AVS
5) Browse for your AVISynth file when asked by VCF2AVS
6) Browse for your VCF file when asked by VCF2AVS
7) Open the AVISynth file with your favourite encoding app

Commandline Interface:
======================
For simplicity VCF2AVS features a commandline interface. 
The following switches are supported:
AVS=C:\MyAVSFile.AVS
VCF=C:\MyVCFFile.VCF
FADE=1 -> for enabling fade
FADE=0 -> for disabling fade
FADE-FPS=<The number of frames used for fading>

Examples:
=========
vcf2avs.exe AVS="C:\my_video.avs" VCF="C:\my_video.vcf" FADE=1 FADE-FPS=25
The above commandline adds the "cutting" information stored within the vcf-file to "C:\my_video.avs".
Since fading is enabled (FADE=1) a black in/black out is applied at the beginning resp. the end of the
video. A crossfade (black out followed by black in) is applied to every edited out segment somewhere
between start and end of the video. By specifying the amount of frames to 25 (FADE-FPS=25) this translates
to 1 second fading segments for PAL. A crossfade would thus be 2 seconds long.

vcf2avs.exe AVS="C:\my_video.avs" VCF="C:\my_video.vcf" FADE=1
Same as above but since we have omitted the fading FPS VCF2AVS will automatically define a fading length of one second.

vcf2avs.exe AVS="C:\my_video.avs" VCF="C:\my_video.vcf" FADE=0
Same as the first line but no fading will be applied resulting in a "hard edited" video.

This will add the cutting information stored within the VCF file
at the end of the specified AVISynth file with fading. Any cropping 
information stored in the VCF will also be added to the AVISynth file
but mind you that youll need a tool / script to resize the AVISynth
to a valid resolution prior encoding.  

How does it work ?
==================
It takes this part of a VCF file 
VirtualDub.subset.Clear(); 
VirtualDub.subset.AddRange(688,28923); 
VirtualDub.subset.AddRange(40720,31518); 
VirtualDub.subset.AddRange(75474,58825); 
VirtualDub.subset.AddRange(139121,60731); 

and converts it to this AVS code 
Trim(689,29611)+Trim(40721,72238)+Trim(75475,134299)+Trim(139122,199852) 

For fade in I use the reverse.fadeout2(..).reverse command. This is a
"hack" and not needed with newer versions of AVISynth because there
is a FadeIn command. Ive kept the reverse-stuff because its more 
compatible with older version of AVISynth. 
Thanks to Michael for pointing out this trick.
