Video file I/O requires Gstreamer 1.0 and higher

조회 수: 36 (최근 30일)
Raymond Chiu
Raymond Chiu 2018년 10월 23일
댓글: Clyde Webster 2019년 1월 9일
What is causing the error and what are the steps for corrective action? Error message:
MATLAB has a later version of libstdc++:
  • attempts to use the older libstdc++ version prevents MATLAB from starting
alias matlab='LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 /usr/local/MATLAB/R2018b/bin/matlab -desktop'
  • explicit MATLAB invocation (via alias below) with MATLAB's libstdc++ does not resolve error:
alias matlab='LD_PRELOAD=/usr/local/MATLAB/R2018b/sys/os/glnxa64/libstdc++.so.6.0.22 /usr/local/MATLAB/R2018b/bin/matlab -desktop'
R2018b is installed on Ubuntu 16.04. GStreamer install command:
apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools
GStreamer plays videos from command line:
gst-launch-1.0 playbin uri=file:////home/user/MATLAB_DATA/OverheadCamDetect/OverheadCam.mp4
MATLAB has the newer version of the libstdc++ versions available:
ls -l /usr/local/MATLAB/R2018b/sys/os/glnxa64/libstdc++.so.6.0.22 #V22: MATLAB
ls -l /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 #V21: Ubuntu_16.04
Because MATLAB is packaged with a later version of stdlibc++, explicitly call MATLAB packaged stdlibc++ (same error results)
alias matlab='LD_PRELOAD=/usr/local/MATLAB/R2018b/sys/os/glnxa64/libstdc++.so.6.0.22 /usr/local/MATLAB/R2018b/bin/matlab -desktop'
OTHER UNSUCCESSFUL APPROACHES
Redirecting the link to the older libstdc++ prevents MATLAB from starting:
cd /usr/local/MATLAB/R2018b/sys/os/glnxa64
sudo unlink /usr/local/MATLAB/R2018b/sys/os/glnxa64/libstdc++.so.6 #V22: MATLAB
sudo ln -s /usr/local/MATLAB/R2018b/sys/os/glnxa64/libstdc++.so.6.0.22 libstdc++.so.6
Attempts to rename libstdc++ per Mathworks instructions was NOT successful (MATLAB would not start):
cd /usr/local/MATLAB/R2018b/sys/os/glnxa64
ls -l libstdc++.*
sudo mv libstdc++.so.6 backuplibstdc++.so.6
sudo mv libstdc++.so.6.0.22 backuplibstdc++.so.6.0.22
ls -l ls -l backuplibstdc++.*
% MATLAB fails to boot so restore the files to original condition:
sudo mv backuplibstdc++.so.6.0.22 libstdc++.so.6.0.22
sudo mv backuplibstdc++.so.6 libstdc++.so.6
  댓글 수: 1
Marcelo Herrera
Marcelo Herrera 2018년 10월 23일
편집: Marcelo Herrera 2018년 10월 23일
I have the same issue, i can read .avi without problem, but no .mp4. The output of videoReader.getFileFormats only show .avi and .mj2. with or without gstreamer1.0 (oficial)in Ubuntu 16.04.5 x64. Fresh instalation of Matlab R2018b

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

답변 (2개)

Marcelo Herrera
Marcelo Herrera 2018년 10월 24일
편집: Marcelo Herrera 2018년 10월 24일
I have a solution that work for me in Ubuntu 16.04.5 LTS:
First Uninstall and purge gstreamer1.0 and gstreamer0.1
Compiling from source
  1. Download and compiling orc-0.4.28 (https://gstreamer.freedesktop.org/src/orc/)
  2. Decompress the .xy file. Inside the decompressed directory* $ ./configure* $ make* $ sudo make install
  3. Do the same in point 2 for https://gstreamer.freedesktop.org/src/:
gstreamer/gstreamer1.14.4
gst-plugins-base/gst-plugins-base-1.14.4/
gst-libav/gst-libav-1.14.4/
gst-plugins-good/gst-plugins-good-1.14.4
After this, run matlab from shell $ matlab ... et voila
Please, tellme if this solution work for you.
#gstreamer #ubuntu16.04 #mp4
  댓글 수: 6
Walter Roberson
Walter Roberson 2018년 11월 1일
Raymond Chiu comments to Tomás Hernández:
Please start a new question and the community will help you.
Clyde Webster
Clyde Webster 2019년 1월 9일
I've completed these steps, unfortunately the error persists.
Matlab: R2018b
OS: Ubuntu 16.04

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


sophia bano
sophia bano 2018년 11월 5일
I was getting the same gstreamer error on Matlab2018b in Ubuntu 16.04. The following solution worked for me: https://uk.mathworks.com/matlabcentral/answers/294258-hello-i-have-a-problem-with-videoreader-on-matlab-r2016a-with-ubtuntu-lts16-04

카테고리

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