3.9

3.9 | 60 ratings Rate this file 479 downloads (last 30 days) File Size: 867.88 KB File ID: #309

mpgwrite

by David Foti

 

05 Apr 1999 (Updated 07 Jan 2010)

Code covered by the BSD License  

The MPEG converter takes a MATLAB movie matrix and writes the movie to disk as an MPEG file.

Download Now | Watch this File

File Information
Description

MPEG is an ISO standard movie encoding format. The MPEG converter for MATLAB takes a MATLAB movie matrix and writes the movie to disk as an MPEG file with file extension '.mpg' (MPGWRITE). It also takes an MPEG file and converts it into a MATLAB movie matrix (MPGREAD).

Acknowledgements
This submission has inspired the following:
Movie Editor
MATLAB release MATLAB 6.0 (R12)
Zip File Content  
Other Files
license.txt,
mpgwrite.dll,
mpgwrite.doc,
mpgwrite.m,
mpgwrite.mex4,
mpgwrite.mexaxp,
mpgwrite.mexglx,
mpgwrite.mexhp7,
mpgwrite.mexhpux,
mpgwrite.mexlx,
mpgwrite.mexrs6,
mpgwrite.mexsg,
mpgwrite.mexsg64,
mpgwrite.mexsol,
README,
src/all.h,
src/ansi.h,
src/bframe.c,
src/bitio.c,
src/bitio.h,
src/block.c,
src/bsearch.c,
src/byteord.h,
src/combine.h,
src/dct.h,
src/frame.c,
src/frame.h,
src/frames.h,
src/fsize.c,
src/fsize.h,
src/general.h,
src/huff.c,
src/huff.h,
src/iframe.c,
src/jrevdct.c,
src/makedll.m,
src/Makefile,
src/mfwddct.c,
src/mheaders.c,
src/mheaders.h,
src/mpeg.c,
src/mpeg.h,
src/mpgwrite.c,
src/mpgwrite.csf,
src/mpgwrite.doc,
src/mpgwrite.pdb,
src/mtypes.h,
src/parallel.h,
src/param.h,
src/pbm.h,
src/pbmplus.h,
src/pframe.c,
src/pgm.h,
src/pnm.h,
src/postdct.c,
src/postdct.h,
src/ppm.h,
src/prototyp.h,
src/psearch.c,
src/rast.h,
src/readfram.h,
src/rgbtoycc.h,
src/search.h,
src/subsampl.c
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (82)
20 Feb 2002

doesn't work with matlab 6.0 / linux

matlab segfaults some time after the
mpg is written- this looks like a mex
error rather than a mpgwrite error

13 Jan 2003 Matt Wilson

It compiles into a stand-alone application and runs fine (Windows 98, R12, Borland compiler). I didn't manage to get movie2avi to run in stand-alone mode, so am using this instead. The only minor thing is that the output video seems to flicker just at the start, so it is best suited to animations more than a few frames long. Thanks.

19 Mar 2003 Richard Samms

Ugh! This didn't work, but I suspect it's my combination of MatLab 5.3 over VC++ 6.0 that's the problem... Wish I knew more about mexfiles. Especially debugging them... I think I've something to practice on.

28 Mar 2003 David Adams

Worked great for me with little effort. Windows XP, MATLAB 5.3, VC++ compliler

10 Sep 2003 Jan Horacek

Fortunatelly no mex needed since the mpgwrite.m worked itself on Matlab 6.5, linux.
Compared to the only available movie2avi.m the mpeg
is 100x smaller file which is great!

19 Sep 2003 ©P §Ó©¾  
06 Nov 2003 Javier Pedrera

I have a problem. i can´t execute the makeddll because bitio.c has errors. Please, i need a solution.

12 Nov 2003 Håvard Berland

Crashed on R13 (segmentation violation).

19 Dec 2003 vinaya gohokar

I have a problem. i can´t execute the makeddll because bitio.c has errors. Please, i need a solution.

06 Jan 2004 Bob Bob

Crashed on R13 (segmentation violation).

28 Jan 2004 Crai Aarseth

I had the same problem as vinaya gohokar. I found that adding #include <time.h> to the other includes in bitio.c allowed me to compile.

09 Feb 2004 susanne menden

Haven't been able to use this.
A line or two on how to get it to work would be much appreciated.
Unfortunately, matlab just crashes so I can't be specific about what is wrong.

12 Mar 2004 Ross McKerracher

