필터 지우기
필터 지우기

readFrame error Matlab R2016a Mac OSX 10.11.1

조회 수: 1 (최근 30일)
MJU
MJU 2016년 6월 23일
댓글: liomsi liomsi 2022년 1월 6일
Trying to convert a video to images. So far getting errors with 2 very simple lines of code--wondering if this is an issue of running on Mac. I converted the original .avi file to .m4v.
OBJ = VideoReader('SampleVidB1.m4v');
video = readFrame(OBJ);
The error:
Error using VideoReader/hasFrame (line 46)
Could not read file due to an unexpected error. Reason: Cannot Open
Error in VideoReader/readFrame (line 104)
if ~hasFrame(obj)
Additionally, I have seen mmread used in this application. Is it best to just download that from the file exchange and proceed? Thanks!
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 6월 23일
What do you get for
which -all SampleVidB1.m4v
MJU
MJU 2016년 6월 23일
Just the path to the file. VideoReader runs fine, seems to be readFrame that won't work.

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

답변 (1개)

MJU
MJU 2016년 6월 23일
Ok, I seem to have found a solution. QuickTime was not allowing me to open the video as an .avi file so I had used VLC to convert it to a .m4v. The conversion had options for 'Video Codec' which was set to 'H.264' by default. I tried a more familiar looking option, 'MPEG-4' and the code runs. Will continue with the rest tomorrow, hopefully that resolves this issue.
  댓글 수: 1
liomsi liomsi
liomsi liomsi 2022년 1월 6일
My video codec is MPEG-4 and I still get this error.
I started to get this issue once I used video with a frame rate of 32 Hz (it is OK with other videos of frame rate 34 Hz).
Matlab version: 2017a.

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

Community Treasure Hunt

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

Start Hunting!

Translated by