MATLAB Answers

How to convert captured frames from webcam into avi format with 20fps.

4 ビュー (過去 30 日間)
Talha Anwer
Talha Anwer 2019 年 2 月 6 日
コメント済み: Talha Anwer 2019 年 2 月 6 日
I've tried a lot of things but got some error in anyway. Can you please guide me through?

  0 件のコメント

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

採用された回答

YT
YT 2019 年 2 月 6 日
編集済み: YT 2019 年 2 月 6 日
Well you stated that you've tried a lot of things, but you didn't provide any code with it so that's not really helpfull. I suggest taking a look at how to acquire images from your webcam and after that it should not be that hard to create a video using VideoWriter. Hint: create a for-loop/while statement to continuously capture images from your webcam.

  4 件のコメント

表示 1 件の古いコメント
Talha Anwer
Talha Anwer 2019 年 2 月 6 日
It'll be really appreciable if you'll help me out.
I'm really thankful to you.
YT
YT 2019 年 2 月 6 日
Well I suggest to use VideoWriter instead of movie2avi because according to the release notes it was removed after R2016b. If you still insist on using movie2avi, please read itsdocumentation. There's an example given and explanation on how to set the framerate.
Talha Anwer
Talha Anwer 2019 年 2 月 6 日
I've used this code then it is saving the video but it's not playing when I go to that folder andplay with media player:
I'll be thankful if you may help
cd ('E:\8th semester\Machine vision LAB\Talha Data for open ended lab')
cam = webcam;
writerObj=VideoWriter('MyAVI.avi');
open(writerObj);
for i=1:60
filename = sprintf('153MC%0d.png', i);
imwrite(snapshot(cam),filename);
b=imread(['153MC',num2str(i),'.png']);
writeVideo(writerObj,b);
end
close(writerObj);

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by