Re: Need help working with large video file [message #30546] |
Thu, 02 May 2002 16:47  |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <a3589d11.0205021259.69f111b6@posting.google.com>,
plmcelwee@yahoo.com (Phil) wrote:
> I need to process 5000 frames of video through an IDL program. The
> video is in a NetCDF file, and the total size of the file is 650MB.
> Does anyone have any tips on how to effectively work with files this
> large? Essentially right now I read in the entire file, store the
> frame data in a variable, then start my computations. This was
> working nicely with the 130MB video file I was using previously, but
> now I get out-of-memory errors with the larger file.
NetCDF provides random access to any contiguous rectangular chunk of the
data file. Assuming that you can work on a frame at a time, simply read
a frame, process it, and write it back out.
Look at the OFFSET, COUNT, and STRIDE keywords to NCDF_VARGET. To read
frame s which is size nx x ny:
NCDF_VARGET, id, 'Movie', frame, OFFSET = [0,0,s], COUNT = [nx,ny,1]
This assumes that time is the last dimension (IDL convention). Ncdump
uses the C convention, listing the dimensions in the reverse order.
Regards, Ken
|
|
|