matlab 读写视频参考code
video_in_obj = VideoReader('input.mp4');
video_ot_obj = VideoWriter('output.mp4', 'MPEG-4');
video_ot_obj.FrameRate = video_in_obj.FrameRate;
video_ot_obj.Quality = 100;
open(video_ot_obj);
% loop processing
while hasFrame(video_in_obj)
% read frame
frame_in = readFrame(video_in_obj);
% processing frame
frame_ot = frame_in;
% write frame
writeVideo(video_ot_obj, frame_ot);
end
% close video
close(video_ot_obj);
网友评论