MATLAB Answers

Problems with VideoFileReader: Error using coder.internal.errorIf

11 views (last 30 days)
Barbara
Barbara on 27 Oct 2014
Edited: Yusuf Suer Erdem on 19 Apr 2021
Hallo,
when I am trying to open a .mpg file with the vision.VideoFileReader with
vid = vision.VideoFileReader (videoName, 'ImageColorSpace', 'RGB','VideoOutputDataType',...
'single');
I get the following error message
Error using coder.internal.errorIf (line 9)
Unable to read video from the file. Use dsp.AudioFileReader to read
audio content.
I tried to open a .mp4 file with the vision.VideoFileReader and it works without any problem.
I have already searched the internet for a solution, but I found nothing that solves the problem.
Any ideas?
Thanks, B
  2 Comments
Shayma Hamandi
Shayma Hamandi on 12 Apr 2020
I have the same problem
do you fix this?
my video is mp4 but i could not play it with media player just with VLC
and this is the error message
Error using vision.VideoFileReader
Unable to read video from the file. Use dsp.AudioFileReader to read audio content.

Sign in to comment.

Answers (1)

Yusuf Suer Erdem
Yusuf Suer Erdem on 19 Apr 2021
Edited: Yusuf Suer Erdem on 19 Apr 2021
Hi There! I have faced with the same trouble. As I understood that it is about VLC Media Player because 32 and 64 bit versions of it make differences. For my idea, the code requires 32 bit of it but we do not have it. Best practice is using Media Player because on Program Files we do have both versions of Media Player as 32/64 bits.
I converted my .avi to .mp4 and I could work on without problems. Good luck!

Community Treasure Hunt

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

Start Hunting!