How might I improve (make faster) my video extraction?

9 visualizaciones (últimos 30 días)
Pavlov
Pavlov el 14 de Mayo de 2015
So, I use VideoReader to read in my MP4 (~280MB) video file:
VidObj = VideoReader([pname '\' fname]);
The video format for the particular file I am currently extracting is RGB24.
Here's my code for taking my video object and creating my movie array:
MovArr = nan(ceil(VidObj.Height/space_dsFac),ceil(VidObj.Width/space_dsFac),ceil(nVidFrames/temp_dsFac));
count = 0;
for frame = 1:temp_dsFac:nVidFrames
%imageData = double(read(VidObj,frame));
imageData = uint8(read(VidObj,frame));
%downsample
imageDs = imageData(1:space_dsFac:end,1:space_dsFac:end,1);
count = count+1;
MovArr(:,:,count) = imageDs;
multiWaitbar('Extracting video frames...', frame/nVidFrames);
end
I'm just hoping to learn some tips and tricks for making this faster

Respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by