Skip to content

Commit caec04a

Browse files
Update README.md
1 parent 0b92767 commit caec04a

File tree

1 file changed

+1
-90
lines changed

1 file changed

+1
-90
lines changed

README.md

Lines changed: 1 addition & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ C# library is .Net standard wrapper library for this dll and performs PInvoke to
2323
Install the nuget package and its ready to go. All native dependencies are automatically installed and will apepear on your executable directory.
2424
linux binaries are provided on releases, Nuget release coming soon.
2525

26-
[![NuGet](https://img.shields.io/nuget/v/H264Sharp)](https://www.nuget.org/packages/H264Sharp/1.2.0)
26+
[![NuGet](https://img.shields.io/nuget/v/H264Sharp)](https://www.nuget.org/packages/H264Sharp)
2727

2828
For usage in Unity, You have to specify the absolute path for openh264 dll. (i.e. StreamingAssets)
2929
``` c#
@@ -260,92 +260,3 @@ here you can explore:
260260

261261

262262

263-
264-
265-
266-
# Legacy C++/CLI(deprecated)
267-
### C++Cli wrapper is deprecated due to platform limitations and other issues. Plase use native Pinvoke version which is also distrbuted with Nuget.
268-
Cisco's OpenH264 C++/CLI wrapper with optimised image format conversion support. It is very suitable for realtime streaming over network.
269-
- Offers managed and unmanaged API.
270-
- Tested on .NetFramework and NetCore(up to 8).
271-
- Compatible with OpenCV.(i.e. OpenCVsharp)
272-
- Tested on WPF application with camera and screen capture (P2P Videocall).
273-
- No memory leaks or GC pressure with bitmaps.
274-
- Simple console application example is provided as an example.
275-
276-
### Setup(deprecated)
277-
- 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).
278-
- You can setup with a different dll name, constructor is overloaded.
279-
``` c#
280-
decoder = new H264Sharp.Decoder();
281-
282-
encoder = new H264Sharp.Encoder();
283-
encoder.Initialize(width,
284-
height,
285-
bps: 3_000_000,
286-
fps: 30,
287-
H264Sharp.Encoder.ConfigType.CameraBasic);
288-
```
289-
290-
### Encode (deprecated)
291-
- You can encode from rgb/rgba/bgr/bgra/yuv_i420 on as raw data format, or System.Drawing.Bitmaps.
292-
- Raw data is compatible with OpenCV Mats or any other standard image container.
293-
- EncodedFrame represents h264 encoded bytes(NALs etc).
294-
```C#
295-
if(encoder.Encode(bitmap, out EncodedFrame[] frames))
296-
{
297-
foreach (var frame in frames)
298-
{
299-
//You can convert to managed array
300-
//byte[] b = frame.ToByteArray();
301-
302-
// You can copy to Managed array
303-
//frame.CopyTo(buffer, 0);
304-
305-
Decode(frame.Data, frame.Length, frame.Type);
306-
}
307-
}
308-
```
309-
310-
311-
### Decode(deprecated)
312-
- You can decode with pointers or with managed byte array as input.
313-
- You can decode into System.Drawing.Bitmaps or raw data format images (they are compatible with OpenCV Mats and any other standard image containers.).
314-
```C#
315-
void Decode(IntPtr data, int length, FrameType type)
316-
{
317-
if (decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out Bitmap bmp))
318-
{
319-
// Do stuff..
320-
// bmp.Save("t.bmp");
321-
}
322-
}
323-
// You can use other formats as:
324-
decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out RgbImage rgb)
325-
decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out Yuv420p yuv420)
326-
...
327-
```
328-
329-
## Converter dll(deprecated)
330-
A separate dll is provided for RGB <-> YUV conversions. Its compiled with clang LLVM with AVX2 intrinsics.
331-
</br>You can optionally include it on your executable path just like Openh264 dll.
332-
</br>
333-
</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.
334-
</br>External dll 2x+ faster than C++/Cli versions.
335-
336-
## TLDR how to install(deprecated)
337-
- Go to my releases find latest version.
338-
- Reference H264Sharp dll on your C# project.
339-
- 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).
340-
- Keep the original names if you want to use default constructors.
341-
- Optionally Add Converter64/32 dlls to your executable directory same way as openh264 dll.
342-
- Enjoy
343-
344-
## Remarks(deprecated)
345-
- Decode callbacks with raw image formats use cached back buffer, if you wont consume them immediately, make a copy or sync your system.
346-
- Encoder output "EncodedFrame" uses cached back buffer, if you wont consume them immediately, make a copy or sync your system.
347-
- .Net Core and .Net Framework releases are provided.
348-
- Use at least 2.3.1 version of openh264.(cisco has updated some data types, older versions might lead to stack buffer overflow).
349-
350-
- Download Cisco's [`openh264-2.3.1-win32.dll`](http://ciscobinary.openh264.org/openh264-2.3.1-win32.dll.bz2)
351-
- 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)