RtspClientSharp
RtspClientSharp copied to clipboard
Unable to load DLL 'libffmpeghelper.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Describe the bug I cloned the repository, opened in VS 2019 and installed the Windows SDK that was missing. When running the player I am getting the error: System.DllNotFoundException: 'Unable to load DLL 'libffmpeghelper.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)' For some reason the libffmpeghelper.dll is not automatically copied to the players bin/debug folder? I tried to copy it manually, but I am still getting above error.
To Reproduce Clone repo. Build the solution and run the SimpleRtspPlayer sample. Type correct device address, login and password and click Start button. The code fails at FFmpegVideoDecoder.cs line 37: int resultCode = FFmpegVideoPInvoke.CreateVideoDecoder(videoCodecId, out IntPtr decoderPtr);
Expected behavior That the video would just play
Desktop (please complete the following information):
- OS: Windows 10
Hi I have the same problem.... Did anyone manage to solve that?
I managed to solve it. You need to set the C++ project to 64 bit. Right click the libffmpeghelper in Visual Studio and select Proerties. Then at the top right, change platform to x64. It should then work
After Compiling The libffmpeghelper. Where should I put the DLL to C# project found it? I still get the same error!
It should be automatically included in the C# project, but if not copy it to the bin/debug or bin/release folder.
I did what you said. Still get the same error. I don't know what I'm doing wrong. And I'm Using Asp.net Core 5 on Windows 10
I manage to Solve it 👍 in my case, I need to copy the X64 Folder in the same directory as libffmpeghelper.dll
Still cannot work!
For me it was the post-build script that copies various DLLs to the build directory that was failing. XCOPY is temperamental and if you have spaces in the path it complains. The solution was to put quotes around the paths:
xcopy "$(ProjectDir)x64*.dll" "$(TargetDir)" /Y /E /C /F xcopy "$(ProjectDir)..\libffmpeghelper\x64$(Configuration)\libffmpeghelper.dll" "$(TargetDir)" /Y /E /C /F
@nshiggins thanks for your instructions. It works but showing another error:
"RtspClientSharp.Rtsp.RtspClientException: Receive error --->
System.BadImageFormatException: An attempt was made to load a program with an incorrect format.
(Exception from HRESULT: 0x8007000B)\r\n at SimpleRtspPlayer.RawFramesDecoding.FFmpeg.FFmpegAudioPInvoke.CreateAudioDecoder
(FFmpegAudioCodecId audioCodecId, Int32 bitsPerCodedSample, IntPtr& handle)\r\n
at SimpleRtspPlayer.RawFramesDecoding.FFmpeg.FFmpegAudioDecoder.CreateDecoder(FFmpegAudioCodecId audioCodecId, Int32 bitsPerCodedSample)
in....\\Examples\\SimpleRtspPlayer\\RawFramesDecoding\\FFmpeg\\FFmpegAudioDecoder.cs:line 38
@aslamiqbal Sounds like you compiled the project for 64 bit and copied a 32 bit ffmpeg dll file or vise versa. Or you compiled executeable for 64 bit and your Windows is 32 bits.
Here to revive this thread as I've run into this issue trying to build my own project. Tried following @danelec-hpm steps but still getting the same issue. RtspClientSharp.Rtsp.RtspClientException: Receive error ---> System.DllNotFoundException: Unable to load DLL 'libffmpeghelper.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E).