working with IDLtoAVI.dlm [message #36228] |
Thu, 28 August 2003 09:48  |
edwardg
Messages: 5 Registered: August 2003
|
Junior Member |
|
|
Hi all,
I've been trying to read in the frames of an AVI file, do some simple
image processing, and write them into a new AVI file. I downloaded Ronn
Kling's dll which has been great, but now I'm running into problems.
(Specs: IDL 5.4 running under Windows XP).
This:
1. Open AVI for writing
2. Write frames
3. Close AVI for writing
Works wonderfully. However, this:
1. Open AVI1 for writing
2. Open AVI2 for reading
3. Write frames
4. Close AVI2 for reading
5. Close AVI1 for writing
Causes the whole of IDLDE to crash when executing command 5 (closing AVI1
for writing), sans error message. I've tried opening and closing the
AVIs in different orders, but it always crashes when trying to close the
write AVI. The only way it works is if the read AVI is closed before the
write AVI is opened, however that doesn't help me because it's not
feasible for me to read in all frames of the read AVI at once. I need to
read and write frame-by-frame.
Any ideas or workarounds?
Ted
graves@reyes.stanford.edu
|
|
|
Re: working with IDLtoAVI.dlm [message #36309 is a reply to message #36228] |
Thu, 28 August 2003 18:55  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"Edward Graves" wrote in message...
>> After a quick browsing of the source, I think your problem is that you
can't
>> reliably have 2 AVI streams open at once. There are a few global vars
that
>> seem to clash.
>
> That was my assessment also, but it's curious because the IDLtoAVI
> documentation makes a point of mentioning how the file identifiers
> returned by the open routines are unique and allow multiple AVI files to
> be open at once.
Documentation... What's that? :)
Well, maybe I need to look at that code more closely. IDLtoAVI creates a
bunch of global structures and I don't see the mechanism to protect the
contents from subsequent calls from different streams. But it could be
right in front of my nose.
>> What happens when you:
>>
>> Open AVI1 for read
>> Open AVI2 for write (set different dimensions than source)
>> Read AVI1 and display on screen.
>
> This actually works, it is only the close operation that causes the crash.
> Your workaround is doable though. Thanks.
Not an elegant solution but it should keep you busy until someone comes up
with a better one. Hopefully you don't have too many files to process...
-Rick
|
|
|