Save a movie smaller than avi

조회 수: 3 (최근 30일)
David Pesetsky
David Pesetsky 2016년 7월 10일
댓글: David Pesetsky 2016년 7월 12일
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
Walter Roberson
Walter Roberson 2016년 7월 10일
'compression', 'none' would be much bigger than AVI.
Which operating system are you using?
David Pesetsky
David Pesetsky 2016년 7월 10일
Windows 7 professional. It creates an avi. A big one.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2016년 7월 10일
Here's an example of how to use VideoWriter. Try it for different formats: wmv, mp4, etc.
  댓글 수: 9
Image Analyst
Image Analyst 2016년 7월 11일
There is a "FrameRate" option you can specify to slow it down.
David Pesetsky
David Pesetsky 2016년 7월 12일
Very nice!
Thank you. Will study this a bit more for adjusting http://www.mathworks.com/help/matlab/ref/videowriter-object.html

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by