Error using VideoReader/init (line 607) The filename specified was not found in the MATLAB path. Any ideas how to fix that error?
5 ビュー (過去 30 日間)
古いコメントを表示
Error using VideoReader/init (line 607) The filename specified was not found in the MATLAB path.
0 件のコメント
回答 (1 件)
Walter Roberson
2016 年 9 月 26 日
You passed in a file name that is not the name of any file in your current directory or any directory on the path. In other words, you asked it to read a non-existing file.
4 件のコメント
Walter Roberson
2016 年 9 月 27 日
編集済み: Walter Roberson
2016 年 9 月 27 日
%when you use uigetfile(), the path that is returned might not end in a folder separator. Use fullfile() to be safe.
filename = fullfile(handles.FilePath, handles.FileName);
if ~exist(filename, 'file')
error('Video file "%s" does not exist', filename);
end
try
videoobj = VideoReader(filename);
catch
error('File "%s" cannot be read as a video', filename);
end
img = readFrame(videoobj); %no frame2im !
If you have an old enough version of MATLAB then you will instead need
img = read(videoobj, 1); %no frame2im
参考
カテゴリ
Help Center および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!