How to achieve fixed frame size for making a movie while using CAMORBIT command in MATLAB?
5 views (last 30 days)
Show older comments
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
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on Animation 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!