How do I obtain video (.avi) from a webcam (in real time) and store the video frames somewhere for further processing?

I need to obtain video frames in real-time video. I have the Image Acquisition Toolbox (R2011b). How can I write code to automatically open the Image Acquisition Toolbox and start making video?

回答 (2 件)

Amith Kamath
Amith Kamath 2013 年 5 月 20 日

2 件のコメント

Mohd Aquib
Mohd Aquib 2013 年 5 月 23 日
編集済み: Walter Roberson 2013 年 5 月 24 日
thanks for replying...m using videowriter and executing this code
logfile = VideoWriter('logfile.mj2', 'Motion JPEG 2000');
vidobj.DiskLogger = logfile;
start(vidobj);
wait(vidobj, 5);
while (vidobj.FramesAcquired ~= vidobj.DiskLoggerFrameCount)
pause(.1);
end
delete(vidobj);
clear vidobj;
but irz is giving error
permission is allowed for
logfile = VideoWriter('logfile.mj2', 'Motion JPEG 2000');
plz help
Randy Souza
Randy Souza 2013 年 5 月 24 日
I market this answer as not accepted because Mohd indicates below that this did not actually resolve the problem. However, Amith keeps the reputation points earned when the answer was marked as accepted.

サインインしてコメントする。

Image Analyst
Image Analyst 2013 年 5 月 21 日
Did you run imaqtool and see what commands it logs as you do things? Commands like preview() and getsnapshot()?

6 件のコメント

Mohd Aquib
Mohd Aquib 2013 年 5 月 23 日
yeah m using all these commands..and itz running as well..but m unable to extract those frames from memory to a particular folder so that i can further process those frames..since permission to make any folder..and storing those frame in a folder isnt allowed...so what i shd do to extract those frame from memory to folder
You accepted the other answer so I assume you got it working since you responded to me.
Mohd Aquib
Mohd Aquib 2013 年 5 月 23 日
no bro the problem is as above presented..the above answer was some how relevent..but it still doesnt solve my pblm...plz help
I don't know what "i need to real time video for obtaining its frame" actually means, that's why I gave my answer - it was my best guess at what you meant. And you didn't post the error, just some clipped paraphrasing of it, so we don't really know what went wrong.
Mohd Aquib
Mohd Aquib 2013 年 5 月 23 日
ok sir actually the pblm is " i need code for obtaining video(.avi format) from webcam(real time)...and i ve to store the video somewhere(desktop)in the pc so that i cd futher process it.. whenever i try,i manage to open webcam but unable to store a video where i want..i have mage acquisition toolbox so what i shd do to obtain video from and and storing it at smwhere in the pc
Which step of the process in http://www.mathworks.com/help/imaq/logging-image-data-to-disk.html did the code stop working?

サインインしてコメントする。

タグ

質問済み:

2013 年 5 月 18 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by