필터 지우기
필터 지우기

Why do i get error in videowriter as "Error using VideoWriter/writeVideo Frame must be 436 by 344 Error in videoominusone (lwriteVid​eo(writerO​bj,getfram​e(gca));"

조회 수: 57 (최근 30일)
Please help me to solve this errror
Error using VideoWriter/writeVideo (line 383)
Frame must be 436 by 344
Error in videoominusone (line 286)
writeVideo(writerObj,getframe(gca));

채택된 답변

Walter Roberson
Walter Roberson 2015년 7월 13일
Every frame that you write with VideoWriter must be the exact same size.
getframe(gca) returns according to the current axes size. If you have not taken special care, that axes size will not necessarily be exactly the same size as the previous frame.
You should be considering setting up the axes once and using "hold on", and then updating only the content of the axes. Your current code likely rebuilds the axes each time through your loop.
  댓글 수: 1
James Marron
James Marron 2023년 8월 30일
Had this problem, which was caused by first creating an image, and then plotting additional graphics on top, within each frame. Sometimes the additional graphic would extend beyond the image which would then extend the axes beyond hte original image. The function getframe would still contruct a movie structure (with indeed difernt sizes of cdata in different frames). That seemed to generate this error when VidoWriter was called. The solution for me was:
  1. After creating the image part, but before adding the additional graphics, store the axis limits, wth a command like "vaxlim = axis;"
  2. Add the additional graphcs
  3. Restore the orginal axis limits useing "axis(vaxlim);"

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by