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

1 次查看(过去 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