Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ReferenceType authored Sep 2, 2023
1 parent 35b1f25 commit bc6f684
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
# H264Sharp
Cisco's OpenH264 C++/CLI wrapper in C# comes with optimised image format conversion library.

- Compatible with OpenCV.
- Tested on WPF application with camera and screen capture (P2P Videocall).
- Very Simple console application example is provided on repo.

Setup
``` c#
decoder = new H264Sharp.Decoder();

encoder = new H264Sharp.Encoder();
encoder.Initialize(w, h, bps: 200_000_000, fps: 30, H264Sharp.Encoder.ConfigType.CameraBasic);
```

Encode

```C#
if(encoder.Encode(bitmap, out EncodedFrame[] frames))
{
foreach (var frame in frames)
{
//byte[] b = frame.ToByteArray();
//frame.CopyTo(buffer, 0);
Decode(frame.Data, frame.Length, frame.Type);
}
}
```

Decode
```C#
void Decode(IntPtr data, int length, FrameType type)
{
if (decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out Bitmap bmp))
{
// Do stuff..
// bmp.Save("t.bmp");
}
}
```
.Net Core and .Net Framework releases are provided.
Tested on .Net6 and .NetFramework 4.7.2.

Reference the wrapper DLL on your project.
Make sure Cisco`s DLL is on your executable path.

- Include Cisco's `openh264-2.1.1-win32` for 32 bit projects.
- include Cisco's `openh264-2.1.1-win64` for 64.

0 comments on commit bc6f684

Please sign in to comment.