Reading frame from a 4K video?

조회 수: 3 (최근 30일)
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah 2017년 8월 31일
댓글: Cam Salzberger 2017년 9월 3일
I am reading a 4k video using the following code but all frames are black!
v = VideoReader('video1.mp4');
j=1;
while j<5
video = readFrame(v);
figure,imshow(video);
j=j+1;
end
  댓글 수: 3
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah 2017년 9월 1일
Thank you very much for your comment. Yes, I read from 100 to 105 also. But the same problem. My code is Ok for 'xylophone.mp4'.
Cam Salzberger
Cam Salzberger 2017년 9월 3일
Hmm, that's odd that you wouldn't get the data, but also wouldn't see a codec error. MATLAB uses the OS' codec's for video reading and writing. Are you able to play the video correctly in Windows Media Player (if on Windows) on the same computer running MATLAB? If you're on Mac, check playing it with Quicktime. If Linux, try any program that uses GStreamer.
You can also try this command, and see if mp4 is listed:
formats = VideoReader.getFileFormats()

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by