View Full Version : Avisynth, Virtualdub, and Exporting Image Sequence
hartford
13th July 2008, 04:34
There's something wrong, or I'm just stupid.
I want to make changes to a short sequence of avi frames.
I used avisynth script to do this:
--
avisource("e:\my.avi")
imagewriter("e:\my\pics2",start=0,end=48,type="bmp")
--
When I use VirtualDub to Export this sequence it insists that files will be
in the format: 00000.bmp and ends 00048.bmp.
Then after making changes to the bmp files, I use AviSynth's ImageReader:
--
ImageSource("e:\my\Pics2\%d.bmp",00000,00048,23.976)
--
I get an error that "0.bmp doesn't exist" or some such. To make this work I need to
change the all the bmp files to the format: 0.bmp to 48.bmp.
So, what to do? Changing the filenames has been my only recourse.
Shouldn't there be some "agreement" as to filename convention between these to applications?
45tripp
13th July 2008, 04:58
ImageSource("e:\my\Pics2\%05d.bmp",0 , 48, 23.976)
Gavino
13th July 2008, 12:31
When I use VirtualDub to Export this sequence it insists that files will be
in the format: 00000.bmp and ends 00048.bmp.
...
Shouldn't there be some "agreement" as to filename convention between these t[w]o applications?
VirtualDub is blameless, and plays no part other than being your chosen host for Avisynth. The same thing would happen with WMP, etc.
The two things that need to 'agree' are the filters ImageWriter and ImageReader, both part of Avisynth, and in fact they do with their default settings. The problem comes when you want your images somewhere other than the default location "C:\" (which is most of the time :)). IMHO it would be better to have two separate parameters, folder and 'filename template'.
Are you sure the names aren't 000000.bmp, etc, ie 6 digits? That is the normal format produced by ImageWriter. If so, you would need to use %06d in 45tripp's solution.
Actually,
imagewriter("e:\my\pics2",start=0,end=48,type="bmp")
should have produced files pics2000000.bmp, etc in folder e:\my, so I assume what you posted was not your actual script used.
stickboy
13th July 2008, 20:50
It sounds like hartford actually used the results from VirtualDub's "Export > Image Sequence" (but there's no need to use that and ImageWriter though; pick one).
hartford
15th July 2008, 02:12
@ 45tripp
Thanks!
hartford
15th July 2008, 02:22
@ Gavino
I used exactly this to write the bmp files:
avisource("e:\08-mezzo-17435.avi")
imagewriter("e:\mezzo-120\pics2",start=0,end=48,type="bmp")
I used VDub Export which gave me the 5-digit bmp files. I used VDub version 1.7.7.
I don't understand stickboy's comments.
45tripp
15th July 2008, 03:44
he means you only need one of the 2 assigned to imagewriting.
with vdub you needn't even create an avs script,
just import media, select range, and export to image sequence.
or as an avs import this would suffice:
avisource("e:\my.avi").trim(0,48)
that would be giving you 5 digit filenames.
using avisynth
avisource("e:\my.avi")
imagewriter("e:\my\pics2\",start=0,end=48,type="bmp")
you can open this with anything that decodes,
mpc for example, and as soon as the frames are decoded (2 secs in here) you can close mpc and imagewriter will write the frames to disk for you.
that would be giving you 6 digit filenames.
tripp
Gavino
15th July 2008, 17:10
@hartford. Sorry, I misunderstood your original question. Seeing your script included ImageWriter, I assumed that was how you were generating your images, rather than explicitly exporting in VDub.
At the same time, simply rendering the script should also have caused Avisynth to create at least one file of the form "e:\mezzo-120\pics20000nn.bmp", depending on what frames you previewed within VDub.
So, as stickboy and 45tripp have explained, choose one way or the other, whichever you find more convenient.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.