Image Processing Toolbox Matlab R2020b on RHEL: Could not read file due to an unexpected error. Reason: Unable to initialize the video properties

Rob Kudyba rk3199 at columbia.edu
Thu Jun 30 14:27:02 UTC 2022


We use Matlab R2020b with the Image Processing Toolbox in a RHEL 7 Bright
Computing cluster on compute nodes, so, e.g., on a Mac, you need XQuartz
and open Matlab via ssh -X. I've been testing starting Matlab with the
'GST_PLUGIN_PATH' path being set as follows:

GST_PLUGIN_PATH=/usr/lib64/gstreamer-1.0;'matlab'

Here are the gstreamer1 RPMs installed:
rpm -qa|grep gstreamer
gstreamer-plugin-crystalhd-3.10.0-11.el7.x86_64
gstreamer1-plugins-bad-free-1.10.4-3.el7.x86_64
gstreamer1-rtsp-server-devel-1.4.5-1.el7.x86_64
gstreamer1-plugins-base-devel-1.10.4-2.el7.x86_64
gstreamer1-plugins-ugly-free-1.10.4-3.el7.x86_64
gstreamer1-plugins-ugly-free-devel-1.10.4-3.el7.x86_64
gstreamer1-plugins-bad-free-gtk-1.10.4-3.el7.x86_64
gstreamer1-vaapi-1.10.5-3.el7.x86_64
gstreamer1-plugins-base-devel-docs-1.10.4-2.el7.noarch
gstreamer1-rtsp-server-1.4.5-1.el7.x86_64
gstreamer1-plugins-base-tools-1.10.4-2.el7.x86_64
gstreamer1-1.10.4-2.el7.x86_64
gstreamer1-devel-1.10.4-2.el7.x86_64
gstreamer1-plugins-good-1.10.4-2.el7.x86_64
gstreamer1-plugins-base-1.10.4-2.el7.x86_64
gstreamer1-vaapi-devel-docs-1.10.5-3.el7.noarch
gstreamer1-rtsp-server-devel-docs-1.4.5-1.el7.noarch
gstreamer1-devel-docs-1.10.4-2.el7.noarch
gstreamer1-plugins-bad-free-devel-1.10.4-3.el7.x86_64

Then:
 ls -l /usr/lib64/gstreamer-1.0
