use a variable name with VideoWriter
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bryan Clark
am 9 Apr. 2018
Kommentiert: Walter Roberson
am 10 Apr. 2018
I am trying to create a program to create videos from images. I would like to use inputdlg to create a variable file name. I can use a selected path. However, it doesn't appear that VideoWriter allows you to use a variable name. Is there a way around this?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 9 Apr. 2018
VideoWriter has no problems with variable file names.
[filename, pathname] = uiputfile('*.avi', 'Select an output file');
if ~ischar(filename); return; end %user cancel
fullname = fullfile(pathname, filename);
obj = VideoWriter(fullname);
...
0 Kommentare
Weitere Antworten (1)
Bryan Clark
am 10 Apr. 2018
Bearbeitet: Walter Roberson
am 10 Apr. 2018
1 Kommentar
Walter Roberson
am 10 Apr. 2018
response = inputdlg('Input File Name');
fileName = response{1};
if isempty(fileName); return; end %user cancel
[dirname, basename, ext] = fileparts(fileName);
if isempty(ext); ext = '.avi'; end
fileName = fullfile(dirname, [basename ext]);
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!