RtspClientSharp icon indicating copy to clipboard operation
RtspClientSharp copied to clipboard

System.DllNotFoundException in VS2019

Open sivashakthi opened this issue 6 years ago • 12 comments
trafficstars

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!

sivashakthi avatar Nov 17 '19 03:11 sivashakthi

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.

ren-bettendorf avatar Nov 26 '19 23:11 ren-bettendorf

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.

RandDruid avatar Nov 28 '19 12:11 RandDruid

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

rnpramasamy avatar Jan 28 '20 01:01 rnpramasamy

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

toby11 avatar Feb 02 '20 19:02 toby11

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

toby11 avatar Feb 02 '20 21:02 toby11

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

rsoltesz avatar Feb 14 '20 14:02 rsoltesz

I think it was the ones in here

Examples/libffmpeghelper/lib/x64

Or x32 depending on your build type

toby11 avatar Feb 14 '20 16:02 toby11

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

rsoltesz avatar Feb 20 '20 16:02 rsoltesz

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

KthProg avatar Jul 01 '20 17:07 KthProg

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

toby11 avatar Jul 01 '20 17:07 toby11

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.

KthProg avatar Jul 01 '20 20:07 KthProg

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.

victor-david avatar Jul 22 '20 15:07 victor-david