MATLAB:无法初始化视频获取属性。

时间:2021-03-24 23:39:26

I want to use VideoReader() in MATLAB 2017b on Ubuntu 16.04. While trying to use this function I get to this error:

我想在Ubuntu 16.04的MATLAB 2017b中使用VideoReader()。在尝试使用这个函数时,我得到了这个错误:

>> obj= VideoReader('video.mp4');
Error using VideoReader/init (line 619)
Could not read file due to an unexpected error. Reason: Unable to initialize the video obtain properties

Error in VideoReader (line 172)
            obj.init(fileName);

Can anyone help me with this problem?

有人能帮我解决这个问题吗?

Thanks

谢谢

1 个解决方案

#1


0  

I faced the problem described above. It took me several hours to solve. I found many people face the same problem. So, I decided to describe my solution here, so that others can use it.

我面临上述问题。我花了好几个小时才解决。我发现很多人都面临着同样的问题。因此,我决定在这里描述我的解决方案,以便其他人可以使用它。

To solve this problem you need to have ffmpeg and gstreamer0.10-ffmpeg. You need to add PPA and then install the packages:

要解决这个问题,您需要使用ffmpeg和gstreamer0.10-ffmpeg。您需要添加PPA,然后安装软件包:

sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update 
sudo apt-get install ffmpeg gstreamer0.10-ffmpeg gstreamer0.10-tools 
gstreamer0.10-plugins-good

Note: VideoReader support GStreamer 0.10.

注:支持GStreamer 0.10。

You may still need some other plugins. I suggest you to play the video so that more needed packages will be suggested to you to install (related to codec)

您可能还需要一些其他插件。我建议您播放视频,以便建议您安装更多需要的包(与codec相关)

The above explanation may not be completely efficient; but, I hope it will work for you, too. I ask any person who can improve my explanations so that others can use it easier and better.

上述解释可能并非完全有效;但是,我也希望它对你有用。我问任何能改进我的解释的人,这样其他人就可以更容易、更好地使用它。

You may also see the same discussion at [Unable to initialize the video obtain properties (videoreader in Matlab) page) too.

您也可以在[无法初始化视频获取属性(Matlab中的可视程序)页面)上看到相同的讨论。

#1


0  

I faced the problem described above. It took me several hours to solve. I found many people face the same problem. So, I decided to describe my solution here, so that others can use it.

我面临上述问题。我花了好几个小时才解决。我发现很多人都面临着同样的问题。因此,我决定在这里描述我的解决方案,以便其他人可以使用它。

To solve this problem you need to have ffmpeg and gstreamer0.10-ffmpeg. You need to add PPA and then install the packages:

要解决这个问题,您需要使用ffmpeg和gstreamer0.10-ffmpeg。您需要添加PPA,然后安装软件包:

sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update 
sudo apt-get install ffmpeg gstreamer0.10-ffmpeg gstreamer0.10-tools 
gstreamer0.10-plugins-good

Note: VideoReader support GStreamer 0.10.

注:支持GStreamer 0.10。

You may still need some other plugins. I suggest you to play the video so that more needed packages will be suggested to you to install (related to codec)

您可能还需要一些其他插件。我建议您播放视频,以便建议您安装更多需要的包(与codec相关)

The above explanation may not be completely efficient; but, I hope it will work for you, too. I ask any person who can improve my explanations so that others can use it easier and better.

上述解释可能并非完全有效;但是,我也希望它对你有用。我问任何能改进我的解释的人,这样其他人就可以更容易、更好地使用它。

You may also see the same discussion at [Unable to initialize the video obtain properties (videoreader in Matlab) page) too.

您也可以在[无法初始化视频获取属性(Matlab中的可视程序)页面)上看到相同的讨论。