Re: working with IDLtoAVI.dlm [message #36219] |
Thu, 28 August 2003 12:12  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"Edward Graves" wrote in message ...
> 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.
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.
What happens when you:
Open AVI1 for read
Open AVI2 for write (set different dimensions than source)
Read AVI1 and display on screen.
I would guess IDL would crash.
Even if it doesn't and I don't know what I am talking about a workaround
would be to write the raw frames into a series of IDL .sav files each one
containing maybe 50 or 100 images. Then process the .sav files and write
the 2nd avi.
-Rick
|
|
|
Re: working with IDLtoAVI.dlm [message #36318 is a reply to message #36219] |
Thu, 28 August 2003 12:59  |
edwardg
Messages: 5 Registered: August 2003
|
Junior Member |
|
|
> 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.
> 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.
Ted
graves@reyes.stanford.edu
|
|
|