Discussion:
Playing avi movies in Powerpoint
(too old to reply)
Justin Atchison
2006-08-18 01:27:28 UTC
Permalink
after going crazy with this problem as well, i finally found that
using windows movie maker to put the file into wmv form was the only
consistent solution. i haven't tested it on older versions of
powerpoint (running 2003), but it seems like it should work as long
as windows media player is there.

best i can do.
Russell Wyeth
2007-01-12 15:29:54 UTC
Permalink
I've spent some time with this too now.

I start with an uncompressed AVI.
Then compress it with identical parameters (fps, quality, etc.) using
Indeo5 codec in Matlab (R14SP3) and in Adobe Premiere 6. Both
produce a compressed video that are playable in Window Media Player
11. However, importing both videos into powerpoint results in only
the Premiere-compressed video playing in the presentation.
Powerpoint uses a different media player to play movies, and Matlab
must put something in the header (I presume) that makes it unusable.


I am almost certain this is a new problem since I have older videos,
probably produced by Matlab R11 or R12 that play fine in powerpoint.
Using premiere to check the properties of the 2 videos, shows them
identical in durations, frame number, and all other paramaters, but
differing in by just a few bytes in size. Again, suggesting a header
problem?

My workaround is to use Premiere to recompress the Matlab-produced
movie using the identical parameters. Not ideal.
Russell Wyeth
2007-01-20 17:50:58 UTC
Permalink
A few more details:

1. This is a powerpoint/matlab-avi specific problem - both Windows
Media Player and mplay32.exe (what Powerpoint uses to play movies)
will play both Matlab-avi and Premiere-avi movies.

2. Movies created with either addframe or movie2avi have the same
problem.

3. Movies using either truecolor or grayscale indexing have the same
problem.

Does anyone have any suggestions for a within-Matlab fix? I do not
want to switch away from Indeo compression.

TIA
R
Derek
2007-01-23 16:22:23 UTC
Permalink
Don't know what to say if you don't want to switch compressors, but
using the 'Cinepak' compressor created movies that will run in
PowerPoint.
Derek
2007-01-23 16:29:00 UTC
Permalink
Following up on above message, one can specify the compressor in the
code, as in example below...

aviobj = avifile ( 'time_series', 'fps',...
10,'Compression','Cinepak');
Post by Derek
Don't know what to say if you don't want to switch compressors, but
using the 'Cinepak' compressor created movies that will run in
PowerPoint.
Russell Wyeth
2007-01-23 17:21:50 UTC
Permalink
Cinepak won't cut it for me. I use a variety of codecs, depending on
the movie - different codecs produce very different movie
qualities/file sizes for each type of movie (greyscale, colour,
animations, live action, etc.). And Indeo is the best I've found for
one type of movie I use.

Some further developments:

1. Another user has found that this is a powerpoint 2003 specific
problem - earlier versions don't have the problem.

2. On at least 2 windoz systems, if the matlab-produced avi file is
renamed with a .mpg extension, then Powerpoint 2003 will play the
movie. Strange, but true. Windows Media Player plays the movie with
either the .avi or .mpg extension. So the simplest workaround would
be to produce the movie in matlab with a .mpg filename.

R
Markus
2007-01-31 09:00:22 UTC
Permalink
Hi!

The best quality movies I have generated in Matlab are animated GIFs.
You do not have any compression artifacts (which are significant in
line drawings) and the files are very small.

However, Powerpoint does not play the animated GIFs correctly (they
seem to start whenever they like to in the background).

Is there an alternative to produce uncompressed videos with an
acceptable file size in Matlab? The file size of an raw AVI is *not*
acceptable. And as the GIFs show, the informational content is not
too large to put it in a small file.

Markus
Dave Tarkowski
2007-01-31 15:29:31 UTC
Permalink
Markus,

The size of an uncompressed AVI file is the size of the data that you put
into it. There is no uncompressed format that will give you a significantly
smaller file size than an uncompressed AVI (the AVI overhead is minimal when
dealing with uncompressed data).

