Cannot read frames from .avi video file

조회 수: 15 (최근 30일)
Elysi Cochin
Elysi Cochin 2023년 4월 10일
댓글: Cris LaPierre 2023년 4월 13일
Why cant I read the frames from the attached .avi video?
I used the below line
v = VideoReader('00jrXRMlZOY_0_10.avi');
and I got v as below
The values of v can be viewed, but when I use the below code, I dont get any error, but, no frame is displayed, but the v shows properties. Why so?
while hasFrame(v)
vidFrame = readFrame(v);
figure(1), imshow(vidFrame)
end
Please can someone suggest me, what do I need to do, to solve it?

채택된 답변

Cris LaPierre
Cris LaPierre 2023년 4월 10일
편집: Cris LaPierre 2023년 4월 13일
I also couldn't read or view the video in desktop MATLAB, but I could in MATLAB Online.
  댓글 수: 2
Elysi Cochin
Elysi Cochin 2023년 4월 13일
편집: Elysi Cochin 2023년 4월 13일
Sir, if it is issue with the codec, will the VideoReader function work and readFrames function not work
The VideoReader function gives me the output as shown in the question
When using the below code, I dont get any error, but, no frame is displayed, but the v shows properties. Why so?
while hasFrame(v)
vidFrame = readFrame(v);
figure(1), imshow(vidFrame)
end
Cris LaPierre
Cris LaPierre 2023년 4월 13일
I also didn't get an error, but could not read the video or even get info about the file using mmfileinfo. From the page I linked to:
Troubleshooting: Errors Reading Video File
You might be unable to read a video file if MATLAB cannot access the appropriate codec. 64-bit applications use 64-bit codec libraries, while 32-bit applications use 32-bit codec libraries. For example, when working with 64-bit MATLAB, you cannot read video files that require access to a 32-bit codec installed on your system. To read these files, try one of the following:
  • Install a 64-bit codec that supports this file format. Then, try reading the file using 64-bit MATLAB.
  • Re-encode the file into a different format with a 64-bit codec that is installed on your computer.
Sometimes, VideoReader cannot open a video file for reading on Windows platforms. This might occur if you have installed a third-party codec that overrides your system settings. Uninstall the codec and try opening the video file in MATLAB again.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by