Matlab代码加快了我的视频播放速度

时间:2016-05-12 02:40:13

标签: matlab

% Download the videos
backgroundFish = VideoReader('swimmingWithFish.mp4');
backgroundFish.FrameRate = 24;
answer1 = read(backgroundFish);
[backgroundHeight, backgroundWidth, color, backgroundLength] = size(answer1);

% Set the length of the recorded video to the length of the background video
newVideoLength = backgroundLength;
% -----------------------------------------------


// some code

% Open a video file to save the green screen footage to
newVideo = VideoWriter('liveScreen.mp4','MPEG-4');
% the frame rate depends the length of the video and how fast
% it looks like. At 24 frames per second it equals the same length as
% original video but im sped up. As we lower it, the length of the
% video is increased
newVideo.FrameRate = 24;
open(newVideo);
// Sampling of code
writeVideo(newVideo,z);

% Show the rendered photo
image(z);


end

我已经包含了用于创建绿屏的代码。一切都工作正常,除非我播放我的新视频,它看起来好像是原件的快速转发版本。

0 个答案:

没有答案