From: Cassandra on
Hello John and Onomitra,

I have found that this code:
> aviobj = avifile('example1.avi','compression','None');
also leads to a static movie and 'window bleed'.

When I try Cinepak instead:
> aviobj = avifile('example1.avi','compression','Cinepak');
MATLAB is unable to find the codec (even if I drop a copy into the same folder).

Any suggestions? What worked for you, John? I am running Windows 7 with MATLAB R2009b. Thank you in advance for your assistance.

Cheers,
Cassandra


"Onomitra Ghosh" <oghosh(a)mathworks.com> wrote in message <hccesh$kho$2(a)fred.mathworks.com>...
> Hi John,
>
> Try using:
>
> aviobj = avifile('example1.avi','compression','None');
>
> Thanks,
>
> Onomitra
>
> "John Ramshur" <jramshur(a)gmail.com> wrote in message
> news:hcbfl6$8og$1(a)fred.mathworks.com...
> > System Info: Windows 7, MATLAB Version 7.7.0.471 (R2008b)
> >
> > I'm trying to create an avi in windows 7, but I'm running into two issues.
> >
> > 1. The resulting avi video is static and whatever was behind the figure
> > during creation bleeds into the video. See this link for an example:
> > http://www.ramshurweb.com/software/example1.avi
> >
> > 2. I'm getting this warning when trying to use the default compression:
> > "Warning: Cannot locate Indeo5 compressor, using 'None' as the compression
> > type.
> > See Mathworks Technical Solution 1-4G50RI for more information. " I can't
> > seem to find the codec/compressor for anything other than XP. I have
> > ffdshow...is there anything in there i could use?
> >
> > Please help!
> >
> >
> > %% Sample AVI creation code from the avifile help documentation.
> >
> > t = linspace(0,2.5*pi,40);
> > fact = 10*sin(t);
> > fig=figure;
> > aviobj = avifile('example1.avi','compression','Cinepak');
> > [x,y,z] = peaks;
> > for k=1:length(fact)
> > h = surf(x,y,fact(k)*z);
> > set(gca,'nextplot','replacechildren');
> > axis([-3 3 -3 3 -80 80])
> > axis off
> > caxis([-90 90])
> > F = getframe(fig);
> > aviobj = addframe(aviobj,F);
> > end
> > close(fig)
> > aviobj = close(aviobj);
> >
>
From: Cassandra on
An update:

Changing the rendering from OpenGL to zbuffer removed the bleed problem.
(solution from: http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/b8dfca5cdc360f77/e91248fab199064a?lnk=raot&fwc=1&pli=1 )

I still cannot access known compression formats.

I am running Windows 7 x64.

Thanks again,
Cassandra


"Cassandra " <r.cassandra--remove(a)rocketmail.com> wrote in message <hiq3k9$mv8$1(a)fred.mathworks.com>...
> Hello John and Onomitra,
>
> I have found that this code:
> > aviobj = avifile('example1.avi','compression','None');
> also leads to a static movie and 'window bleed'.
>
> When I try Cinepak instead:
> > aviobj = avifile('example1.avi','compression','Cinepak');
> MATLAB is unable to find the codec (even if I drop a copy into the same folder).
>
> Any suggestions? What worked for you, John? I am running Windows 7 with MATLAB R2009b. Thank you in advance for your assistance.
>
> Cheers,
> Cassandra
>
>
> "Onomitra Ghosh" <oghosh(a)mathworks.com> wrote in message <hccesh$kho$2(a)fred.mathworks.com>...
> > Hi John,
> >
> > Try using:
> >
> > aviobj = avifile('example1.avi','compression','None');
> >
> > Thanks,
> >
> > Onomitra
> >
> > "John Ramshur" <jramshur(a)gmail.com> wrote in message
> > news:hcbfl6$8og$1(a)fred.mathworks.com...
> > > System Info: Windows 7, MATLAB Version 7.7.0.471 (R2008b)
> > >
> > > I'm trying to create an avi in windows 7, but I'm running into two issues.
> > >
> > > 1. The resulting avi video is static and whatever was behind the figure
> > > during creation bleeds into the video. See this link for an example:
> > > http://www.ramshurweb.com/software/example1.avi
> > >
> > > 2. I'm getting this warning when trying to use the default compression:
> > > "Warning: Cannot locate Indeo5 compressor, using 'None' as the compression
> > > type.
> > > See Mathworks Technical Solution 1-4G50RI for more information. " I can't
> > > seem to find the codec/compressor for anything other than XP. I have
> > > ffdshow...is there anything in there i could use?
> > >
> > > Please help!
> > >
> > >
> > > %% Sample AVI creation code from the avifile help documentation.
> > >
> > > t = linspace(0,2.5*pi,40);
> > > fact = 10*sin(t);
> > > fig=figure;
> > > aviobj = avifile('example1.avi','compression','Cinepak');
> > > [x,y,z] = peaks;
> > > for k=1:length(fact)
> > > h = surf(x,y,fact(k)*z);
> > > set(gca,'nextplot','replacechildren');
> > > axis([-3 3 -3 3 -80 80])
> > > axis off
> > > caxis([-90 90])
> > > F = getframe(fig);
> > > aviobj = addframe(aviobj,F);
> > > end
> > > close(fig)
> > > aviobj = close(aviobj);
> > >
> >
From: John Ramshur on
I did solve the problem, however I don't remember exactly what worked. I'm using 32bit OS. If it's of any help here's some the code I was using.

