How to extract frames from .avi format video in matlab 7 ?

조회 수: 2 (최근 30일)
PRABHJOT SINGH
PRABHJOT SINGH 2014년 8월 15일
댓글: Image Analyst 2014년 12월 6일
i am facing problem in extracting frames from the AVI format video file, i tried various commands like_______ 'aviread' ,'videoreader' and mamy more......also tried from some of the M files available.....but it didnt help me......
Plz if anyone could help me on this>>>>
URGENT FOR PROJECT WORK>>>>>
  댓글 수: 3
Muhamad Anas
Muhamad Anas 2014년 12월 6일
%Turn video into frames
function [frames,Fps]=getFrames('orignal.avi')
a=videoReader('orignal.avi');
frames = read(a)
frames=read(VideoReader('orignal.avi'));
[~,~,~,N]=size(frames);
for i=1:N
frames(:,:,:,i)=(rgb2ycbcr(frames(:,:,:,i)));
end
frames=double(frames);
Fps = a.FrameRate;
end
Image Analyst
Image Analyst 2014년 12월 6일
Muhamad, it looks like you may have some kind of question on converting RGB frames into yCbCr. Since the original poster didn't ask anything at all about that, it would be best for you to start your own new discussion.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2014년 8월 15일
편집: Image Analyst 2014년 8월 15일
See my attached demo.
Actually since you have an antique version of MATLAB, you probably don't have mmreader or videoReader and you'll need to use aviread() or whatever it was called. So just replace read() in my code with aviread. Post your code if you have trouble adapting. I don't think I have my old version that used that. Better yet, just upgrade to the latest version.

Community Treasure Hunt

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

Start Hunting!

Translated by