Using Redhat Linux 8
Resulting mpg file is ~100x smaller than avifile that movie2avi makes.

However, matlab crashes soon after I've run it once in a matlab session.

Have tried recompiling - still get the same problem.

Has anyone else worked out how to fix this problem?

26 Jul 2004 Jim Price

Worked great, first time, with a huge compression compared with avi (x 1/100) and very good image quality. The documentation seems complex compared to what I did; mpgwrite(M, colormap, 'moviename.mpg'), i.e., I used no options and got fine results. Thanks!!!

14 Sep 2004 Niels Kjaergaard

A really nice alternative to movie2avi!!!

21 Oct 2004 Justin Lacombe

It works like a dream. I have yet to figure out how to change the frame rate but I will look into the code for that.

05 Nov 2004 Edward Grace

Excellent work! Is there a way to modify the frame rate and indicate it should be looped? That would be very handy.

17 Jan 2005 Random Guy

Had the same problem as other with bitio.c. It compiles after adding the line #include "time.h" as suggested by Crai Aarseth. Now it works well. Thanks Crai.

It would be nice to be able to change the coding pattern (IBBPBBP...). Editing mpgwrite.c and re-compiling works but is not convenient. Also, it would be nice to have something similar to FORCE_ENCODE_LAST_FRAME, as used by the Berkeley MPEG-1 encoder.

03 May 2005 Dan Russ

We were having Segmentation violations when we ran it (FC4, glibc 2.3.5, OS not officially support by matlab but still runs well). Glibc reports a "double free/corrupted memory". I believe this is cause by closing the mpeg FILE twice. Once in GenMPEGStream and Once in run_encoder. I commented out the fclose() in GenMPEGStream and the Segmentation Violation went away. This may be a new "feature" in glibc/gcc.

30 May 2005 Egemen Kolemen

Perfect!!!

Thanks a lot.

22 Jun 2005 Adam M

I have a problem with compiling dll

Matlab 6.1.0.450 - R12.1

Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
mpgwrite.c:
Error E2219 pbmplus.h 88: Wrong number of arguments in call of macro 'atoi'
Error E2092 pbmplus.h 88: Storage class 'extern' is not allowed here
*** 2 errors in Compile ***
 
  C:\MATLAB\BIN\WIN32\MEX.PL: Error: Compile of 'mpgwrite.c' failed.
 

28 Sep 2005 Anne Staples

It's great--thanks!

18 Oct 2005 Anindya Sarkar

Hi
 I am using mpgwrite to write some frames into a mpg file..say I use aviread command to read a avi file and say I get a movie with 500 frames.. now when I write the 500 frames into a mpg file using mpgwrite, hou can I ensure that the mpgfile will have 500 frames?..I first worked with all the defaults in mpgwrite and I got 496 frame from 500. then to better the picture quality, I changed the Q scale values and also the search range values.. this time I got 430 frames.. The number of frames that I am quoting has been got after reading off the frames from mpg file using mpgread command.. do tell me a method by which I can maintain the same number of frames (obtained using mpgread) even after using the mpgwrite commnad.. basically I am trying to do the avi to mpg conversion without losing out on number of frames in both the original avi AND RECONSTRRUCTED (MPG) FILE.. thanks a lot

02 Dec 2005 kumar pbv

i am using mpgread().i was downloaded that tools .but i am doubted abt where i want to place.

07 Dec 2005 Anas Orwani

I was able to make the DLL for the mpgread, but not for mpgwrite.
When I run makedll, it is giving this error:
Any Help?

Error bitio.c: 112 syntax error; found `IOtime' expecting `;'
Warning bitio.c: 308 Statement has no effect
Error bitio.c: 308 syntax error; found `tempTimeStart' expecting `;'
Error bitio.c: 308 undeclared identifier `tempTimeStart'
Error bitio.c: 308 undeclared identifier `tempTimeEnd'
Warning bitio.c: 308 Statement has no effect
Warning bitio.c: 506 Statement has no effect
Error bitio.c: 506 syntax error; found `tempTimeStart' expecting `;'
Error bitio.c: 506 undeclared identifier `tempTimeStart'
Error bitio.c: 506 undeclared identifier `tempTimeEnd'
Warning bitio.c: 506 Statement has no effect
7 errors, 4 warnings
 
  C:\MATLAB7\BIN\WIN32\MEX.PL: Error: Compile of 'bitio.c' failed.
 
??? Error using ==> mex
Unable to complete successfully

