Create working avi video.

5 vues (au cours des 30 derniers jours)
baxbear
baxbear le 19 Août 2017
Modifié(e) : baxbear le 27 Août 2017
Always when I try to create an .avi video out of matrices I get the following error: Invalid video data - must be numeric or logical data type.
function [video] = CreateVideo(obj)
video = VideoWriter('test.avi');
video.FrameRate = 1;
open(video)
% loop 2d matrix sequence with ones and zeros and create video
for i_inc = 1 : size(obj.square_move_seq_, 3)
gray_img = double(obj.square_move_seq_(:, :, i_inc));
img = cat(3, gray_img, gray_img, gray_img);
writeVideo(video, img);
end
% Finalize the video file.
close(video);
end
Does somebody have a clue what I do wrong?
Thank you very much in advance.

Réponse acceptée

Image Analyst
Image Analyst le 19 Août 2017
Try
writeVideo(video, uint8(img));
  6 commentaires
Image Analyst
Image Analyst le 22 Août 2017
So, is it solved now? Or do you still have a problem?
baxbear
baxbear le 27 Août 2017
Modifié(e) : baxbear le 27 Août 2017
Yes, this particular problem is solved. I still have some problems with the visualisation but I will open a separate thread for it.
Thank you very much.

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