VideoReader and VideoWriter on Matlab not getting the same framerate

1 回表示 (過去 30 日間)
32sthide
32sthide 2014 年 9 月 25 日
回答済み: 32sthide 2014 年 9 月 25 日
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);

回答 (1 件)

32sthide
32sthide 2014 年 9 月 25 日
Solved with one line.
outputVideo.FrameRate = vid.FrameRate;

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by