Error in ==> makedll at 3
mex -DWIN32 mpgwrite.c mfwddct.c postdct.c huff.c bitio.c mheaders.c iframe.c ...

05 Jan 2006 Mark Ebden

Following the readme file, I could not get this to work on Matlab 7 with Windows XP.

"Error bitio.c: 112" etc.

25 Mar 2006 Benjamin Sanderse

forget about the readme (windows users). just put the files in a folder (e.g. c:/matlab/mpeg) and include the folder in the path of matlab by using addpath c:/matlab/mpeg.

26 Apr 2006 olivier PROT

Work well on matlab6.5 linux. Easy to compile the mex file. Thanks a lot !

05 Jul 2006 m amar nath

amar

11 Jul 2006 Mike McDonald

Thanks Benjamin for the 'addpath' advice. With that bit of help, this file worked just as I hoped in MATLAB 7, R14 on a Windows PC. Compression is greater than 100x compared to the movie2avi built-in function in MATLAB.

11 Aug 2006 Ryan Clary

cannot compile on mac osx; output of make command is:
mex mpgwrite.c mfwddct.c \
        postdct.c huff.c bitio.c mheaders.c iframe.c \
        pframe.c bframe.c psearch.c bsearch.c block.c \
        mpeg.c subsampl.c jrevdct.c frame.c fsize.c
This is pdfeTeX, Version 3.141592-1.20a-2.2 (Web2C 7.5.3)
kpathsea: Running mktexfmt mex.fmt
fmtutil: no info for format `mex'.
I can't find the format file `mex.fmt'!
make: *** [mpgread] Error 1

Can anyone help?

24 Aug 2006 hector rodriguez

 Good

06 Sep 2006 Gianluca Antonelli

really excellent. someone did modify the frame rate? if so please send me an e-mail.

08 Sep 2006 Richard Garner

Excellent. Worked first time with no problems and little effort. I had run into problems when using Matlab's built-in movie2avi. The resulting AVI would not run on many computers that was not the original computer on which the AVI had been created. Did not have this problem with the MPG file created using this routine.

12 Sep 2006 Skip Albertson

It would be excellent if you could modify mpgwrite and give us control over the number of frames per second (fps) as with movie2avi; nice job!

22 Sep 2006 viet la

Excellent. I have to compile a stand-alone application but the Matlab's function movie2avi can not be complied. Now I am very happy because the function mpgwrite has been compiled and run well. Thank the author for his function. However, could anyone modify the function to control the frame rate.

28 Sep 2006 Dragana Veljkovic

I had problems with movie2avi function, movies wouldn't look right from media player and wouldn't play in power point presentations. The mpeg movies solved my problem. More detailed manual on configuring the encoder would be nice, I would prefer a higher quality videos. Thanks!

18 Oct 2006 João Eyder Queiroz de Figueirêdo  
26 Oct 2006 Axel Tidemann

The file does as it says, but it would be nice to be able to control the fps. Even though this isn't supported in MPEG movies (supposedly its always 30fps), I guess it would be trivial to support this feature, i.e. multiply the same frame for 30/desiredFPS times to achieve the desired framerate. However, I'm no C programmer and don't want to spend time doing it.

A few hints on how to compile would be nice. I see others have had the same problem, so I'll share how I managed to compile it under Mac OS X 10.4.8 running on an Intel Mac Pro.

1) First, you must change file pbmplus.h, at line 101 change <malloc.h> to <malloc/malloc.h>

2) Locate where you mex compiler is. In my case it is /Applications/MATLAB73/bin/mex. The full path must be written in the Makefile, i.e. it says simply "mex" on line 8, however it must be the full path to the mex compiler (as written above).

3) Type make at the command line (not in MatLab) - of course you must be in the src/ directory to do this.

4) Enjoy your .mex*-file!

Hope this helps.

08 Jan 2007 Zhijun Wang

Very Good

25 Feb 2007 Kody Law

Hi everyone,

This is quite an intriguing program and would be an excellent addition in a sort of somewhat user freindly format. Unfortunately for me, I fear I will never be able to enjoy as you all, lest I can get to the bottom of these errors... First, I get :
  
/tmp/ccTKCGGm.s:149: Internal error, aborting at ../../gas/config/tc-i386.c line 3500 in output_imm
Please report this bug.
 
    mex: compile of 'mpgwrite.c' failed.

Then, I uncomment the lines

MCC = CC=gcc
MCFLAGS = CFLAGS=-ansi

And now I get merely :
 
