I’m trying to make unity show rtsp video using opencv. I made custom dll using c++, which uses opencv dll.
What I need now is to use dll in unity to display rtsp, but I’m getting some weird error.
Is there any solutions to stop this error?
If not, is there any way to transfer cv::Mat to unity data type?
below is the error
MarshalDirectiveException: Type OpenCvSharp.DisposableObject which is passed to unmanaged code must have a StructLayout attribute.
My code for c# is :
[DllImport("OpenCVDll")]
private static extern void PlayRTSP(ref Mat rawImage, IntPtr rtspLink);
code for c++ is :
extern "C" __declspec(dllexport) void PlayRTSP(cv::Mat rawImage, LPCSTR rtspLink){}
Tried using OpenCVSharp, which caused error..
Why doesn’t unity support rtsp?…….Really need that support badly 🙁
erin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.