Segmentation Fault with Libvlc on Mac OSX - c++

I am using the exact same code as here. I just replaced the file reading part with this:
char* filename = "testVLC.mpg";
media = libvlc_media_new_path(vlcInstance, filename);
I get a segmentation fault at the second line above. The video file is in the same folder as the cpp file. Am I doing something wrong?

If you use libvlc v2.2 - you have to use slightly modified libvlc tree (I have one prepared, please extract it from command line, to preserve symlinks)
The problem is libvlc v2.2 has a bug which leads to load libvlccore by plugins from wrong place

Related

fopen() working with windows but giving issues in linux

I am trying to use fopen() in a program in which I am creating a new file and then using that file into another function. The function is created as follows:-
FILE* check=NULL;
check =fopen(convert_wchartoString(file_Name.c_str()).c_str(), "rb");
if(check==NULL)
{
cout<<"Unable to open";
}
Now, the issue is that fopen is returning NULL in linux but, in windows it is working. I am not sure why this issue is coming. I have debugged the value of file_name and it is coming fine on both the platforms. Please advice something which could be potentially wrong in this?
UPDATE:-
Seems like it is a path issue. Currently, the file_name has path to C:\files but when i try to run the same code in wsl, it doesn't work. The path in wsl is /mnt/c/files. But when trying to give this path to file_name. It is also not working. Is there any permission issues for the same or should I need to modify the path?

Segmentation fault with OpenALPR

I'm trying to install OpenALPR on Laravel Homestead (Ubuntu 18.04). First I tried The Easiest Way. I'm trying to run:
Error opening data file /usr/share/openalpr/runtime_data/ocr/lus.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'lus'
Tesseract couldn't load any languages!
Segmentation fault (core dumped)
I cd into /usr/share/openalpr/runtime_data/ocr directory, and I did not find the lus.traineddata file. But there was an ocr folder and there was a lus.traineddata. I copied it from there to the directory up, tried again to recognize but this time:
--(!) Runtime directory '/usr/share/openalpr/runtime_data' is invalid. Missing OCR data for the country: 'us'!
Error loading OpenALPR
Then I tried The Easy Way. Everything was compiled normally. But:
Segmentation fault (core dumped)
This happens because openALPR's Tesseract OCR expects its trained data in a specific path and the files are not there.
According to the error message it can be set using the TESSDATA_PREFIXenvironment variable but in my own experience didn't work.
I came accross with nother solution; it's not the best way but it may work.
I created a symbolic link from /usr/share/openalpr/runtime_data/ocr/tessdata/lus.traineddata to /usr/share/openalpr/runtime_data/ocr/lus.traineddata in order to make the trainedData files available to tesseract/openalpr right where they expect them.
sudo ln -s /usr/share/openalpr/runtime_data/ocr/tessdata/lus.traineddata /usr/share/openalpr/runtime_data/ocr/lus.traineddata
repeat the command changing lus with the desired language/region file (leu, lfr, ...)
Hope it helps
This is because the language trained data is in [runtime_data path]/ocr/tessdata/ in tesseract 4.0 unlike tesseract 3.0 which stores them in [runtime_data path]/ocr/.
This problem is fixed in this commit.
But it seems that the version of openalpr in the apt-get repository is behind this commit.
So the temporary solution is moving language data to [runtime_data path]/ocr like danielillu’s solution.
Since ‘us’ country config only require lus.traineddata file, you only need to move lus.traineddata file.

invalid board header windows

I am trying to process a binary file generated by a PSI DRS4 for work. I tried this using a C++ code given in the src folder of the software used to run the board.
A friend of mine compiled and executed this code on his linux computer just fine. I wanted to adapt this code to windows. I went through the compilation step pretty easily but then when I try to execute it, it just crashes...
After some further investigation, what I understand is that the header(s) cannot be read properly (probably leading to the crash when they're supposed to be used later in the code)
I thus tried to read the file with HexEditor Neo and here is what I get: screenshot binary file Hexeditor
As you see the part after EHEADER becomes unreadable... Is it normal? Has anyone faced this situation before ?

NITE2::UserTracker crashes when reading from oni files

I have recorded an oni file using a kinect and OpenNI NIViewer.
I want to track skeletons in that record file so I am using OpenNI2 and NITE2
I can create an openi device with the oni file but when I try to create a nite2 user tracker using that device it crashes and I get the following error:
0xC0000005: Access violation reading location 0x000000000000004c
On the cmd window I got the following message:
Couldn't getXN_STREAM_PROPERTY_PARAM_COEFF
Here is my code:
openni::Status rc = openni::OpenNI::initialize();
openni::Device device ;
rc = device.open("file.oni");
nite::UserTracker userTracker;
nite::NiTE::initialize();
niteRc = userTracker.create(&device);
Any Help is largely appreciated.
Could you please also advise if there are any other ways to track selections in recorded oni files?
Regards
I also experienced your same problem.
I recorded the oni files with the OpenNI2 sample NiViewer. The recorded file can be loaded using NiViewer itself (therefore the file is not corrupt), but if I try to open the saved file with the Nite2 sample UserViewer, I experience your same error.
The only way I've found to solve the problem id downgrading from Nite 2.2 to Nite 2.0 (as suggested in Creating a UserTracker crashes in NITE2 python bindings)
The strange thing is that I tested this saving/loading procedure with both Kinect and Asus Xtion, but I had this problem only with Kinect savings.

pcl::MovingLeastSquares doesn't work

I'm new to PCL and I'm trying to do this tutorialhere. The problem is that I can compile it, but when I run this, it give me an error: *exception at 0x000007fefd27940d in pcl_VFHexperiment.exe: Microsoft C++ exception: pcl::IOException at memory location 0x001cf0e0*
I guess the problem is that mls. process function doesn't work correctly and the operation of file saving provides an error.
Could be the input file the problem? I use ism_test_cat.pcd file found here. I don't know where the file suggested in the tutorial is. How should the input file be?
Anyway I can see ism_test_cat.pcd file in the viewer following the other tutorial.
How to solve? Please help me.
I use VS2010, PCL 1.6, all 64bit
Thanks in advance a lots
"You should be able to find the input file at pcl/test/bun0.pcd." It says in the tutorial.