How to preset frame size with Videowriter?
16 次查看(过去 30 天)
显示 更早的评论
I am using getframe and videowriter functions in my code. I know that the frame size of the first frame will set the size for every other frame. Because of this fact (if i am not mistaken) I am getting the following error.
Error using VideoWriter/writeVideo (line 356)
Frame must be 545 by 672
I would like to know if there is a way to overcome this problem. Does presetting the frame size solves it? And if it does how can I do it? Is there another solution?
Thanks in advance!
1 个评论
Ameer Hamza
2020-10-19
Can you show how you are getting the frames from your figure? If your axes is changing its size and use are use getfame(gca), then you will have this issue.
回答(1 个)
Ameer Hamza
2020-10-19
In your code, try to apply getframe on figure instead of axes
getframe(gcf);
otherwise fix the axis limits
ax = gca;
ax.XLimMode = 'manual';
ax.YLimMode = 'manual'
ax.ZLimMode = 'manual'
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!