How to achieve fixed frame size for making a movie while using CAMORBIT command in MATLAB?

5 views (last 30 days)
I am using CAMORBIT to rotate the figure and then trying to capture the frames using GETFRAME function. But when I try to make a movie using MOVIE2AVI function, I get the following error:
Error using ==> avifile.addframe>ValidateFrame at 332

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
MOVIE2AVI function requires all the frames to have the same size. This can be achieved by specifying the second argument of the GETFRAME command as follows:
for k=1:nv
camorbit(360/nv,0)
M(nv) = getframe(gcf,[74 47 450 350]); % specify the region of interest
end
This will keep the frame size fixed which will avoid the error while using MOVIE2AVI command.

More Answers (0)

Categories

Find more on Animation in Help Center and File Exchange

Products


Release

R2007b

Community Treasure Hunt

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

Start Hunting!