why do I get "Error using VideoReader/initReader Too many output arguments"

I use it like this:
clear
pathname = uigetdir()
[file,pathname]=uigetfile(pathname);
filename=strcat(pathname,file);
v = VideoReader(filename);
So I am selecting a file that exists, This seems to be independent of the video file I try to read, as a matter of fact it doesn matter if the file exist or not.
I also get the same error when using mmfileinfo

2 件のコメント

Florian Bidaud
Florian Bidaud 2024 年 1 月 24 日
Can you show the value of filename before it is inputted in VideoReader ?
Sure!
%% Select video file
% Initialize variables.
clear
pathname = uigetdir()
[file,pathname]=uigetfile(pathname);
filename=strcat(pathname,file);
disp(filename);
%% read video
v = VideoReader(filename);
The output from this:
>> filename
filename =
'C:\Users\nleoni\Documents\microfluidics\helios\MI1\videos\20230918R2493Unit1038_50s.mp4'
pathname =
'C:\Users\nleoni\Documents\microfluidics\helios\MI1\videos'
C:\Users\nleoni\Documents\microfluidics\helios\MI1\videos\20230918R2493Unit1038_50s.mp4
Error using VideoReader/initReader
Too many output arguments.
Error in audiovideo.internal.IVideoReader (line 136)
initReader(obj, fileName, currentTime);
Error in VideoReader (line 104)
obj@audiovideo.internal.IVideoReader(varargin{:});
Error in videoReaderTest (line 10)
v = VideoReader(filename);

サインインしてコメントする。

 採用された回答

Napoleon Leoni
Napoleon Leoni 2024 年 1 月 25 日
編集済み: Napoleon Leoni 2024 年 1 月 25 日

0 投票

Solved,
Hopefully no one spent to much time on this. There must have been another function with a similar name in the path, not sure but maybe from some older work I had done....
After moving the script to a different directory and narrowing the scope of the path it actually works

その他の回答 (0 件)

製品

リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by