make: *** [mpgread] Error 1
  mex: compile of 'mpgwrite.c' failed.

Any advice on this would truly make my day.
Many thanks in advance for any input !

25 Feb 2007 Kody Law

I am running version 7.1.0.183 (R14) Service Pack 3. Perhaps this is part of the problem...

14 Mar 2007 Richard van Rijn

Works fine with Matlab R14SP3. I go with all the requests for framerate control though.

@ Kody Law
In the Makefile you have to change the word mex on the into were the Matlab mex is on your system. Then it works (at least it did for me). My makefile now has
/sware/com/matlab_r14sp3/bin/mex instead of mex.

10 May 2007 David Young

I couldn't get this to work with 2007a under Windows XP. With my mex setup switched to the Lcc compiler, the link failed because the function write() couldn't be found. When I switched to a Microsoft compiler, the mex file was generated without errors. However, when I call mpgwrite, I get a segmentation violation error. I can give details if anyone can try to fix this. A shame, as it sounds useful.

17 May 2007 Scott B.

Great work, thanks.

22 May 2007 Ryan Molecke

Can anyone tell me how to compile this under windows xp? Do I need a special "lcc for windows" comiler or something? I downloaded and placed all files under the matlab path, but it seems to want it under your working dir to even find mpgwrite.m, and then says mpgwrite() is an undefined funct...

13 Jun 2007 manoj v

Works fine in R2007a. Just don't recompile. Add the dll to your Matlab search path and use as described in the documentation

17 Jun 2007 Geoff Mercer

Worked 'straight out of the box' for 2006a
under XP. no compilation just copy the files to where MATLAB can see them. Great program! A bit slow on really big jobs at high resolution. very tunable parameters and adequate help/doc.

Great stuff! thanks!

28 Jun 2007 Francisco Gordillo  
11 Jul 2007 vivek dudhabale  
11 Jul 2007 Lance Locey

I cannot run this on a Windows XP64 bit platform. When I try to compile the source code, based on makedll.m, the .mexw64 file that I get only creates the first dozen frames or so and then the mpeg file hangs. If I change the makedll.m file from "mex -DWIN32 mpgwrite.c ... " to
"mex -DWIN64 mpgwrite.c ... "
I get an unresolved symbol htonl referenced in function Bitio_Flush

Any ideas?

31 Jul 2007 Ala Trusina  
05 Sep 2007 Jessica Tan

It is good. However, seems it puts the whole movie matrix to mpg file and cannot do it frame by frame.

25 Sep 2007 George W

rock

02 Oct 2007 Corinne B.

i try to run it, but it does not work.. i changed the mex to the directory where my mexfile is, but when i run it i get the error:Invalid MEX-file '/opt/matlab/extern/src/mpgwrite/mpgwrite.mexglx': libmatlb.so: cannot open shared object file: No such file or directory.

What am I doing wrong?

17 Oct 2007 Axel Tidemann

(This is posted again, because of the Mathworks formatting stripped away the number sign in my previous post.)

The file does as it says, but it would be nice to be able to control the fps. Even though this isn't supported in MPEG movies (supposedly its always 30fps), I guess it would be trivial to support this feature, i.e. multiply the same frame for 30/desiredFPS times to achieve the desired framerate. However, I'm no C programmer and don't want to spend time doing it. A few hints on how to compile would be nice. I see others have had the same problem, so I'll share how I managed to compile it under Mac OS X 10.4.8 running on an Intel Mac Pro. 1) First, you must change file pbmplus.h, at line 101 change to

include <malloc/malloc.h>

Remember to put the number sign (i.e. the hash key on your phone) before the include statement.

2) Locate where you mex compiler is. In my case it is /Applications/MATLAB73/bin/mex. The full path must be written in the Makefile, i.e. it says simply "mex" on line 8, however it must be the full path to the mex compiler (as written above). 3) Type make at the command line (not in MatLab) - of course you must be in the src/ directory to do this. 4) Enjoy your .mex*-file! Hope this helps.

19 Nov 2007 Mimi Szeto

I'm very confused.
The mpgwrite.m file is just script. How do I "install" what I unzipped?

21 Nov 2007 Mimi Szeto

nevermind, i read the previous reviews.
works fine!

12 Dec 2007 Alison Chaiken

Works great. Installation instructions are clear. Thanks!

17 Dec 2007 Vihang Patil

Can you tell me how I could change the FPS (frame per second) value? And yes a very nice function indeed

04 Jan 2008 JK LEE

