sipsorcery-org / sipsorcery

A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.
https://sipsorcery-org.github.io/sipsorcery
Other
1.39k stars 424 forks source link

Display video WebRTC #1137

Closed hossam14102010 closed 2 weeks ago

hossam14102010 commented 2 weeks ago

How can I display peerConnection.RemoteVideoTrack in Maui, Wpf or UWP

ha-ves commented 2 weeks ago

https://github.com/sipsorcery-org/SIPSorceryMedia.Windows

hossam14102010 commented 2 weeks ago

@ha-ves can you provide an example to use this, looks like it contains only video sources and video sinks I mean if I have a video track how can I display (how can I make a video call using WebRTC)

ha-ves commented 2 weeks ago

There are many examples in examples/WebRTCExamples/.

Currently, there are 2 ways, using VP8 and FFmpeg. Both are abstracted so you only need to get an object handle in 2 lines, the rest are the same.

excerpts: https://github.com/sipsorcery-org/sipsorcery/blob/a92c57441b8fb9aa5add38f58f71232c35ec3284/examples/WebRTCExamples/WebRTCClientVP8Net/Program.cs#L94-L112 https://github.com/sipsorcery-org/sipsorcery/blob/a92c57441b8fb9aa5add38f58f71232c35ec3284/examples/WebRTCExamples/WebRTCClient/Program.cs#L85-L103

Essentially you'd get a decoded frame (pixel bytes) with which you'd put into a Bitmap or something else, then you can use for the Source of an Image control in WPF/UWP.