How to preset frame size with Videowriter?

18 ビュー (過去 30 日間)
Paschalis Garouniatis
Paschalis Garouniatis 2020 年 10 月 18 日
回答済み: Ameer Hamza 2020 年 10 月 19 日
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
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
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'

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by