%% create figure
h.f=figure('position',[100 300 800 600]);
set(h.f,'DoubleBuffer','on');

%% create movie
mov = avifile('example1.avi','fps',30,'compression','Cinepak','quality',100);
try
for i=1:size(x,1)-1
%plot something here...
drawnow;
F = getframe(h.f);
mov = addframe(mov,F);
end
mov = close(mov);
catch ME
mov = close(mov);
error(ME.message)
end


"Cassandra " <r.cassandra--remove(a)rocketmail.com> wrote in message <hiq54i$21k$1(a)fred.mathworks.com>...
> An update:
>
> Changing the rendering from OpenGL to zbuffer removed the bleed problem.
> (solution from: http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/b8dfca5cdc360f77/e91248fab199064a?lnk=raot&fwc=1&pli=1 )
>
> I still cannot access known compression formats.
>
> I am running Windows 7 x64.
>
> Thanks again,
> Cassandra
>
>
> "Cassandra " <r.cassandra--remove(a)rocketmail.com> wrote in message <hiq3k9$mv8$1(a)fred.mathworks.com>...
> > Hello John and Onomitra,
> >
> > I have found that this code:
> > > aviobj = avifile('example1.avi','compression','None');
> > also leads to a static movie and 'window bleed'.
> >
> > When I try Cinepak instead:
> > > aviobj = avifile('example1.avi','compression','Cinepak');
> > MATLAB is unable to find the codec (even if I drop a copy into the same folder).
> >
> > Any suggestions? What worked for you, John? I am running Windows 7 with MATLAB R2009b. Thank you in advance for your assistance.
> >
> > Cheers,
> > Cassandra
> >
> >
> > "Onomitra Ghosh" <oghosh(a)mathworks.com> wrote in message <hccesh$kho$2(a)fred.mathworks.com>...
> > > Hi John,
> > >
> > > Try using:
> > >
> > > aviobj = avifile('example1.avi','compression','None');
> > >
> > > Thanks,
> > >
> > > Onomitra
> > >
> > > "John Ramshur" <jramshur(a)gmail.com> wrote in message
> > > news:hcbfl6$8og$1(a)fred.mathworks.com...
> > > > System Info: Windows 7, MATLAB Version 7.7.0.471 (R2008b)
> > > >
> > > > I'm trying to create an avi in windows 7, but I'm running into two issues.
> > > >
> > > > 1. The resulting avi video is static and whatever was behind the figure
> > > > during creation bleeds into the video. See this link for an example:
> > > > http://www.ramshurweb.com/software/example1.avi
> > > >
> > > > 2. I'm getting this warning when trying to use the default compression:
> > > > "Warning: Cannot locate Indeo5 compressor, using 'None' as the compression
> > > > type.
> > > > See Mathworks Technical Solution 1-4G50RI for more information. " I can't
> > > > seem to find the codec/compressor for anything other than XP. I have
> > > > ffdshow...is there anything in there i could use?
> > > >
> > > > Please help!
> > > >
> > > >
> > > > %% Sample AVI creation code from the avifile help documentation.
> > > >
> > > > t = linspace(0,2.5*pi,40);
> > > > fact = 10*sin(t);
> > > > fig=figure;
> > > > aviobj = avifile('example1.avi','compression','Cinepak');
> > > > [x,y,z] = peaks;
> > > > for k=1:length(fact)
> > > > h = surf(x,y,fact(k)*z);
> > > > set(gca,'nextplot','replacechildren');
> > > > axis([-3 3 -3 3 -80 80])
> > > > axis off
> > > > caxis([-90 90])
> > > > F = getframe(fig);
> > > > aviobj = addframe(aviobj,F);
> > > > end
> > > > close(fig)
> > > > aviobj = close(aviobj);
> > > >
> > >
From: Cassandra on
Hi John,

Thank you for the suggestion. Unfortunately, changing the code did not work for me.

My rather ugly work around:

(I) Install and configure Microsoft Visual C++ 64 bit compiler using the instructions in:
[1] http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/
[2] http://msdn.microsoft.com/en-us/library/9yb4317s%28VS.80%29.aspx
[3] http://msdn.microsoft.com/en-us/library/9yb4317s%28VS.80%29.aspx

(II) Download and recompile mgpwrite from MATLAB Central for my machine:
[4] http://www.mathworks.com/matlabcentral/fileexchange/309-mpgwrite
(note, for whatever reason, compiling only worked when used -v)

(III) Drop the .dll file into my working directory

Voila! A movie that plays correctly. I hope this helps someone else...

Cheers,
Cassandra



"John Ramshur" <jramshur(a)gmail.com> wrote in message <hir9gv$ou9$1(a)fred.mathworks.com>...
> I did solve the problem, however I don't remember exactly what worked. I'm using 32bit OS. If it's of any help here's some the code I was using.
>
> %% create figure
> h.f=figure('position',[100 300 800 600]);
> set(h.f,'DoubleBuffer','on');
>
> %% create movie
> mov = avifile('example1.avi','fps',30,'compression','Cinepak','quality',100);
> try
> for i=1:size(x,1)-1
> %plot something here...
> drawnow;
> F = getframe(h.f);
> mov = addframe(mov,F);
> end
> mov = close(mov);
> catch ME
> mov = close(mov);
> error(ME.message)
> end
>
>