There are two common reasons as to why MATLAB may fail to read a video file in this way.
1) The necessary gstreamer packages are not installed:
In order to properly read video files, MATLAB requires gstreamer1.0 and several associated packages to be present on the system. In particular, the gstreamer libav package provides most of the necessary gstreamer functionality. On Debian/Ubuntu based systems, this package can be installed using the command
$ sudo apt-get install gstreamer1.0-libav
On RHEL/Fedora based systems, the package can be installed with either
$ sudo yum install gstreamer1-libav
or
$ sudo dnf install gstreamer1-libav
For RHEL/Fedora based systems, it may be necessary to install additional repositories in order to gain access to this package. See the RPM Fusion website for more information about how to install these additional repositories:
The following gstreamer plugins provide support for additional video codecs. It may be necessary to install them depending on the type of video you are reading:
2) There is an ABI incompatibility with the MATLAB libstdc++ library
By default, MATLAB uses its own shipped libstdc++. This version of libstdc++ may be newer or older than the version used by the installed gstreamer library. Occasionally, this can cause an ABI incompatibility which prevents MATLAB from loading the gstreamer library at runtime. To test if this is the case, open MATLAB from the Linux terminal using the command:\n\n
Next, attempt to read the video file using 'VideoReader'. If the Linux terminal outputs a warning message then there is an ABI incompatibility:(MATLAB:30631): GStreamer-WARNING **: 14:16:03.858: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so': /opt/MATLAB/R2019b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.25' not found (required by /lib/x86_64-linux-gnu/libopenmpt.so.0)
The simplest workaround for this issue is to tell MATLAB to use the Linux system libstdc++ library instead of the version shipped with MATLAB. Please see the following link for instructions on how to do this:
Best Answer