Installation Guide - ReferenceType/H264Sharp GitHub Wiki
Installation Guide
Library Structure
- The C++
H264SharpNative
dll(or .so) acts as OpenH264 wrapper/facade and color format converter - H264Sharp.dll is .Net Standard 2.0 wrapper library for
H264SharpNative
and performs PInvoke to handle transcoding. - H264SharpNative library is resolved by DllImport attribute i.e.
[DllImport(DllName, ...)]
- Cisco dll (i.e.
openh264-2.4.1-win64.dll
) is resolved and loaded on runtime which uses LoadLibraryW on Windows, dlopen with RTLD_LAZY on Linux from the native side.
Installation Methods
NuGet
Install the NuGet package. All native dependencies should be automatically installed and resolved.
- Tested on Windows, Linux, Linux ARM, Android MAUI app(x86 on emulator, Arm64 on Pixel phone).
From Pre-built Binaries
- Download the latest release
H264Sharp.dll
and platform native dependencies you require from Relases. - Reference
H264Sharp.dll
to your C# application - Include the native dependencies of your target platform to executable output directory, or include on build for android.
For usage in Unity, You have to specify the absolute path for cisco openh264 dll. (i.e. StreamingAssets)
Defines.CiscoDllName64bit = "{YourPath}/openh264-2.4.1-win64.dll";
// Or
H264Encoder encoder = new H264Encoder("CiscoDllPath");
H264Decoder decoder = new H264Decoder("CiscoDllPath");