MATLAB: How to get VideoReader working on Ubuntu 17.04

codecgstreamerUbuntuubuntu 17.04videoreader

I am struggling to get VideoReader working on Ubuntu 17.04. If I enter in the command:
v = VideoReader('flame.avi')
I get the following
Error using VideoReader/init (line 619)
Could not read file due to an unexpected error. Reason: Unable to initialize the video obtain properties
I have checked the MATLAB community for answers, and it appears that the most common problem is not having gstreamer0.10 installed. See: https://www.mathworks.com/matlabcentral/answers/165584-cannot-read-video-matlab-2014b-linux and https://www.mathworks.com/matlabcentral/answers/255157-can-t-load-video-using-videoreader-in-matlab-r2015-on-ubuntu-15-04-could-not-read-file-due-to-an-un
However, with Ubuntu 17.04, I have not yet found a way to install this package (it is pretty old, and people are switching to gstreamer1.0 and above). See https://www.mathworks.com/matlabcentral/answers/294258-hello-i-have-a-problem-with-videoreader-on-matlab-r2016a-with-ubtuntu-lts16-04
Surely there is another package that can get VideoReader to work? If not, then does anyone have any suggestions to try and install gstreamer0.10?

Best Answer

A colleague of mine found a link to a post that solved my problem https://www.mathworks.com/matlabcentral/answers/329796-issue-with-libstdc-so-6
Essentially, you need to redirect MATLAB and tell it to not use its default libstdc++6 file and use your Linux system's instead. I went with the solution at the bottom, and wrote an alias for my .bashrc file.
alias matlab='LD_PRELOAD=/usr/loib/x86_64-linux-gnu/libstdc++.so.6.0.22 /usr/local/bin/matlab -desktop'
After testing it out, I have confirmed that it works now.