VideoReader and VideoWriter on Matlab not getting the same framerate

3 vues (au cours des 30 derniers jours)
32sthide
32sthide le 25 Sep 2014
In the original video I get 11 seconds and in the new one 5 seconds. Anyone knows the problem?
outputVideo = VideoWriter('openv_v.avi');
open(outputVideo);
vid = VideoReader('openv.avi');
for idx = 1:vid.NumberOfFrames
img = read(vid, idx);
writeVideo(outputVideo,img);
end
close(outputVideo);

Réponses (1)

32sthide
32sthide le 25 Sep 2014
Solved with one line.
outputVideo.FrameRate = vid.FrameRate;

Community Treasure Hunt

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

Start Hunting!

Translated by