MATLAB视频提取帧的问题
clc;clear;video_file='D:\第二组\1.mpg';video=VideoReader(video_file);frame_number=floor(...
clc;
clear;
video_file='D:\第二组\1.mpg';
video=VideoReader(video_file);
frame_number=floor(video.Duration *video.FrameRate);
j=0
for i=1:frame_number/20:frame_number
j=j+1
image_name=strcat('video',num2str(j));
image_name=strcat(image_name,'.jpg');
I=read(video,i); imwrite(I,image_name,'jpg');
I=[];
end
这段代码提取普通视频的帧没问题,但提取一个有噪声视频的帧就会出现
Error using VideoReader/read (line 145)
The frame index requested is beyond the end of the file.
求教为什么,怎么解决 展开
clear;
video_file='D:\第二组\1.mpg';
video=VideoReader(video_file);
frame_number=floor(video.Duration *video.FrameRate);
j=0
for i=1:frame_number/20:frame_number
j=j+1
image_name=strcat('video',num2str(j));
image_name=strcat(image_name,'.jpg');
I=read(video,i); imwrite(I,image_name,'jpg');
I=[];
end
这段代码提取普通视频的帧没问题,但提取一个有噪声视频的帧就会出现
Error using VideoReader/read (line 145)
The frame index requested is beyond the end of the file.
求教为什么,怎么解决 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询