total 12564
drwxr-xr-x 3 root root     16 Jun 28 15:18 include
-rwxr-xr-x 1 root root  45632 Mar  9  2017 libgst1394.so
-rwxr-xr-x 1 root root  15736 Oct 17  2017 libgstaccurip.so
-rwxr-xr-x 1 root root  57072 Jun  8  2018 libgstadder.so
-rwxr-xr-x 1 root root  15840 Oct 17  2017 libgstadpcmdec.so
-rwxr-xr-x 1 root root  15872 Oct 17  2017 libgstadpcmenc.so
-rwxr-xr-x 1 root root  53792 Oct 17  2017 libgstaiff.so
-rwxr-xr-x 1 root root  20096 Mar  9  2017 libgstalaw.so
-rwxr-xr-x 1 root root  20040 Mar  9  2017 libgstalphacolor.so
-rwxr-xr-x 1 root root  53304 Mar  9  2017 libgstalpha.so
-rwxr-xr-x 1 root root  81688 Jun  8  2018 libgstalsa.so
-rwxr-xr-x 1 root root  19952 Mar  9  2017 libgstapetag.so
-rwxr-xr-x 1 root root   7056 Jun  8  2018 libgstapp.so
-rwxr-xr-x 1 root root  75208 Oct 17  2017 libgstasfmux.so
-rwxr-xr-x 1 root root  23840 Jun  8  2018 libgstaudioconvert.so
-rwxr-xr-x 1 root root  15776 Oct 17  2017 libgstaudiofxbad.so
-rwxr-xr-x 1 root root 141864 Mar  9  2017 libgstaudiofx.so
-rwxr-xr-x 1 root root  50080 Oct 17  2017 libgstaudiomixer.so
-rwxr-xr-x 1 root root 133528 Mar  9  2017 libgstaudioparsers.so
-rwxr-xr-x 1 root root  23800 Jun  8  2018 libgstaudiorate.so
-rwxr-xr-x 1 root root  32088 Jun  8  2018 libgstaudioresample.so
-rwxr-xr-x 1 root root  44864 Jun  8  2018 libgstaudiotestsrc.so
-rwxr-xr-x 1 root root  36984 Oct 17  2017 libgstaudiovisualizers.so
-rwxr-xr-x 1 root root  24368 Mar  9  2017 libgstauparse.so
-rwxr-xr-x 1 root root  37576 Oct 17  2017 libgstautoconvert.so
-rwxr-xr-x 1 root root  29024 Mar  9  2017 libgstautodetect.so
-rwxr-xr-x 1 root root 170672 Mar  9  2017 libgstavi.so
-rwxr-xr-x 1 root root  32672 Oct 17  2017 libgstbayer.so
-rwxr-xr-x 1 root root  62240 Aug  3  2015 libgstbcmdec.so
-rwxr-xr-x 1 root root  24440 Oct 17  2017 libgstbz2.so
-rwxr-xr-x 1 root root  87968 Oct 17  2017 libgstcamerabin2.so
-rwxr-xr-x 1 root root  20000 Oct 17  2017 libgstcdio.so
-rwxr-xr-x 1 root root  23648 Jun  8  2018 libgstcdparanoia.so
-rwxr-xr-x 1 root root  28392 Oct 17  2017 libgstcoloreffects.so
-rwxr-xr-x 1 root root  66144 Oct 17  2017 libgstcompositor.so
-rwxr-xr-x 1 root root 369264 Mar  9  2017 libgstcoreelements.so
-rwxr-xr-x 1 root root  70688 Mar  9  2017 libgstcoretracers.so
-rwxr-xr-x 1 root root  20176 Mar  9  2017 libgstcutter.so
-rwxr-xr-x 1 root root 142384 Oct 17  2017 libgstdashdemux.so
-rwxr-xr-x 1 root root  20168 Oct 17  2017 libgstdataurisrc.so
-rwxr-xr-x 1 root root  68192 Mar  9  2017 libgstdebug.so
-rwxr-xr-x 1 root root  59064 Oct 17  2017 libgstdebugutilsbad.so
-rwxr-xr-x 1 root root 293328 Mar  9  2017 libgstdeinterlace.so
-rwxr-xr-x 1 root root  93408 Oct 17  2017 libgstdtls.so
-rwxr-xr-x 1 root root  49912 Mar  9  2017 libgstdtmf.so
-rwxr-xr-x 1 root root 130976 Oct 17  2017 libgstdvb.so
-rwxr-xr-x 1 root root  45240 Oct 17  2017 libgstdvdread.so
-rwxr-xr-x 1 root root  58560 Mar  9  2017 libgstdv.so
-rwxr-xr-x 1 root root  59144 Mar  9  2017 libgsteffectv.so
-rwxr-xr-x 1 root root  70136 Jun  8  2018 libgstencodebin.so
-rwxr-xr-x 1 root root  32632 Mar  9  2017 libgstequalizer.so
-rwxr-xr-x 1 root root  20072 Oct 17  2017 libgstfestival.so
-rwxr-xr-x 1 root root  36992 Oct 17  2017 libgstfieldanalysis.so
-rwxr-xr-x 1 root root  71312 Mar  9  2017 libgstflac.so
-rwxr-xr-x 1 root root 117096 Mar  9  2017 libgstflv.so
-rwxr-xr-x 1 root root  24232 Oct 17  2017 libgstfreeverb.so
-rwxr-xr-x 1 root root  49984 Oct 17  2017 libgstfrei0r.so
-rwxr-xr-x 1 root root  33592 Oct 17  2017 libgstgaudieffects.so
-rwxr-xr-x 1 root root  45968 Mar  9  2017 libgstgdkpixbuf.so
-rwxr-xr-x 1 root root  45608 Oct 17  2017 libgstgdp.so
-rwxr-xr-x 1 root root  58192 Oct 17  2017 libgstgeometrictransform.so
-rwxr-xr-x 1 root root  48824 Jun  8  2018 libgstgio.so
-rwxr-xr-x 1 root root  19984 Mar  9  2017 libgstgoom2k1.so
-rwxr-xr-x 1 root root  92552 Mar  9  2017 libgstgoom.so
-rwxr-xr-x 1 root root  20224 Oct 17  2017 libgstgsm.so
-rwxr-xr-x 1 root root  50424 Oct 17  2017 libgstgtksink.so
-rwxr-xr-x 1 root root  79536 Oct 17  2017 libgsthls.so
-rwxr-xr-x 1 root root  24464 Mar  9  2017 libgsticydemux.so
-rwxr-xr-x 1 root root  15816 Mar  9  2017 libgstid3demux.so
-rwxr-xr-x 1 root root  41208 Oct 17  2017 libgstid3tag.so
-rwxr-xr-x 1 root root  28680 Mar  9  2017 libgstimagefreeze.so
-rwxr-xr-x 1 root root  28600 Oct 17  2017 libgstinterlace.so
-rwxr-xr-x 1 root root  50208 Mar  9  2017 libgstinterleave.so
-rwxr-xr-x 1 root root  45832 Oct 17  2017 libgstinter.so
-rwxr-xr-x 1 root root 463424 Mar  9  2017 libgstisomp4.so
-rwxr-xr-x 1 root root  15872 Oct 17  2017 libgstivfparse.so
-rwxr-xr-x 1 root root  24392 Oct 17  2017 libgstivtc.so
-rwxr-xr-x 1 root root  40936 Oct 17  2017 libgstjp2kdecimator.so
-rwxr-xr-x 1 root root  37160 Oct 17  2017 libgstjpegformat.so
-rwxr-xr-x 1 root root  45696 Mar  9  2017 libgstjpeg.so
-rwxr-xr-x 1 root root  45792 Oct 17  2017 libgstkmssink.so
-rwxr-xr-x 1 root root  49880 Oct 17  2017 libgstladspa.so
-rwxr-xr-x 1 root root  24320 Mar  9  2017 libgstlevel.so
-rwxr-xr-x 1 root root  19656 Jun  8  2018 libgstlibvisual.so
-rwxr-xr-x 1 root root 292000 Mar  9  2017 libgstmatroska.so
-rwxr-xr-x 1 root root  32944 Oct 17  2017 libgstmidi.so
-rwxr-xr-x 1 root root  86768 Oct 17  2017 libgstmpegpsdemux.so
-rwxr-xr-x 1 root root  49480 Oct 17  2017 libgstmpegpsmux.so
-rwxr-xr-x 1 root root 162664 Oct 17  2017 libgstmpegtsdemux.so
-rwxr-xr-x 1 root root  71072 Oct 17  2017 libgstmpegtsmux.so
-rwxr-xr-x 1 root root  24272 Oct 17  2017 libgstmpg123.so
-rwxr-xr-x 1 root root  16064 Mar  9  2017 libgstmulaw.so
-rwxr-xr-x 1 root root 138928 Mar  9  2017 libgstmultifile.so
-rwxr-xr-x 1 root root  33160 Mar  9  2017 libgstmultipart.so
-rwxr-xr-x 1 root root  28720 Oct 17  2017 libgstmusepack.so
-rwxr-xr-x 1 root root 309528 Oct 17  2017 libgstmxf.so
-rwxr-xr-x 1 root root  11704 Mar  9  2017 libgstnavigationtest.so
-rwxr-xr-x 1 root root  20344 Oct 17  2017 libgstnetsim.so
-rwxr-xr-x 1 root root 227432 Jun  8  2018 libgstogg.so
-rwxr-xr-x 1 root root 283088 Oct 17  2017 libgstopengl.so
-rwxr-xr-x 1 root root  15928 Oct 17  2017 libgstopusparse.so
-rwxr-xr-x 1 root root  57176 Jun  8  2018 libgstopus.so
-rwxr-xr-x 1 root root  49352 Mar  9  2017 libgstoss4audio.so
-rwxr-xr-x 1 root root  36888 Mar  9  2017 libgstossaudio.so
-rwxr-xr-x 1 root root  81984 Jun  8  2018 libgstpango.so
-rwxr-xr-x 1 root root  24600 Oct 17  2017 libgstpcapparse.so
-rwxr-xr-x 1 root root 535768 Jun  8  2018 libgstplayback.so
-rwxr-xr-x 1 root root  33200 Mar  9  2017 libgstpng.so
-rwxr-xr-x 1 root root  28720 Oct 17  2017 libgstpnm.so
-rwxr-xr-x 1 root root 113224 Mar  9  2017 libgstpulse.so
-rwxr-xr-x 1 root root  67072 Oct 17  2017 libgstrawparse.so
-rwxr-xr-x 1 root root  15864 Oct 17  2017 libgstremovesilence.so
-rwxr-xr-x 1 root root  41424 Mar  9  2017 libgstreplaygain.so
-rwxr-xr-x 1 root root 176632 Oct 17  2017 libgstresindvd.so
-rwxr-xr-x 1 root root  49496 Oct 17  2017 libgstrfbsrc.so
-rwxr-xr-x 1 root root  28840 Oct 17  2017 libgstrsvg.so
-rwxr-xr-x 1 root root 353384 Mar  9  2017 libgstrtpmanager.so
-rwxr-xr-x 1 root root  24600 Oct 17  2017 libgstrtponvif.so
-rwxr-xr-x 1 root root 514768 Mar  9  2017 libgstrtp.so
-rwxr-xr-x 1 root root 155224 Mar  9  2017 libgstrtsp.so
-rwxr-xr-x 1 root root  41672 Oct 17  2017 libgstsdpelem.so
-rwxr-xr-x 1 root root  24448 Oct 17  2017 libgstsegmentclip.so
-rwxr-xr-x 1 root root  32808 Mar  9  2017 libgstshapewipe.so
-rwxr-xr-x 1 root root  50200 Oct 17  2017 libgstshm.so
-rwxr-xr-x 1 root root  28608 Mar  9  2017 libgstshout2.so
-rwxr-xr-x 1 root root  15776 Oct 17  2017 libgstsmooth.so
-rwxr-xr-x 1 root root  37512 Oct 17  2017 libgstsmoothstreaming.so
-rwxr-xr-x 1 root root  74520 Mar  9  2017 libgstsmpte.so
-rwxr-xr-x 1 root root  33024 Oct 17  2017 libgstsndfile.so
-rwxr-xr-x 1 root root  31760 Oct 17  2017 libgstsoundtouch.so
-rwxr-xr-x 1 root root  71176 Mar  9  2017 libgstsouphttpsrc.so
-rwxr-xr-x 1 root root  28400 Mar  9  2017 libgstspectrum.so
-rwxr-xr-x 1 root root  20160 Oct 17  2017 libgstspeed.so
-rwxr-xr-x 1 root root  41640 Mar  9  2017 libgstspeex.so
-rwxr-xr-x 1 root root  59016 Oct 17  2017 libgstsrtp.so
-rwxr-xr-x 1 root root  11504 Oct 17  2017 libgststereo.so
-rwxr-xr-x 1 root root  20288 Oct 17  2017 libgstsubenc.so
-rwxr-xr-x 1 root root  82424 Jun  8  2018 libgstsubparse.so
-rwxr-xr-x 1 root root  44360 Mar  9  2017 libgsttaglib.so
-rwxr-xr-x 1 root root 115360 Jun  8  2018 libgsttcp.so
-rwxr-xr-x 1 root root  61320 Jun  8  2018 libgsttheora.so
-rwxr-xr-x 1 root root  33152 Oct 17  2017 libgsttimecode.so
-rwxr-xr-x 1 root root  99752 Jun  8  2018 libgsttypefindfunctions.so
-rwxr-xr-x 1 root root  79352 Mar  9  2017 libgstudp.so
-rwxr-xr-x 1 root root 688824 Aug 31  2018 libgstvaapi.so
-rwxr-xr-x 1 root root  20184 Oct 17  2017 libgstvcdsrc.so
-rwxr-xr-x 1 root root 247096 Mar  9  2017 libgstvideo4linux2.so
-rwxr-xr-x 1 root root  65704 Mar  9  2017 libgstvideobox.so
-rwxr-xr-x 1 root root  23816 Jun  8  2018 libgstvideoconvert.so
-rwxr-xr-x 1 root root  32960 Mar  9  2017 libgstvideocrop.so
-rwxr-xr-x 1 root root  19896 Oct 17  2017 libgstvideofiltersbad.so
-rwxr-xr-x 1 root root  54128 Mar  9  2017 libgstvideofilter.so
-rwxr-xr-x 1 root root  28800 Oct 17  2017 libgstvideoframe_audiolevel.so
-rwxr-xr-x 1 root root  91792 Mar  9  2017 libgstvideomixer.so
-rwxr-xr-x 1 root root 209440 Oct 17  2017 libgstvideoparsersbad.so
-rwxr-xr-x 1 root root  36192 Jun  8  2018 libgstvideorate.so
-rwxr-xr-x 1 root root  31912 Jun  8  2018 libgstvideoscale.so
-rwxr-xr-x 1 root root  28224 Oct 17  2017 libgstvideosignal.so
-rwxr-xr-x 1 root root  52888 Jun  8  2018 libgstvideotestsrc.so
-rwxr-xr-x 1 root root  24240 Oct 17  2017 libgstvmnc.so
-rwxr-xr-x 1 root root  32248 Jun  8  2018 libgstvolume.so
-rwxr-xr-x 1 root root  53136 Jun  8  2018 libgstvorbis.so
-rwxr-xr-x 1 root root  71208 Mar  9  2017 libgstvpx.so
-rwxr-xr-x 1 root root  33056 Mar  9  2017 libgstwavenc.so
-rwxr-xr-x 1 root root  45760 Mar  9  2017 libgstwavpack.so
-rwxr-xr-x 1 root root  62232 Mar  9  2017 libgstwavparse.so
-rwxr-xr-x 1 root root  57064 Jun  8  2018 libgstximagesink.so
-rwxr-xr-x 1 root root  41432 Mar  9  2017 libgstximagesrc.so
-rwxr-xr-x 1 root root  20128 Oct 17  2017 libgstxingmux.so
-rwxr-xr-x 1 root root  73744 Jun  8  2018 libgstxvimagesink.so
-rwxr-xr-x 1 root root  28616 Oct 17  2017 libgsty4mdec.so
-rwxr-xr-x 1 root root  11680 Mar  9  2017 libgsty4menc.so
-rwxr-xr-x 1 root root  15928 Oct 17  2017 libgstyadif.so

