What's the most memory-efficient way of processing a video on MATLAB? -


this tutorial reading video:

    xyloobj = videoreader('xylophone.mpg');      nframes = xyloobj.numberofframes;     vidheight = xyloobj.height;     vidwidth = xyloobj.width;      % preallocate movie structure.     mov(1:nframes) = ...         struct('cdata', zeros(vidheight, vidwidth, 3, 'uint8'),...                'colormap', []);      % read 1 frame @ time.     k = 1 : nframes         mov(k).cdata = read(xyloobj, k);     end      % play movie once @ video's frame rate.     movie(mov, 1, xyloobj.framerate); 

but i'm trying process huge video, , if try above code computer runs out of memory. i've thought reading frames, processing them, reading more, processing, until frames have been processed (of course, deleting old frames code goes, mantain low-level memory comsumption), i'm not sure best way, since i've never processed video matlab.

is there best-practice kind of situation? did miss something?

thanks!

the memory efficient way process video load, process, , write single frame @ time. ever have 1 frame in memory.

that's quite inefficient in terms of disk io, however. technique type of large file process in chunks. in case read, process, , write n frames @ time. need choose n use appropriate amount of memory on system. speaking, larger n faster right until hit memory limit.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -