RtspClientSharp icon indicating copy to clipboard operation
RtspClientSharp copied to clipboard

Native libs for Linux

Open dtjensen opened this issue 6 years ago • 12 comments

I want to run this project using dotnet core on on an Ubuntu 18.04 machine. Is it possible to get a x64 build of the libs for that platform? When I I use the current .dlls, the dotnet runtime can't find the lib. I think the module/export defs are different from Windows to Linux.

If you don't have time to do this, any instructions you can give me on how to do it would be appreciated.

dtjensen avatar Aug 12 '19 22:08 dtjensen

Hi,

Please try latest version of nuget. It should work perfect because it doesn't contains external dependencies.

BogdanovKirill avatar Aug 13 '19 08:08 BogdanovKirill

That's great news! Can you point me to the new C# classes that replace the old external references? I'm attempting to create jpeg snapshots from the h.264 stream.

dtjensen avatar Aug 13 '19 14:08 dtjensen

I don't understand your question. Just get it from nuget: https://www.nuget.org/packages/RtspClientSharp If you mean that want to use projects from examples folder undex linux then you should compile unmanaged projects by yourself

BogdanovKirill avatar Aug 13 '19 14:08 BogdanovKirill

I am looking for examples of how to leverage the new libraries. For instance, how would this call change - FFmpegVideoPInvoke.CreateVideoDecoder(videoCodecId, out IntPtr decoderPtr) if the external dependencies are gone.

dtjensen avatar Aug 13 '19 14:08 dtjensen

You can't remove this call because in another case you should write decoders on pure c#. This is unreal and meaningless. Just compile FFmpeg to use it under linux

BogdanovKirill avatar Aug 13 '19 14:08 BogdanovKirill

I'm confused. Sorry for the basic questions... but, if the external dependencies are gone and there is no need for the libffmpeghelper.dll anymore, what C# code would I write to create the FFmegVideoDecoder class to try and decode the h.264 video? That class is still dependent on that external lib from what I can tell in the latest version of the code. I must be missing something...

dtjensen avatar Aug 13 '19 14:08 dtjensen

I mean that RtspClientSharp project doesn't require external dependencies. But frame decoding/rendering processes are not included. I just wrote some example applications to show how to use this project. This examples have unmanaged dependencies which cannot be excluded easily.

BogdanovKirill avatar Aug 13 '19 14:08 BogdanovKirill

Thanks for the quick responses. So, if I need to decode the h.264 stream to create jpeg snapshots, I still have to rely on the platform libraries like ffmpeg or possibly the external lib you wrote.

If that's the case, is the code for all the libs the libffmpeghelper requires (avcodec, avdevice, etc.) available for me to compile on Linux - I only see the libffmpeghelper code in the project? If that code is not available, then I will have to figure out how to write the C# interop code that can leverage ffmpeg on Linux directly.

Is that accurate?

dtjensen avatar Aug 13 '19 15:08 dtjensen

Thanks for the quick responses. So, if I need to decode the h.264 stream to create jpeg snapshots, I still have to rely on the platform libraries like ffmpeg or possibly the external lib you wrote.

Yes, you are right.

If that's the case, is the code for all the libs the libffmpeghelper requires (avcodec, avdevice, etc.) available for me to compile on Linux - I only see the libffmpeghelper code in the project? If that code is not available, then I will have to figure out how to write the C# interop code that can leverage ffmpeg on Linux directly.

You need to recompile libffmpeghelper for linux using GCC and make file. And then you can use without any modification this C# code.

BogdanovKirill avatar Aug 13 '19 15:08 BogdanovKirill

Hi! Can you tell me how can I compile it in Linux? Thanks!

neumartin avatar Aug 18 '19 06:08 neumartin

Hi guys! I posted a fork for .NET Core 3 and libffmpeghelper for Linux: https://github.com/i-TechSoftware/RtspClientSharpCore

i-TechSoftware avatar Oct 24 '19 07:10 i-TechSoftware

@i-TechSoftware

Great work!

BogdanovKirill avatar Oct 29 '19 10:10 BogdanovKirill