BogdanovKirill / RtspClientSharp

Pure C# RTSP client for .NET Standard without external dependencies and with true async nature. I welcome contributions.
MIT License
706 stars 284 forks source link

System.DllNotFoundException in VS2019 #70

Open sivashakthi opened 4 years ago

sivashakthi commented 4 years ago

I closed the repository and ran the examples. SimpleRtspPlayer seems to be connecting and receiving frames (using rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov to test). But the frames are not displayed on the screen, and I get the following errors in the Output window:

Exception thrown: 'System.DllNotFoundException' in SimpleRtspPlayer.exe The thread 0x4368 has exited with code 0 (0x0). Exception thrown: 'RtspClientSharp.Rtsp.RtspClientException' in RtspClientSharp.dll Exception thrown: 'RtspClientSharp.Rtsp.RtspClientException' in RtspClientSharp.dll Exception thrown: 'System.ObjectDisposedException' in mscorlib.dll Exception thrown: 'System.DllNotFoundException' in mscorlib.dll Exception thrown: 'RtspClientSharp.Rtsp.RtspClientException' in mscorlib.dll The thread 0x4074 has exited with code 0 (0x0). The thread 0x1548 has exited with code 0 (0x0).

Using Visual Studio 19 on a Windows 10 machine. Changed the libffmpeghelper library settings to the following.

image

Any pointers will be greatly appreciated.

Thanks!

ren-bettendorf commented 4 years ago

I'm running into a similar problem with VS 2017 where it tells me the build failed with "Object reference not set to an instance of an object". Not sure what else I could do to further debug this.

RandDruid commented 4 years ago

You can use dependency walker for static analysis, or Process Explorer to check DLL's loading requests in running app. In this project, I think, it is ffmpeg related. Libs are in a wrong place or ffmpeg was compiled with VC runtime not installed on your PC.

rnpramasamy commented 4 years ago

Please try below command dumpbin /dependents your_dll_file.dll

Copy missing DLLs to debug or release folder and then try to run project again

toby11 commented 4 years ago

@sivashakthi did you get this working? I have the same problem on a fresh clone of the respository.

toby11 commented 4 years ago

@sivashakthi got it working, just needed to copy the codec dlls into the output directory

rsoltesz commented 4 years ago

@toby11 Which codec dlls did you copy over? I am still having this error.

toby11 commented 4 years ago

I think it was the ones in here

Examples/libffmpeghelper/lib/x64

Or x32 depending on your build type

rsoltesz commented 4 years ago

I found that part of my issue was not having the DLLs from my installation of ffmpeg.

KthProg commented 4 years ago

I'm getting this issue and I don't understand the resolution

toby11 commented 4 years ago

I copied all the files from Examples/libffmpeghelper/lib/x64 To the build directory and it fixed it. It was missing the ffmpeg dlls

KthProg commented 4 years ago

I had to copy everything from SimpleRtspPlayer/x86 to the Debug folder, I'm guessing the organization of the files has changed since this issue was posted.

victor-david commented 4 years ago

I added a post-build event to project SimpleRtspPlayer:

copy $(ProjectDir)$(PlatformName)\*.dll $(TargetDir)
copy $(ProjectDir)..\libffmpeghelper\$(PlatformName)\$(ConfigurationName)\libffmpeghelper.dll $(TargetDir)

This simplifies things for me because my bin directories get cleaned out during a backup and I don't have to keep copying the files manually. But you can't build SimpleRtspPlayer using Any Cpu or else $(PlaformName) won't point to a valid directory. I used configuration manager to specify that SimpleRtspPlayer use x86 when the solution platform is set to Any Cpu.