I think that what you are looking for is lossless on "non-lossy"
compression. The GIF compression scheme is lossless since no image data is
thrown away. Other image formats such as jpeg are lossy formats since they
throw away some data to achieve their compression ratios. Most lossy
compression codecs work best on real world scenes and perform poorly on text
and line drawings.

I believe that Microsoft's RLE codec is lossless and is supported by the
AVIFILE command by default. I am unaware of any other lossless codecs that
are installed by default on a typical Windows machine. A quick google
search turned up a number of lossless codecs that are available, but I don't
have much experience with them.

-Dave Tarkowski
Post by Markus
Hi!
The best quality movies I have generated in Matlab are animated GIFs.
You do not have any compression artifacts (which are significant in
line drawings) and the files are very small.
However, Powerpoint does not play the animated GIFs correctly (they
seem to start whenever they like to in the background).
Is there an alternative to produce uncompressed videos with an
acceptable file size in Matlab? The file size of an raw AVI is *not*
acceptable. And as the GIFs show, the informational content is not
too large to put it in a small file.
Markus
Markus
2007-01-31 21:28:08 UTC
Permalink
Post by Dave Tarkowski
I believe that Microsoft's RLE codec is lossless and is supported
by the AVIFILE command by default.

Thanks Dave, that was the solution! Actually I have tried some time
before to use the RLE codec, but the color maps that I was using were
inappropriate. Thinking about that again, I now found a useful
colormap.

Regards
Markus
Mike Rodehorst
2007-02-05 22:12:18 UTC
Permalink
I would like to use the RLE lossless codec to make movies of animated
plot commands but Matlab's getframe command is only giving me
TrueColor frames which movie2avi says cannot be handled by the RLE
compressor. Apparently my system uses TrueColor graphics, but there
still should be a way to make an RLE movie. There are at most 20
unique colors in my plots. I suppose I could manually find all the
unique colors and convert the TrueColor data to grayscale and
colormap, but isn't there a better way?

Mike
Mike Rodehorst
2007-02-05 22:27:32 UTC
Permalink
Well, I managed to answer my own question after I found the RGB2IND
function. Here's my solution (I used a max_colors of 32):

function write_indexed_avi(truecolor_movie, avi_filename, fps,
max_colors)

for i = 1:size(truecolor_movie,2)
size(truecolor_movie(i).cdata)
[ind, map] = rgb2ind(truecolor_movie(i).cdata, max_colors);
ind_movie(i).colormap = map;
ind_movie(i).cdata = ind;
end

movie2avi(ind_movie, avi_filename, ...
'FPS', fps, 'quality', 100, 'compression', 'RLE');
Post by Mike Rodehorst
I would like to use the RLE lossless codec to make movies of
animated
plot commands but Matlab's getframe command is only giving me
TrueColor frames which movie2avi says cannot be handled by the RLE
compressor. Apparently my system uses TrueColor graphics, but
there
still should be a way to make an RLE movie. There are at most 20
unique colors in my plots. I suppose I could manually find all the
unique colors and convert the TrueColor data to grayscale and
colormap, but isn't there a better way?
Mike
Markus
2007-02-06 12:26:46 UTC
Permalink
The problem is that you can only use a fixed colormap for all frames,
not a different colormap for each frame (like it is possible in
animated gifs). I see three possible ways to cope with that:

1. Run over all saved frames and collect all colors, then compute the
colormap using rgb2ind, and then start to add the frames to the avi.
This might not be easily possible, as there might be a large amount
of data for a long movie.

2. Use a colormap that covers the 3D-cube of RGB colors well. In this
case, your colors might get a bit distorted due the quantization of
colors (you may only use 256 colors).

3. If you know in advance which colors can be present in the movie
frames, generate your colormap using that knowledge before recording
the movie frames.

I chose the second way and generated myself a useful, general
colormap that I will use for all future movies. Let me know if you
are interested in the code for that.
Markus

Continue reading on narkive:
Loading...