Skip to content

Commit 7be2102

Browse files
committed
2 parents 6cd2d8f + b1198c4 commit 7be2102

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# H264Sharp
22
Cisco's OpenH264 C++/CLI wrapper with optimised image format conversion support. It is very suitable for realtime streaming over network.
33
- Offers managed and unmanaged API.
4-
- Tested on .NetFramework and NetCore(up to 7).
4+
- Tested on .NetFramework and NetCore(up to 8).
55
- Compatible with OpenCV.(i.e. OpenCVsharp)
66
- Tested on WPF application with camera and screen capture (P2P Videocall).
77
- No memory leaks or GC pressure with bitmaps.
8-
- Simple console application example is provided on repo as an example.
8+
- Simple console application example is provided as an example.
99

1010
### Setup
11-
- Default Constructor will look for `openh264-2.3.1-win32.dll` or `openh264-2.3.1-win64.dll` automatically on executable directory depending on process type.
11+
- Default Constructor will look for `openh264-2.3.1-win32.dll` or `openh264-2.3.1-win64.dll` automatically on executable directory depending on process type(64/32 bit).
1212
- You can setup with a different dll name, constructor is overloaded.
1313
``` c#
1414
decoder = new H264Sharp.Decoder();
1515

1616
encoder = new H264Sharp.Encoder();
17-
encoder.Initialize(width, height, bps: 3_000_000, fps: 30, H264Sharp.Encoder.ConfigType.CameraBasic);
17+
encoder.Initialize(width,
18+
height,
19+
bps: 3_000_000,
20+
fps: 30,
21+
H264Sharp.Encoder.ConfigType.CameraBasic);
1822
```
1923

2024
### Encode
@@ -26,9 +30,12 @@ Cisco's OpenH264 C++/CLI wrapper with optimised image format conversion support.
2630
{
2731
foreach (var frame in frames)
2832
{
29-
//hints..
33+
//You can convert to managed array
3034
//byte[] b = frame.ToByteArray();
35+
36+
// You can copy to Managed array
3137
//frame.CopyTo(buffer, 0);
38+
3239
Decode(frame.Data, frame.Length, frame.Type);
3340
}
3441
}
@@ -41,30 +48,33 @@ Cisco's OpenH264 C++/CLI wrapper with optimised image format conversion support.
4148
```C#
4249
void Decode(IntPtr data, int length, FrameType type)
4350
{
44-
//if (decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out RgbImage rgb))
45-
//if (decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out Yuv420p yuv420))
4651
if (decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out Bitmap bmp))
4752
{
4853
// Do stuff..
4954
// bmp.Save("t.bmp");
5055
}
5156
}
57+
// You can use other formats as:
58+
decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out RgbImage rgb)
59+
decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out Yuv420p yuv420)
60+
...
5261
```
5362

5463
# Converter dll
55-
A separate dll is provided for RGB <-> YUV conversions. Its compiled with clang LLVM and has AVX2 intrinsics.
64+
A separate dll is provided for RGB <-> YUV conversions. Its compiled with clang LLVM with AVX2 intrinsics.
5665
</br>You can optionally include it on your executable path just like Openh264 dll.
5766
</br>
58-
</br>If wrapper cannot find the Converter32/64 dll it will fall back to use C++/Cli versions.
67+
</br>If wrapper cannot find the Converter32/64 dll or if your machine does not support AVX2 it will fall back to use default C++/Cli versions.
5968
</br>External dll 2x+ faster than C++/Cli versions.
6069

6170
# TLDR how to install
62-
- Go to my releases find lates version.
63-
- Reference H264Sharp dll on your project.
71+
- Go to my releases find latest version.
72+
- Reference H264Sharp dll on your C# project.
6473
- Add `openh264-2.3.1-win32.dll` or `openh264-2.3.1-win64.dll` or both to your executable directory(Or include on your project and ckeck copy to output-> copy if newer).
6574
- Keep the original names if you want to use default constructors.
6675
- Optionally Add Converter64/32 dlls to your executable directory same way as openh264 dll.
6776
- Enjoy
77+
6878
# Remarks
6979
- Decode callbacks with raw image formats use cached back buffer, if you wont consume them immediately, make a copy or sync your system.
7080
- Encoder output "EncodedFrame" uses cached back buffer, if you wont consume them immediately, make a copy or sync your system.

0 commit comments

Comments
 (0)