PDA

View Full Version : ImageReader question


t_2
24th January 2004, 00:32
Using AviSynth2.53 and Windows2000 I was able to open pictures(000000.bmp,000001.bmp,000002.bmp, etc., with the following script:

ImageReader("V:\reXed\%06d.png",0,2000,25,true)

However, when I used the following script to try to open pictures numbered: 00001.bmp, 000002.bmp, 000003.bmp, etc, the script returned an 1x1 pixel image.

ImageReader("V:\reXed\%06d.png",1,2000,25,true)

In other words, it seems that a zero frame must be present in order for the filter to work. It took quite a while to figure this out, I wonder if this is normal behavior for this function.

t_2

stickboy
24th January 2004, 02:13
That's not normal.

However, I can't seem to get ImageReader working at all anymore... DevIL keeps spitting out error #1290 (IL_COULD_NOT_OPEN_FILE) for me. I know the files are there and that the syntax is right, since ImageReader is correctly determining the frame size.

(I'm using the January 15, 2004 binary.)

Richard Berg
24th January 2004, 07:13
Can you report the last known binary where it worked?

t_2
24th January 2004, 08:03
I can't say right off hand which bianary I am using but if it helps, the file size of the installer is 884kB(905984bits)

t_2

stickboy
24th January 2004, 13:09
Nevermind, I got it working.

AFAICT, ImageReader requires an absolute path; relative paths aren't working at all for me. (If that's correct, it's inconsistent with other input filters (http://forum.doom9.org/showthread.php?s=&postid=429024#post429024).) This seems to have been the behavior since the beginning (2.5.2).

I suppose that ImageReader finds the files correctly (which explains why I get the correct frame size) and that it's DevIL that doesn't like relative paths.

Can this be improved? It ought to be documented more clearly, at least.

And while I'm complaining about ImageReader, better error messages would be much more helpful. If nothing else, it would be nice if the error message included the generated filename corresponding to the current frame. Putting the error string in a MessageClip also might be better.

stickboy
24th January 2004, 13:18
Originally posted by t_2
However, when I used the following script to try to open pictures numbered: 00001.bmp, 000002.bmp, 000003.bmp, etc, the script returned an 1x1 pixel image.I just noticed: Are those the correct filenames? The first one is five digits, but the rest are six. If that's the case, then ImageReader(..., 1, 2000) fails because it can't find the first image, and the first image always must be present.

t_2
24th January 2004, 14:12
@stickboy

Thanks, the mistake is what appears in the post, the files I used were correct -all 6 digits. To get the filter to work, I simply copied frame 000001.bmp and renamed it to 000000.bmp, added it to the other frames, then changed the start paramater from 1 to zero and presto! All 2000 odd frames were there - what a beautiful sight. This filter and it's predecessor CoronaSequence/ImageSequence are life savers! Thanks WarpEnterprises.


One other thing that made me wonder was that when I fed my ImageReader (not CoronaSequence/ImageSequence) aviscript script into VirtualDub (not VirtualDubMod which simply said no frames could be found) it returned the following error (the first part is my own translation as I have a Hungarian version of Windows):

A DLL (corona.dll) was not found for the following path (C:\Program Files\VirtualDub1.57;.;C:\WINNT\system32;C:\WINNT\system;C:\WINNT;C:\WINNT\System32\Wbem;C:\WINNT\system32\nls;C:\WINNT\system32\nls\ENGLISH;Z:.;).

I found myself wondering why VirtualDub would be looking for corona when avisynth is supposed to open the file. Also, looking in the record file which the avisynth installer generates following instalation it seems that besides avisynth.dll the only other filter installed was devil.dll. So corona isn't part of the installation. Evidently the corona code is incorporated into avisynth itself. If corona is built into avisynth, then Avisynth couldn't be asking virtualdub for it, yet why would virtualdub be looking for it since it shouldn't understand aviscript and therefore shouldn't know that the source ultimately consists of individual frames.


By the way, did you notice the same behavior I described in my first post, i.e., 1x1 frames? Thanks again!

t_2

stickboy
24th January 2004, 23:11
The 1x1 frame thing happens when ImageReader can't find the first image. There also should be an error message given in VirtualDub's status bar. I've never seen the Corona problem.

Another possible problem is that your say your filenames are .bmp files, but the script you gave references .png files. :p You really need to post your exact script and the exact filenames instead of typing that stuff from memory.

(Oh, by the way, you can determine your AviSynth version with the Version() command (or by loading version.avs in the Examples directory).)

t_2
24th January 2004, 23:23
Thanks,

AviSynth 2.53 Nov 11th 2003 build