From: kaoutar on
hello,
I tried to import avi-files from a folder, using the following code
addpath(genpath('C:\Desktop\Thesis_Code'));
bending=dir('bend');
no_files_bend = size(bending,1);
for i=3:no_files_bend
bend =bending(i).name;
Vid = mmreader('bend')
for j=1:length(Vid)
imwrite(Vid(i).cdata,[num2str(i) '.jpeg']);
end
end

but i got this error message,

??? Error using ==> aviinfo at 85
Unable to open bend.avi for reading.

Error in ==> aviread at 49
info = aviinfo(filename,'Robust');

Does anyone has any idea on how to solve it?
Thank you in advance!!

Kaoutar
From: Walter Roberson on
kaoutar wrote:
> hello,
> I tried to import avi-files from a folder, using the following code
> addpath(genpath('C:\Desktop\Thesis_Code'));
> bending=dir('bend'); no_files_bend = size(bending,1);
> for i=3:no_files_bend
> bend =bending(i).name;
> Vid = mmreader('bend')

Vid = mmread(bend);

with no quotes around bend. 'bend' is a literal string with four characters;
without the quotes it designates the contents of the variable with that name.

> for j=1:length(Vid)
> imwrite(Vid(i).cdata,[num2str(i) '.jpeg']);
> end
> end
>
> but i got this error message,
> ??? Error using ==> aviinfo at 85
> Unable to open bend.avi for reading.
From: Kaoutar on
Walter Roberson <roberson(a)hushmail.com> wrote in message <i3f8lt$4if$1(a)canopus.cc.umanitoba.ca>...
> kaoutar wrote:
> > hello,
> > I tried to import avi-files from a folder, using the following code
> > addpath(genpath('C:\Desktop\Thesis_Code'));
> > bending=dir('bend'); no_files_bend = size(bending,1);
> > for i=3:no_files_bend
> > bend =bending(i).name;
> > Vid = mmreader('bend')
>
> Vid = mmread(bend);
>
> with no quotes around bend. 'bend' is a literal string with four characters;
> without the quotes it designates the contents of the variable with that name.
>
> > for j=1:length(Vid)
> > imwrite(Vid(i).cdata,[num2str(i) '.jpeg']);
> > end
> > end
> >
> > but i got this error message,
> > ??? Error using ==> aviinfo at 85
> > Unable to open bend.avi for reading.

Dear Walter,

Thanks a lot for your reply, I have used the mmread with no quotes around bend, but I am getting another error message which i couldn't solve, it states that:

??? Error using ==> FFGrab
Unable to open file

Error in ==> mmread at 146
FFGrab('build',filename,fmt,double(disableVideo),double(disableAudio),double(trySeeking));

Please let me know if you have any idea on how to solve it...
thank you in advance
From: Kaoutar on
"Kaoutar " <azimane_k(a)hotmail.com> wrote in message <i3go5g$cku$1(a)fred.mathworks.com>...
> Walter Roberson <roberson(a)hushmail.com> wrote in message <i3f8lt$4if$1(a)canopus.cc.umanitoba.ca>...
> > kaoutar wrote:
> > > hello,
> > > I tried to import avi-files from a folder, using the following code
> > > addpath(genpath('C:\Desktop\Thesis_Code'));
> > > bending=dir('bend'); no_files_bend = size(bending,1);
> > > for i=3:no_files_bend
> > > bend =bending(i).name;
> > > Vid = mmreader('bend')
> >
> > Vid = mmread(bend);
> >
> > with no quotes around bend. 'bend' is a literal string with four characters;
> > without the quotes it designates the contents of the variable with that name.
> >
> > > for j=1:length(Vid)
> > > imwrite(Vid(i).cdata,[num2str(i) '.jpeg']);
> > > end
> > > end
> > >
> > > but i got this error message,
> > > ??? Error using ==> aviinfo at 85
> > > Unable to open bend.avi for reading.
>
> Dear Walter,
>
> Thanks a lot for your reply, I have used the mmread with no quotes around bend, but I am getting another error message which i couldn't solve, it states that:
>
> ??? Error using ==> FFGrab
> Unable to open file
>
> Error in ==> mmread at 146
> FFGrab('build',filename,fmt,double(disableVideo),double(disableAudio),double(trySeeking));
>
> Please let me know if you have any idea on how to solve it...
> thank you in advance

Hello Walter,

I could solve the problem, instead of mmread i used aviread and with no quotes.
Thanks a lot !!

Kaoutar