Thread Subject: Matlab Movies

Subject: Matlab Movies

From: William Kong

Date: 9 Nov, 2008 20:07:01

Message: 1 of 5

I am using Matlab to make some movies of simulations I am running. There are times when the movie feature works and there are times it doesn't. When I say it doesn't work, I do not mean a movie does not show up. All the plots show up to allow me to do screen captures to create a movie and it looks fine. The problem is that when the movie ends, no movie file is created and saved. In fact, at the end of the movie I get this error message:

??? Failed to open file.
Error in ==> avifile.avifile at 171
  aviobj.FileHandle = avi('open',filename);
Error in ==> movie2avi at 63
avimov = avifile(filename,varargin{:});
Error in ==> SRDMovie at 99
movie2avi(G, 'SRD_movie');

Sometimes I think the complexity (not length) of the simulation determines whether or not a movie file is created. When I simulate a "simple" scenario, everything works great and I get an avi file in the end. When I run something more complex, the movie craps out on me and I get the error message. However, the problem has also come up during simple simulations too. So I actually have no idea what's going wrong. I have also tried messing with the figure window size (I like to use large windows for better resolution), and that sometimes works if I make the window smaller.

Anyone have some suggestions as to what I can do to make this movie stuff work? It feels like this movie function is not able to do screen captures of plots with a lot of information or something.

Subject: Matlab Movies

From: a programmer

Date: 9 Nov, 2008 23:18:01

Message: 2 of 5

"William Kong" <schoolsofthought@gmail.com> wrote in message <gf7ft5$p2s$1@fred.mathworks.com>...
> I am using Matlab to make some movies of simulations I am running. There are times when the movie feature works and there are times it doesn't. When I say it doesn't work, I do not mean a movie does not show up. All the plots show up to allow me to do screen captures to create a movie and it looks fine. The problem is that when the movie ends, no movie file is created and saved. In fact, at the end of the movie I get this error message:
>
> ??? Failed to open file.
> Error in ==> avifile.avifile at 171
> aviobj.FileHandle = avi('open',filename);
> Error in ==> movie2avi at 63
> avimov = avifile(filename,varargin{:});
> Error in ==> SRDMovie at 99
> movie2avi(G, 'SRD_movie');
>
> Sometimes I think the complexity (not length) of the simulation determines whether or not a movie file is created. When I simulate a "simple" scenario, everything works great and I get an avi file in the end. When I run something more complex, the movie craps out on me and I get the error message. However, the problem has also come up during simple simulations too. So I actually have no idea what's going wrong. I have also tried messing with the figure window size (I like to use large windows for better resolution), and that sometimes works if I make the window smaller.
>
> Anyone have some suggestions as to what I can do to make this movie stuff work? It feels like this movie function is not able to do screen captures of plots with a lot of information or something.

Take a look at mpgwrite.dll in the FEX.

Subject: Matlab Movies

From: ill will

Date: 10 Nov, 2008 18:00:19

Message: 3 of 5

"a programmer" <no@spam.com> wrote in message <gf7r39$6mk$1@fred.mathworks.com>...
> "William Kong" <schoolsofthought@gmail.com> wrote in message <gf7ft5$p2s$1@fred.mathworks.com>...
> > I am using Matlab to make some movies of simulations I am running. There are times when the movie feature works and there are times it doesn't. When I say it doesn't work, I do not mean a movie does not show up. All the plots show up to allow me to do screen captures to create a movie and it looks fine. The problem is that when the movie ends, no movie file is created and saved. In fact, at the end of the movie I get this error message:
> >
> > ??? Failed to open file.
> > Error in ==> avifile.avifile at 171
> > aviobj.FileHandle = avi('open',filename);
> > Error in ==> movie2avi at 63
> > avimov = avifile(filename,varargin{:});
> > Error in ==> SRDMovie at 99
> > movie2avi(G, 'SRD_movie');
> >
> > Sometimes I think the complexity (not length) of the simulation determines whether or not a movie file is created. When I simulate a "simple" scenario, everything works great and I get an avi file in the end. When I run something more complex, the movie craps out on me and I get the error message. However, the problem has also come up during simple simulations too. So I actually have no idea what's going wrong. I have also tried messing with the figure window size (I like to use large windows for better resolution), and that sometimes works if I make the window smaller.
> >
> > Anyone have some suggestions as to what I can do to make this movie stuff work? It feels like this movie function is not able to do screen captures of plots with a lot of information or something.
> >
> Take a look at mpgwrite.dll in the FEX.

Could you elaborate more on this? What is FEX?

Thanks

Subject: Matlab Movies

From: Helen Chen

Date: 10 Nov, 2008 18:44:03

Message: 4 of 5

> > >
> > Take a look at mpgwrite.dll in the FEX.
>
> Could you elaborate more on this? What is FEX?
>
FEX is short for File Exchange, which is part of MATLAB Central. Take a look at the files that come up with this File Exchange query: http://www.mathworks.com/matlabcentral/fileexchange/?term=mpgwrite There are also some related files that are reference from those files, so enjoy!

Helen

Subject: Matlab Movies

From: Chris

Date: 30 Jan, 2009 19:40:18

Message: 5 of 5

Make sure you don't have the avi file open in another application (like Media Player). If you do, you will get exactly that message when you try to overwrite the open file.

"William Kong" <schoolsofthought@gmail.com> wrote in message <gf7ft5$p2s$1@fred.mathworks.com>...
> I am using Matlab to make some movies of simulations I am running. There are times when the movie feature works and there are times it doesn't. When I say it doesn't work, I do not mean a movie does not show up. All the plots show up to allow me to do screen captures to create a movie and it looks fine. The problem is that when the movie ends, no movie file is created and saved. In fact, at the end of the movie I get this error message:
>
> ??? Failed to open file.
> Error in ==> avifile.avifile at 171
> aviobj.FileHandle = avi('open',filename);
> Error in ==> movie2avi at 63
> avimov = avifile(filename,varargin{:});
> Error in ==> SRDMovie at 99
> movie2avi(G, 'SRD_movie');
>
> Sometimes I think the complexity (not length) of the simulation determines whether or not a movie file is created. When I simulate a "simple" scenario, everything works great and I get an avi file in the end. When I run something more complex, the movie craps out on me and I get the error message. However, the problem has also come up during simple simulations too. So I actually have no idea what's going wrong. I have also tried messing with the figure window size (I like to use large windows for better resolution), and that sometimes works if I make the window smaller.
>
> Anyone have some suggestions as to what I can do to make this movie stuff work? It feels like this movie function is not able to do screen captures of plots with a lot of information or something.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
avi Helen Chen 10 Nov, 2008 13:45:05
movies Helen Chen 10 Nov, 2008 13:45:05
movie2avi ill will 9 Nov, 2008 15:10:04
avi ill will 9 Nov, 2008 15:10:04
simulation ill will 9 Nov, 2008 15:10:04
getframe ill will 9 Nov, 2008 15:10:04
movie ill will 9 Nov, 2008 15:10:04
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com