Why do i have this error? Frame must be 45 by 29, ERROR at using VideoWriter/writeVideo (line 344) Frame must be 54 by 31

조회 수: 2 (최근 30일)
i crop a video and then i save the croped video but it cant be written because of this error! any ideas how to solve it? With some videos it works and with some it doesnt,i dont know why.

채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 2일
That error is caused by trying to write a frame that is a different size than the very first frame in the video. All frames in the video must be exactly the same size.
If you are using getframe() or saveas() or print() to capture information from the display, then you need to be aware that the size of what is displayed can change over time if you are not careful. To write a video frame it is recommend that you either generate your frame into a matrix of known size (not capturing from the display), or that if you do capture, that you imresize() or impad() or imcrop() to a fixed size.
  댓글 수: 2
abbxucy11
abbxucy11 2016년 11월 3일
i use imcrop to crop the area that i want, and that's why i dont undestand the error. with the use of imcrop it is supposed to crop the same area at each frame. and something else i dont undestand is why i have this error in some videos and not all of them
Walter Roberson
Walter Roberson 2016년 11월 3일
Please show your imcrop() call.
Also, are you attempting to append to an existing video, or are you creating a new video?

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by