The below error suggests Matlab cannot find the appropriate gstreamer-1.0
plugin on a .mp4 file created on a Mac with QuickTime.

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 at audiovideo.internal.IVideoReader(varargin{:});

Error in Apr12_ColorSampler_MatLAB (line 31)
    videoObject = VideoReader(videoFile);

Here is a gst-inspect to show we have the H264 codec installed:
gst-inspect-1.0 | grep -i 264
rtp:  rtph264pay: RTP H264 payloader
rtp:  rtph264depay: RTP H264 depayloader
videoparsersbad:  h264parse: H.264 parser
typefindfunctions: video/x-h264: h264, x264, 264

Using the sample xylophone.mp4 test file that is built into Matlab check
out these results:

gst-launch-1.0 playbin uri=file:///tmp/xylophone.mp4 video-sink=appsink
audio-sink=fakesink text-sink=fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
DtsGetHWFeatures: Create File Failed
DtsGetHWFeatures: Create File Failed
Running DIL (3.22.0) Version
DtsDeviceOpen: Opening HW in mode 0
DtsDeviceOpen: Create File Failed
Missing element: H.264 (Main Profile) decoder
WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
No decoder available for type 'video/x-h264, stream-format=(string)avc,
alignment=(string)au, level=(string)1.3, profile=(string)main,
codec_data=(buffer)014d400dffe1000b674d400d96540a0f98080401000468ce3c80,
width=(int)320, height=(int)240, framerate=(fraction)30/1,
pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true'.
Additional debug info:
gsturidecodebin.c(938): unknown_type_cb ():
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
Your GStreamer installation is missing a plug-in.
Additional debug info:
gsturidecodebin.c(1005): no_more_pads_full ():
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstdecodebin2.c(4592): gst_decode_bin_expose ():
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Couldn't set bcmdec0 to READY

ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Now on the mp4 file we have:
gst-launch-1.0 playbin
uri=file:///moto/home/rk3199/testMatLAB/ColorSamplingVideo_May23.mp4
video-sink=appsink audio-sink=fakesink text-sink=fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Missing element: MPEG-4 Video (Simple Profile) decoder
WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
No decoder available for type 'video/mpeg, mpegversion=(int)4,
systemstream=(boolean)false, profile=(string)simple, level=(string)1,
codec_data=(buffer)000001b001000001b58913000001000000012000c48d8801952804421463000001b24c61766335372e362e313030,
width=(int)1280, height=(int)528, framerate=(fraction)50/1,
pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true'.
Additional debug info:
gsturidecodebin.c(938): unknown_type_cb ():
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
Your GStreamer installation is missing a plug-in.
Additional debug info:
gsturidecodebin.c(1005): no_more_pads_full ():
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstdecodebin2.c(4592): gst_decode_bin_expose ():
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: MPEG-4 Video (Simple Profile) (video/mpeg,
mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple,
level=(string)1,
codec_data=(buffer)000001b001000001b58913000001000000012000c48d8801952804421463000001b24c61766335372e362e313030,
width=(int)1280, height=(int)528, framerate=(fraction)50/1,
pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true)

ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

The env variable is still set to:
echo $GST_PLUGIN_PATH
/usr/lib64/gstreamer-1.0

The Matlab script runs just fine on Matlab on a Mac and Windows 10. I'm
happy to share both the xylophone test mp4 as well as our mp4 file. Is
there really a missing plugin or does another ENV variable need setting?
Math Works support says this is out of scope from their support, which is
pretty lame as this toolbox clearly isn't working on Linux/RHEL 7.

Thanks,

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220630/531d8044/attachment-0001.htm>


More information about the gstreamer-devel mailing list