Recording simultaneous video from 2 cameras
9 ビュー (過去 30 日間)
古いコメントを表示
For a project i need to record 2 IP cam video streams and wonder on how to accomplish that since the image aquisition explorer only allows me to use one camera at a time.
Cheers!
0 件のコメント
回答 (1 件)
Saffan
2023 年 10 月 30 日
Hi Frederik,
I understand that your goal is to simultaneously record two video streams from two separate IP cameras. This can be achieved using the “ipcam” function, which facilitates the acquisition of video data from IP cameras.
Here is a code snippet that demonstrates this:
% Create the ipcam objects
cam1 = ipcam('address1');
cam2 = ipcam('address2');
% Capture one frame to get its size
frame1 = snapshot(cam1);
frame2 = snapshot(cam2);
[frameHeight1, frameWidth1, ~] = size(frame1);
[frameHeight2, frameWidth2, ~] = size(frame2);
% Create video writer objects
outputVideo1 = VideoWriter('cam1.avi');
outputVideo2 = VideoWriter('cam2.avi');
open(outputVideo1);
open(outputVideo2);
duration = 100;
tic;
while toc < duration
writeVideo(outputVideo1, snapshot(cam1));
writeVideo(outputVideo2, snapshot(cam2));
end
% Close the video writer objects
close(outputVideo1);
close(outputVideo2);
Please refer to the following documentation for more information:
Hope this helps!
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Support Package for IP Cameras についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!