Effacer les filtres
Effacer les filtres

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 vue (au cours des 30 derniers jours)
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.

Réponse acceptée

Walter Roberson
Walter Roberson le 2 Nov 2016
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 commentaires
abbxucy11
abbxucy11 le 3 Nov 2016
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 le 3 Nov 2016
Please show your imcrop() call.
Also, are you attempting to append to an existing video, or are you creating a new video?

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by