How to specify the location to save video using VideoWriter?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mohana Singh
am 22 Apr. 2019
Beantwortet: Walter Roberson
am 22 Apr. 2019
I am creating video out of images and I am doing this in a loop for different folders with images. So i need to save the videos in their respective folders. Right now the following code saves the videos to the current working directory and so it keeps getting overwritten. So how do I specify the location to save the videos?
for folder = 1:4
for loop = 1:numofimages
images{loop} = imread(pngfile);
end
writerObj = VideoWriter('myVideo.avi');
writerObj.FrameRate = 1;
secsPerImage = 2.* ones(numofimages,1);
open(writerObj);
for u=1:numofimages
frame = im2frame(images{u});
for v=1:secsPerImage(u)
writeVideo(writerObj, frame);
end
end
close(writerObj);
end
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 22 Apr. 2019
In the place you have 'MyVideo.avi' specify the directory name too in the normal way for your system.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!