Save a movie smaller than avi
12 views (last 30 days)
Show older comments
David Pesetsky
on 10 Jul 2016
Commented: David Pesetsky
on 12 Jul 2016
Hi,
I was wondering if there's a snippet of code that can save movies smaller than the typical avi? My system cannot find any codecs, so I thought mp4 would be better. But that's getting complex fast as I read about it. Here' my sample:
Z = peaks;
surf(Z)
axis tight manual
ax = gca;
ax.NextPlot = 'replaceChildren';
loops = 40;
F(loops) = struct('cdata',[],'colormap',[]);
for j = 1:loops
X = sin(j*pi/10)*Z;
surf(X,Z)
drawnow
F(j) = getframe(gcf);
end
fig = figure;
movie(fig,F,2);
movie2avi(F, 'awesomeMovie', 'compression', 'None');
Seems videowriter may have potential, but I cannot find an example I understand, based on my example above.
Hoping for some help, and thank you. Dave
2 Comments
Walter Roberson
on 10 Jul 2016
'compression', 'none' would be much bigger than AVI.
Which operating system are you using?
Accepted Answer
Image Analyst
on 10 Jul 2016
Here's an example of how to use VideoWriter. Try it for different formats: wmv, mp4, etc.
9 Comments
More Answers (0)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!