Matlab: 读写视频

2020-11-03  本文已影响0人  Gavin先生

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);
上一篇下一篇

猜你喜欢

热点阅读