Can not read video in matlab - matlab

Hi I am having big trouble to read video using matlab in Ubuntu 16.04. When I try to read any format of video I get this error
Error using VideoFileReader/setup
Could not open the specified file.
I have installed all the gstreamer plugin to and I have changed matlabroot/sys/os/glnxa64/libstdc++.so.6 with my /usr/lib/x86_64-linux-gnu/libstdc++.so.6
Last time when I installed matlab in my Ubuntu system the above method solved the problem but this time no work. I need help.
Sometimes i used to get this error to:
Error using dspmmfileinfo>tryVideoReader (line 278)
Failed to initialize internal resources. The specified file is:
/home/mofiqul/repos-git/Image-Processing/matlab/multi-object-tracking/video4.avi
Error in dspmmfileinfo>getFileInfo (line 180)
[hasAudio,hasVideo,videoFPSComputed,videoFramesPerSecond, ...
Error in dspmmfileinfo (line 40)
cache.fileInfo(index) = {getFileInfo(filename)};
Error in vision.VideoFileReader/setFileInfoProps (line 349)
Error in vision.VideoFileReader/set.Filename (line 150)
Error in matlab.system.SystemProp/parseInputs (line 908)
Error in matlab.system.SystemProp/sysObjSetProperties (line 298)
Error in vision.VideoFileReader (line 133)

Related

An error caused by imread() function in AppDesigner in Matlab

I'm using AppDesigner in MATLAB, and whenever I use imread() function inside a button this error message displays:
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 335)
Error while evaluating Button PrivateButtonPushedFcn.
When I put a breakpoint on imread() line I found the entire error message:
Caught "std::exception" Exception message is:
Bundle#166 start failed: Loading C:\Program Files\MATLAB\R2019b\bin\win64\builtins\matlab_toolbox_iofun_builtins\mwmlxcodereader_builtinimpl.dllfailed with error: The specified module could not be found.

Matconvnet showing error while atttempting to parapool

I am attempting to run the mnist example in matconvnet using parapooling. I have allocated 2 gpus, but it shows this error while trying to run cnn_mnist_experiments:
Error using cnn_train>(spmd) (line 157)
Error detected on workers 1 2.
Error in cnn_train (line 157)
spmd
Error in cnn_mnist (line 55)
[net, info] = trainfn(net, imdb, getBatch(opts), ...
Error in cnn_mnist_experiments (line 3)
[net_bn, info_bn] = cnn_mnist(...
Caused by:
Error using ParameterServer/startWithMMap (line 170)
An UndefinedFunction error was thrown on the workers for 'vl_cudatool'. This may be because the
file containing 'vl_cudatool' is not accessible on the workers. Specify the required files for
this parallel pool using the command: addAttachedFiles(pool, ...). See the documentation for
parpool for more details.
Undefined function 'vl_cudatool' for input arguments of type 'single'.
Error using ParameterServer/startWithMMap (line 170)
An UndefinedFunction error was thrown on the workers for 'vl_cudatool'. This may be because the
file containing 'vl_cudatool' is not accessible on the workers. Specify the required files for
this parallel pool using the command: addAttachedFiles(pool, ...). See the documentation for
parpool for more details.
Undefined function 'vl_cudatool' for input arguments of type 'single'.
Apparently, the workers cannot get access to "vl_cudatool" file. What could be the issue here?
Undefined function 'vl_cudatool' for input arguments of type 'single'.
It means that your vl_cudatool function is not in your path
try
which vl_cudatool
I don't know what vl_cudatool is. Maybe you can try some earlier version of MatConvNet?

Error using caffe Unknown command 'get_weights'

I run the demo code of RCNN with matcaffe, but I met an error which confused me for a while:
Error using caffe
Unknown command 'get_weights'
Error in rcnn_load_model (line 36)
rcnn_model.cnn.layers = caffe('get_weights');
Also, I check the directory of caffe matlab, there is not get_weights function. Do anyone know how to solve that? Thank you.

Why am I getting errors when I try to run the "Normalized cuts" demo?

I am trying to use the normalized cuts package from [http://www.cis.upenn.edu/~jshi/software/Ncut_9.zip][1] (on Windows 7 - MATLAB R2010a 32 bits), but it's not working. I'm trying to run the demo called "Ncut Clustering demo" and I got the following error:
??? Undefined function or method 'sparsifyc' for input arguments of type 'double'.
Error in ==> ncut at 41
W = sparsifyc(W,dataNcut.valeurMin);
Error in ==> ncutW at 9
[NcutEigenvectors,NcutEigenvalues] = ncut(W,nbcluster);
Error in ==> demoNcutClustering at 27
[NcutDiscrete,NcutEigenvectors,NcutEigenvalues] = ncutW(W,nbCluster);
I already put the NCUT9 dir in the path so this is not the problem I guess, and I already compile the MEX files with the command: compileDir_simple(mydir).

Opening grb2 files re-visited

I have downloaded and installed NCTOOLBOX into MATLAB (2013a) to read netcdf and grb files. As a test, I copied a netcdf, grb and grb2 file to a directory on my computer. This is placed within my script as:
pathnc = 'c:\test\era40_moda_200205.nc'
pathgrb = 'c:\test\era40_moda_200205.grb'
pathgrb2 = 'c:\test\multi_1.at_4m.dp.200607.grb2'
I used the following code to read the *.nc file:
nc = ncdataset(pathnc);
nc.variables
The code works great....with no error messages..and all variables listed..on netcdf files...... however, when I run it for the grb files using:
nc = ncdataset(pathgrb);
nc.variables
I get this very long list of errors:
2014-03-05 08:40:15,744 [main] WARN ucar.nc2.grib.grib2.Grib2Index - Grib2Index bad size = -1 for c:/test/multi_1.at_4m.dp.200607.grb2 index = c:\test\multi_1.at_4m.dp.200607.grb2.gbx9
Warning: Escape sequence '\m' is not valid. See 'help
sprintf' for valid escape sequences.
> In ncdataset>ncdataset.ncdataset at 89
In GRIB_and_NC_Reader_Prog at 14
Error using ncdataset (line 91)
Failed to open c: est
Error in GRIB_and_NC_Reader_Prog (line 14)
nc = ncdataset(pathgrb2);
Caused by:
Error using ncdataset (line 75)
Java exception occurred:
java.lang.RuntimeException: java.lang.NoSuchFieldError:
alwaysUseFieldBuilders...............etc, etc....ad nauseum...............
In case it was just a bad file, I tried the code on a different grb file and got the same results. Yes I have read the previous posts on reading grb with NCTOOLBOX...but still 'dead in the water.' I would greatly appreciate any insight to get my script reading grb and grb2 files.
I was getting a similar java error: java.lang.NoSuchFieldError:alwaysUseFieldBuilders. I tried running the same code in R2014a and it worked.