Using VideoReader on .mp4 files on Linux using Matlab2015a

29 次查看(过去 30 天)
Hi,
I have Matlab2015a installed on my Linux Machine and I am trying to read .mp4 files using the VideoReader. However I get the following error message: Error using VideoReader/init (line 619) Could not read file due to an unexpected error. Reason: Unable to initialize the video obtain properties.
I am able to play the file using the VLC Media Player so the required codecs should somehow be available. Where should the codecs be stored in order for matlab to use them?
I also tried to convert the mp4 file to avi using MPEG-1 Layer 3 and DivX MPEG4 version 3 decoder. The same error message appears. VLC was able to display the .avi file.
Any suggestions how to fix this?

回答(3 个)

jackie tom
jackie tom 2017-12-22
I think I have found a solution for this problem:
1. According to the doc, VideoReader function needs gstreamer plugin higher than 1.0, so what we
need to do is install gstreamer1.0*
2. what I do is:
sudo apt-get install ubuntu-restricted-extras
sudo apt-get install gstreamer1.0*
That can make MATLAB read mp4 file on my ubuntu 17.10 machine with MATLAB2017b
  2 个评论
jackie tom
jackie tom 2017-12-22
If this doesn't work immediately, try to restart your MATLAB.
Walter Roberson
Walter Roberson 2017-12-22
At the time the Question was posed, it was gstreamer 0.1 that was needed; it is only very recently that gstreamer 1.0 was switched to. So be sure to check the documentation for the release you are using.

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2016-1-28
It might be the gstreamer problem; see http://www.mathworks.com/matlabcentral/answers/94531-why-do-i-receive-an-error-when-creating-a-videoreader-object-on-linux-in-matlab-r2010b-7-11#answer_103883 and note that the problem has other symptoms than just the one shown in that Question.

Dhananjayan Santhanakrishnan
I have the same problem. Please if someone finds solution do post here. I am not able to fix it by installing gstreamer0.10-ffmpeg

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by