PDA

View Full Version : sprintf, imagereader


smok3
9th October 2008, 21:07
a. if i would want to make an automagic sprintf syntax for imagereader using command line tools (scriptable), what could i use?

b. or is there another (absolute way), say making a long script with all few thousand frames mentioned?

c. can i use a more generic syntax like t:\path\*.png or something?

p.s. i have tried an older plugin called coronasequence, but that can't read png files as it seems...

edit: this
imagereader("file_0000.png",start=0,end=0,fps = 25) + \
imagereader("file_0001.png",start=0,end=0,fps = 25) + \
imagereader("file_0002.png",start=0,end=0,fps = 25)
seems to work as RAM playback :), not what i wanted, but interesting find.

edit2: i got coronasequence working with wildcards (it needed full path, like "t:\path\*.png")
--------------------------
edit3: solution, needs warp enterprise imagesequence plugin,
corona.bat
@echo off
echo coronaSequence(^"%~d1%~p1*%~x1^", sort=1) > corona_%~n1.avs
usage:
corona.bat someframe_0000.png
will return file named corona_someframe_0000.avs with something like:
coronaSequence("t:\path\*.png", sort=1)
--------------------------
edit4: or advanced corona.bat, if you need to be a lil more specific
::corona.bat
@echo off

:: cut off last 4 chars from filename string to be used for
:: wildcard starting part of the string
set somestring=%~n1
set somestring1=%somestring:~0,-4%
echo %somestring1%

:: and cut last5 chars for the new avs filename
set somestring2=%somestring:~0,-5%

echo coronaSequence(^"%~d1%~p1%somestring1%*%~x1^", sort=1) > corona_%somestring2%.avs

echo window will autoclose in 10s...
sleep 10

Sagekilla
10th October 2008, 01:08
Uh, you should be able to do something like: ImageReader("file_%04d.png",start=0,end=1000,fps=25)

%04d will automatically add in the leading zeros so it properly reads in numbers like 0000, 0010, 0100, 1000 etc.. You can use specific file paths, like ImageReader("T:\file_%04d.png",start=0,end=1000,fps=25) Just remember, you need to include the %04d or it won't read it in properly.

smok3
10th October 2008, 08:38
and the other 1299 frames will do what? (the goal is one click script for preview or encode)

edit: the corona wildcard approach is also great (of course) for previewing animations that still render.

Sagekilla
10th October 2008, 20:34
I'm sorry what are you trying to do? I'm reading what you're saying and I can't figure out what you're trying to do.

smok3
10th October 2008, 21:59
it's basically done, the two bat scripts i posted together with corona reader are doing the job (to refraze: the goal was frameserver of individual images without writing a line of avisynth script and without knowing how many frames are in the sequence). now i basically have a 'dynamic' avs script with two clicks.

saying that, hopefully wildcard way of reading frames will get into main distribution soon.