Skip to content

Commit 7fc2749

Browse files
Update README.md
1 parent 361d593 commit 7fc2749

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
# H264Sharp
22
Cisco's OpenH264 C++/CLI wrapper in C# with optimised image format conversions. It is very suitable for realtime streaming.
3-
- Offers managed and unmanaged API.
4-
- Tested on .NetFramework and Net6.
3+
- Offers managed and unmanaged intuitive API.
4+
- Tested on .NetFramework and NetCore(upto 7).
55
- Compatible with OpenCV.(i.e. OpenCVsharp)
66
- Tested on WPF application with camera and screen capture (P2P Videocall).
7+
- No memory leaks or GC pressure with bitmaps.
78
- Simple console application example is provided on repo as an example.
89

910
### Setup
11+
- Empty Constructor will look for 32 or 64 bit openh264 dll with its default name automatically on executable directory(i.e. Debug/Release folder of your project).
12+
- You can setup with a different dll name, constructor is overloaded.
13+
1014
``` c#
1115
decoder = new H264Sharp.Decoder();
1216

1317
encoder = new H264Sharp.Encoder();
1418
encoder.Initialize(width, height, bps: 3_000_000, fps: 30, H264Sharp.Encoder.ConfigType.CameraBasic);
1519
```
16-
- Empty Constructor will look for 32 or 64 bit openh264 dll automatically on executable directory(i.e. Debug/Release folder of your project).
17-
- You can setup with a different dll name, constructor is overloaded.
1820

1921
### Encode
22+
- You can encode from rgb/rgba/bgr/bgra/yuv_i420 on as raw data format, or System.Drawing.Bitmaps.
23+
- Raw data is compatible with OpenCV Mats or any other standard image container.
24+
- EncodedFrame represents h264 encoded bytes(NALs etc).
2025
```C#
2126
if(encoder.Encode(bitmap, out EncodedFrame[] frames))
2227
{
@@ -28,12 +33,11 @@ Cisco's OpenH264 C++/CLI wrapper in C# with optimised image format conversions.
2833
}
2934
}
3035
```
31-
- You can encode rgb/rgba/bgr/bgra/yuv_i420 on as raw data format or System.Drawing.Bitmaps.
32-
- You have to determine startIndex, width height and stride values for your raw data images.
33-
- Raw data is compatible with OpenCV Mats.
34-
- EncodedFrame represents h264 encoded bytes(NALs etc).
36+
3537

3638
### Decode
39+
- You can decode with pointers or managed byte array as input.
40+
- You can decode into System.Drawing.Bitmaps or raw data format images (they are compatible with OpenCV Mats and any other standard image containers.).
3741
```C#
3842
void Decode(IntPtr data, int length, FrameType type)
3943
{
@@ -46,23 +50,24 @@ Cisco's OpenH264 C++/CLI wrapper in C# with optimised image format conversions.
4650
}
4751
}
4852
```
49-
- You can decode with pointers or managed byte array as input.
50-
- You can decode into System.Drawing.Bitmaps or raw data format images (they are compatible with OpenCV Mats).
53+
5154
# Converter dll
5255
A separate dll is provided for RGB <-> YUV conversions. Its compiled with clang LLVM and has AVX2 intrinsics.
5356
</br>You can optionally include it on your executable path just like Openh264 dll.
5457
</br>
55-
</br>If wrapper could not find the Converter32/64 dll it will fall back to use C++Cli versions.
56-
</br>External dll 2x+ faster than C++Cli convertors.
58+
</br>If wrapper cannot find the Converter32/64 dll it will fall back to use C++/Cli versions.
59+
</br>External dll 2x+ faster than C++/Cli versions.
5760

5861
# TLDR how to install
5962
- Go to my releases find lates version.
6063
- Reference/Include H264Sharp dll on your project.
6164
- Add `openh264-2.3.1-win32.dll` or `openh264-2.3.1-win64.dll` or both to your executable directory. (keep the original names if you want to use default constructor)
6265
- Optionally Add Converter64/32 dlls to your executable directory.
6366
# Remarks
64-
.Net Core and .Net Framework releases are provided.
65-
Use at least 2.3.1 version of openh264.(cisco has updated some data types, older versions might lead to stack buffer overflow).
67+
- Decode callbacks with raw image formats use cached backed buffer, if you wont consume them immediately, make a copy or sync your system.
68+
- Encoder output "EncodedFrame" uses cached back buffer if you wont consume them immediately, make a copy or sync your system.
69+
- .Net Core and .Net Framework releases are provided.
70+
- Use at least 2.3.1 version of openh264.(cisco has updated some data types, older versions might lead to stack buffer overflow).
6671

6772
- Download Cisco's [`openh264-2.3.1-win32.dll`](http://ciscobinary.openh264.org/openh264-2.3.1-win32.dll.bz2)
6873
- Download Cisco's [`openh264-2.3.1-win64.dll`](http://ciscobinary.openh264.org/openh264-2.3.1-win64.dll.bz2).

0 commit comments

Comments
 (0)