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 Comments

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);

Sign in to comment.

 Accepted Answer

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

More Answers (0)

Products

Release

R2022b

Community Treasure Hunt

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

Start Hunting!