Just to spoil all the fun of coding I like to mention that DVD slideshow GUI can do that for you(generate the script).
All you need to do is saving this line as an avisynth script(.avs)
Quote:
DirectShowSource("xxx.divx")
|
and then you can import it into DVD slideshow GUI and that image can be imported too.
Then you can render directly from DSG to various formats or export as Avisynth script for further editing.