doesn't work on the Windows Vista64 bit platform? any idea?

20 Jan 2008 Eck Lesi

the "bitio.c" file in mpgwrite doesn't seem to work properly. If I run makedll.m in MATLAB, I get the following error message:

>> makedll

Error bitio.c: 112 syntax error; found `IOtime' expecting `;'
Warning bitio.c: 308 Statement has no effect
Error bitio.c: 308 syntax error; found `tempTimeStart' expecting `;'
Error bitio.c: 308 undeclared identifier `tempTimeStart'
Error bitio.c: 308 undeclared identifier `tempTimeEnd'
Warning bitio.c: 308 Statement has no effect
Warning bitio.c: 506 Statement has no effect
Error bitio.c: 506 syntax error; found `tempTimeStart' expecting `;'
Error bitio.c: 506 undeclared identifier `tempTimeStart'
Error bitio.c: 506 undeclared identifier `tempTimeEnd'
Warning bitio.c: 506 Statement has no effect
7 errors, 4 warnings
 
  C:\MATLAB7\BIN\WIN32\MEX.PL: Error: Compile of 'bitio.c' failed.
 
??? Error using ==> mex
Unable to complete successfully

Error in ==> makedll at 3
mex -DWIN32 mpgwrite.c mfwddct.c postdct.c huff.c bitio.c mheaders.c iframe.c ...

is there a way to repair it? Thanks!

29 Feb 2008 Peter Frazier

I had to make one edit to pbmplus.h, removing the inclusion of malloc.h, in order to get it to compile on Mac OS, Leopard, but other than that it installed very easily, and it works great.

28 Jun 2008 Dan Barker

I am experiencing the same issue as Eck. Has anybody managed to overcome this?

FYI I am using MATLAB version 7.1.0246 on Windows Vista Business (32bit)

28 Jun 2008 Dan Barker

Please disregard my last comment, there is no need to compile it. Just add the source code to the MATLAB path then you can use mpgwrite() as you wish :)

07 Jul 2008 pcwzdlra pcwzdlra

 [URL=http://mesiscti.com]haxxclvn[/URL] <a href="http://ovuvfutk.com"&gt;lfbwgfcy&lt;/a&gt; axmytihl http://wthqmkjb.com ccibvykk cmnewwia

09 Jul 2008 hyperalimentosis hyperalimentosis

http://www.skope.ox.ac.uk/PublicationAbstract.asp?PublicationID=156 hyperalimentosis illuminating orogenesis
http://www.cvs.saude.sp.gov.br/com_ler.asp?gt_codigo=&cm_codigo=911 convenient eulogistic menarche
http://www.skope.ox.ac.uk/PublicationAbstract.asp?PublicationID=155 exclusion archaeopteryx malamide

06 Aug 2008 Mohammad Hafezi

I haven't been able to compile it on my MAC OS X Leopard. I have followed instructions by Axel for MAC user but I get this error:

    mex: link of 'mpgwrite.mexmaci' failed.

make: *** [mpgwrite] Error 1

Could somebody send me a complied version? Thanks.

10 Nov 2008 Mary Manning

I haven't been able to compile it for R2008a on a linux machine -- I can't use it right out of the box because I get a library linking error, and when I compile it myself and run mpgwrite in MATLAB I get a seg fault with the following note, " *** glibc detected *** /usr/local/matlab-R2008a/bin/glnx86/MATLAB: double free or corruption (!prev): "
Anybody get this to work with R2008a on a linux?

06 Feb 2009 Keith

Add MPG directory to myToolBox. Add to path with subdirectory. Windows only needs the dll. The sample file plox needs a fixed axis in addition to equal to keep images at same dimensions. Working fine with 2008b with these minor tweaks.

26 Feb 2009 ill will

Is there anyway to increase the speed of the movie playback (i.e. change the fps)?

24 Mar 2009 DanF211  
27 May 2009 Tristan Desrues

My bad, I think it crashed because i left an empty frame

23 Jun 2009 Carrie Weidner

this would be my goto function for making movies in matlab if the quality were better, plus i would like to be able to control the framerate

22 Jul 2009 Mercer

Hello,

I am new with programming and Matlab. I have created a movie in matlab (using the movie command), and it runs fine, but I'd like to put it into mpeg format. I've downloaded the mpgwrite program, but have no idea how to compile it so that I can run it and convert my movie. All help is appreciated, thanks.

22 Jul 2009 Babita Ubhoo

where can i get .avi files.
I have been looking but all those .avi files are not working.

20 Nov 2009 Josh Inya

Dear Mercer,

Im a new user too and wanted to write out how to use this mpg add on. Im using Matlab 7.7 2008b. in Windows XP.
1. download the .zip file with all the .dll and the .m file and the readme and what not
2. extract this to the same directory as where your m-files are saved to. for me this is: C:/ ... my documents/matlab
I just dropped all the files in there.
3. I opened the .m file from matlab. File->open-> mpgwrite.m
4. in the command window I just Ran: >>mpgwrite(F,jet,'movie.mpg');
Where, F is my matrix movie file created already, you should have this already if you see a movie playing. jet is just this Red green blue setting thing that works well, and movie.mpg is the file name of the output movie that is saved to: C:/program files/MATLAB/r2008b/movie.mpg

Hope this helps!

30 Nov 2009 Dean

Anyone that wishes to help, I am having trouble compiling (via makedll.m) the source code. I am attempting to do this on a Windows Server 2003 R2 64-bit computer running Matlab 2009a 64-bit and using the Visual Studio 2008 Express and Microsoft Platform SDK R2 as the compiler. Can the source code as written be used to create a 64-bit mex-file version of mpgwrite? If not, are there any mpeg creating functions that can run on 64-bit windows?

Hope someone can help me! Thanks so much in advance!

22 Jan 2010 Cassandra

Thank you for creating this fantastic tool, David!

I also had trouble compiling at first. I am running Windows 7, 64 bit, R2009b. The included .dll files did not work for me.

To compile, I first made sure my 64 bit C++ compiler was operational. To do this with Visual Studio and SDK, I recommend the following website:
http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/

Second, I compiled the files in the src folder in matlab, modifying the provided command to be mex -v (etc)

Thank you again, David, and good luck to everyone else.

18 Feb 2010 Anas A.

@Cassandra (22nd Jan 2010): Yes indeed. Had the same problem - wont compile on Win7 64bit MatlabR2009b Visual Studio Compiler 64 bit.
Simply added -v so it looks like this:
mex -v -DWIN32 (the rest as indicated) and it compiled :)!!!
the exclamation marks are because -v is simply meant to dispaly the compilation process and hence it shouldnt really be the problem solver!!

