Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Converting matlab movies to mpeg

Subject: Converting matlab movies to mpeg

From: Chris

Date: 30 Jan, 2009 19:38:01

Message: 1 of 3

I would like to convert a matlab movie to mpeg using the mpgwrite command. When I use the code:

n = 100; data = 1:n;
   for i = 1:n
   bar(data(i)); ylim([0,n]);
   F(i) = getframe(gcf);


the variable 'F' is a structural variable, not a matrix. The mpgwrite function will not accept structural variables. What am I doing wrong?

Subject: Converting matlab movies to mpeg

From: Bryant Svedin

Date: 27 Jul, 2009 19:48:03

Message: 2 of 3

I am getting the exact same problem. Does the movie need to be an avi file that Matlab made? Because the instructions with mpgwrite says a matlab movie, and I got that using getframe which gives a struct file. Anyone?

Subject: Converting matlab movies to mpeg

From: Bryant Svedin

Date: 28 Jul, 2009 18:28:01

Message: 3 of 3

So I found out what my problem is, and you probably have the same problem. I am running the 64 bit version of Matlab. In the 64 bit you need to have a C compiler on your computer to open a .dll file in matlab. In the 32 bit version it will do it no problem. I tried doing the exact same thing on another computer running 32 bit and it worked perfectly fine. Unfortunately my 32 bit computer is much slower, so I have the 64 bit create the matlab video file and the 32 bit convert it to mpg using mpgwrite.

Hope that helps.

Tags for this Thread

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.

Contact us