Video to frames converting problem
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I was using code to convert video into frames, i was working but now i am using video recorded by go pro hero 10 so the size of video is high , because of that now that code is not working . if i crop and trim video n reduces the size its working.
what should i do to convert high size video into images
% import the video file
video = VideoReader('test.mp4');
% read the total number of frames
n = video.NumberOfFrames
% reading and writing the frames
for i = 1:n
frames=read(video,i);
%save the frames
imwrite(frames,['images' int2str(i), '.jpg']);
im(i)=image(frames);
end
7 comentarios
Walter Roberson
el 26 de En. de 2022
"crop video below certain level" -- if you are referring to number of frames, then that would be consistent with the fact that NumberOfFrames and NumFrames are unreliable on Windows, and that the (now obsolete) NumberOfFrames was never known properly for variable framerate files until you finished reading the video.
Even for fixed framerate files, you need to take NumberOfFrames was an estimation, as recorded framerates are typically estimates. For example "30 frames per second" is typically NTSC, which is talked about as 29.97 frames per second but is really
format long g
30/1.001
and due to the way that frame rates are implemented as a ratio of two integers, round off typically occurs in the representation...
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!