MATLAB Answers

VideoReader Failed to init Ubuntu 20.04

22 views (last 30 days)
gaspard BLANCHET
gaspard BLANCHET on 27 Sep 2020
Commented: Allen Takahashi on 20 Oct 2021 at 6:48
I'm trying to process video with matlab 2020b on Ubuntu 20.04. But I receive this log:
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)
Error in GMM (line 7)
video = VideoReader('./walking/person01_walking_d1_uncomp.avi');
The installation of gstream0.1 is not available.
Do you have any idea of what I'm missing?

Answers (2)

Urmila Rajpurohith
Urmila Rajpurohith on 21 Oct 2020
The reason is that old versions of MATLAB used to rely on gstreamer-0.10 to process video but from at least R2017a the dependency of gstreamer library has changed to gstreamer-1.0 or higher.
The error message indicates that the suitable codecs are not installed on the system to decode the file. Try to determine if the file can be played outside MATLAB on the Linux system.
To do so, follow the steps below:
1. Copy the file to /tmp
2. On the Linux terminal, execute: gst-launch-1.0 playbin uri=file:///tmp/<filename> video-sink=appsink audio-sink=fakesink text-sink=fakesink.
If this errors out, it indicates that the suitable codecs are not available.
Installing the correct gstreamer codecs may solve the issue.
Hope this helps!

Mohamed Bencherif
Mohamed Bencherif on 8 Sep 2021
I had a similar issue in Matlab R2021a, Ubuntu 20.04,
The best thing is to install all the packages of gstreamer.
check this link..
Install GStreamer on Ubuntu or Debian
Run the following command:
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev 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 gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
The installation of gsteramer fixed the problem.
  1 Comment
Allen Takahashi
Allen Takahashi on 20 Oct 2021 at 6:48
I get the exact same message as the original poster on Linux Mint 19.3 and Matlab 2020a. Running the gst-launch command per UR I get "No decoder available for type 'video/x-msvideo'.". I have run the Install GStreamer command above and it made no difference. I can successfully play the AVI file using VLC; if I query VLC as to the codec it comes back with "RV24".
I can't find a codec called RV24; the closest I have found is RGB24 - but it is unclear to me that this is a codec.
Is there a way to access the codec VLC is using in Matlab? Or if RGB24 really is what I'm looking for, where do I put it so Matlab can find it?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!