本人在使用matlab 2009中,使用VideoWriter(和writeVideo)出错。错误信息为:
??? Undefined function or method 'VideoWriter' for input arguments of type
'char'.
Error in ==> Untitled3 at 2
writerObj = VideoWriter('npc.avi');
代码为:
close all;
clear all;
clc;
%% 读视频
vObj = VideoReader('traffic.avi');
nFrames = vObj.NumberOfFrames;
%截取视频片段
myMovie = read(vObj,[1 nFrames-1]);
%% 写视频
%初始化
myVideo = VideoWriter('myfile.avi','Uncompressed AVI');
myVideo.FrameRate = 15;
%写入截取的视频
open(myVideo);
writeVideo(myVideo,myMovie);