How to log acquired data to disk, and save the video file as mp4 or .avi ?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am trying to log acquired data to disk, and save the video file as mp4 or .avi, but it doesn't create any file in the folder? Any advice would be appreciated.
thanks.
clear ;
close all;
vid = videoinput('winvideo', 1, 'YUY2_640x480');
vid.Timeout = 20;
set(vid, 'FrameGrabInterval', 2);
vid.LoggingMode = 'disk';
logfile = VideoWriter('MATLAB.mp4', 'MPEG-4')
vid.FramesPerTrigger = 20;
start( vid );
wait( vid, Inf );
[d t] = getdata( vid, vid.FramesAvailable );
fps = 1 / mean( diff( t ) );
vid.ReturnedColorSpace = 'grayscale'
preview(vid);
start(vid);
pause(2);
frames = getdata(vid);
stop(vid)
clear vid
0 件のコメント
回答 (1 件)
Sulaymon Eshkabilov
2020 年 9 月 7 日
Hi,
Probably, you'd need to indicate the directory of your log data as a whole, e.g.: '../dir/videos/MATLAB.mp4'
5 件のコメント
参考
カテゴリ
Help Center および File Exchange で Acquisition Using Image Acquisition Explorer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!