Error using the VideoReader Function in Pop OS 20.04

1 view (last 30 days)
I use MATLAB on Pop OS 20.04. I'm trying to read video files in a folder with .h264 extenstion (recorded with a Raspberry Pi camera) using the VideoReader function. The code I'm using is given below.
master=pwd;
VidFiles = dir('*image*.h264');
numfiles = length(VidFiles);
for i=1:numfiles
baseFileName = VidFiles(i).name;
Abs_baseFileName= fullfile(master, baseFileName);
v = VideoReader(Abs_baseFileName);
video = v.read();
end
It was working fine, but one day( I guess after a system update) it started giving me the following error:
Error using VideoReader/initReader (line 734)
Could not read file due to an unexpected error. Reason: Unable to initialize the video properties
Error in audiovideo.internal.IVideoReader (line 136)
initReader(obj, fileName, currentTime);
Error in VideoReader (line 104)
obj@audiovideo.internal.IVideoReader(varargin{:});
How do I solve the problem?

Answers (1)

Chidvi Modala
Chidvi Modala on 10 Aug 2020
This is a known issue, and is fixed in R2020b
As a workaround, you can set aside the libstdc++.so.6 file that ships with MATLAB. This might require root privilege.
For example, if MATLAB is installed at /usr/local/MATLAB/R2019b, you can open a shell and execute:
# cd /usr/local/MATLAB/R2019b
# cd sys/os/glnxa64
# mkdir unused
# mv libstdc++.so.6* unused/
MATLAB is tested with the libstdc++.so.6 that accompanies MATLAB. While unlikely, MATLAB might encounter unexpected behavior from your local version of libstdc++.so.6. If this occurs, try restoring the libstdc++.so.6 that accompanies MATLAB:
# cd /usr/local/MATLAB/R2019b
# cd sys/os/glnxa64
# mv unused/libstdc++.so.6* .

Products

Community Treasure Hunt

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

Start Hunting!