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 16:10:57 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
Some of the files in here:
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 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
Here is:
pkg-config --variable pc_path pkg-config
/usr/lib64/pkgconfig:/usr/share/pkgconfig
The Matlab script runs just fine on Matlab on a Mac and Windows 10. 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.
Here is the xylophone.mp4 file from Matlab
https://drive.google.com/file/d/1bQ8cZ9g9rh7Z2Uu_kL_dqWTGDZeXxoiJ/view?usp=sharing
Thanks,
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220630/deac5a17/attachment-0001.htm>
More information about the gstreamer-devel
mailing list