Good luck for all the 64 bit guys (P.S. seems no need to change -DWIN32 to -DWIN64)

02 Mar 2010 Matthew Toohey

On a x86_64-suse-linux box...

was finally able to compile (Axel Tidemann's comment above helped the most), and the function works, although Matlab crashes as the function completes. I find the quality of the video to be quite poor.

This would be an excellent function with 1. some detailed installation instructions, 2. control of the compression/quality and 3. control of the fps.

05 Mar 2010 Adam Hartshorne

Using Windows 7, Matlab 7.9.0 and Visual Studio 2008, manage to get compiled using -v hack, although end of compile get strange error,

??? Attempt to reference field of non-structure array.

but file gets made.

Try test run as follows,

fig1 = figure(1) ;
movegui(fig1) ;
winsize = get(fig1,'Position');
numframes=16;
A=moviein(numframes,fig1,winsize);
set(gca,'NextPlot','replacechildren')
 axis equal % fix the axes
 for i=1:numframes
   plot(fft(eye(i+16)));
   A(:,i)=getframe;
end

mpgwrite(A,jet,'movie.mpg');

and I get following error,

??? Error using ==> mpgwrite
All movie frames must have the same size

Any ideas?

Please login to add a comment or rating.
Updates
20 May 2002

Update MPGWRITE for MATLAB 6.0. Changed a call to mxGetPr to mxGetData. Recompiled binaries for platforms that are supported for MATLAB 6.0. This will allow the MEX-file to run in IBMRS now.

23 May 2002

Include the rest of the original source with the archive, in addition to the update.

24 Jul 2009

Updated description and copyright

07 Jan 2010

Updated license/copyright information.

Tag Activity for this File
Tag Applied By Date/Time
graphics import David Foti 22 Oct 2008 06:36:05
graphics export David Foti 22 Oct 2008 06:36:05
mpeg David Foti 22 Oct 2008 06:36:05
convert David Foti 22 Oct 2008 06:36:05
import David Foti 22 Oct 2008 06:36:05
utilities David Foti 22 Oct 2008 06:36:05
export David Foti 22 Oct 2008 06:36:05
movie David Foti 22 Oct 2008 06:36:05
movie Georg 30 Dec 2008 08:49:02
 

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