all video frames are black

조회 수: 8 (최근 30일)
Roaa Alnafea
Roaa Alnafea 2022년 2월 2일
댓글: Benjamin Thompson 2022년 2월 2일
I am trying this code , it work with me for som videos , but for the other one I get all frames: black
Any idea about how I can solve this ?
I try to convert it to avi but I get the same, and I couldn't attach it here because it is too large
vidObj = VideoReader('002.mp4');
s = struct('cdata',zeros(vidObj.Height,vidObj.Width,3,'uint8'),'colormap',[]);
>> vidObj.CurrentTime = 0.6;
>> k = 1;
while vidObj.CurrentTime <= 0.9
s(k).cdata = readFrame(vidObj);
k = k+1;
end
whos s
  댓글 수: 3
Roaa Alnafea
Roaa Alnafea 2022년 2월 2일
Thank you , it is RGB , I try to run the code in MATLAB online with the same file and it works !
Benjamin Thompson
Benjamin Thompson 2022년 2월 2일
Can you post a couple of the frames that you get from VideoReader, as a MAT file? Why do you need the 'colormap' stuff and please post the code that you use to display the frames in the structure s.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by