matlab中截取视频帧数 10
user_entry=input('Pleaseenteranavifilename:','s');readerobj=VideoReader(user_entry,'t...
user_entry = input('Please enter an avi filename: ','s');
readerobj = VideoReader(user_entry, 'tag', 'myreader1');
vidFrames = read(readerobj);
numFrames = get(readerobj, 'numberOfFrames');
for i=1:1000:numFrames
mov(i).cdata = vidFrames(:,:,:,i);
strtemp=strcat('d:\转换的图片\',int2str(i),'.','jpg');%将每祯转成jpg的图片
imwrite(mov(i).cdata,strtemp,'jpg');
end 展开
readerobj = VideoReader(user_entry, 'tag', 'myreader1');
vidFrames = read(readerobj);
numFrames = get(readerobj, 'numberOfFrames');
for i=1:1000:numFrames
mov(i).cdata = vidFrames(:,:,:,i);
strtemp=strcat('d:\转换的图片\',int2str(i),'.','jpg');%将每祯转成jpg的图片
imwrite(mov(i).cdata,strtemp,'jpg');
end 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询