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
|
|
|
Re: Need help working with large video file [message #30709 is a reply to message #30546] |
Wed, 08 May 2002 15:32  |
plmcelwee
Messages: 6 Registered: April 2002
|
Junior Member |
|
|
"Kenneth P. Bowman" <kpb@null.com> wrote in message news:<kpb-D80AFB.18472102052002@corp.supernews.com>...
> 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
Sorry for the delay in responding, but I got pulled away on another
task before getting a chance to try your suggestion. I tried it
earlier today, and just so you'll know, it worked perfectly. Thanks
for the help!
|
|
|