WebRTC Media Engine for Delphi & C++ Builder | sgcWebRTC

sgcWebRTC — the WebRTC Media Engine for Delphi & C++ Builder

Add real-time audio, video, screen sharing and data channels to your Delphi and C++ Builder apps, without touching a browser.

No Browser / WebView Required
Windows, Linux, macOS, iOS & Android
Audio & Video Calls
Screen Sharing
SCTP Data Channels
DTLS-SRTP Encrypted
STUN / TURN / ICE Built In
Adaptive Bitrate
Hardware H.264 Encoding
Interoperable With Browsers
Full Source Code
Delphi & C++ Builder

One Component, the Whole Peer Connection

sgcWebRTC does not add new palette components on top of sgcWebSockets — it unlocks the rest of the W3C-shaped surface on the same TsgcRTCPeerConnection class: signaling, connectivity, encryption, data channels and media all live on one object.

Manual, browser-compatible signaling

CreateOffer, CreateAnswer, SetLocalDescription, SetRemoteDescription and AddIceCandidate build and consume real SDP, so the peer at the other end can be a browser. You carry the SDP over whatever signaling channel you already have.

ICE, STUN and TURN connectivity

Trickle or non-trickle ICE gathering against RTCOptions.ICEServers, with server-reflexive candidates from STUN and relayed candidates from TURN when a direct path is blocked. OnICECandidate and OnConnectionStateChange track the transport.

DTLS-SRTP encrypted transport

Every session is secured the way WebRTC mandates: a DTLS handshake over the nominated ICE pair derives the SRTP keys, and every RTP, RTCP and SCTP packet on the connection is encrypted from the first packet.

SCTP data channels

CreateDataChannel opens an ordered or unordered, reliable or partially-reliable channel (RFC 8831/8832) over SCTP-over-DTLS. Send, SendBytes and the OnMessage / OnMessageBinary events move text and binary payloads.

Audio, video and screen tracks

AddTrack attaches an Opus or G.711 audio track, or a VP8, H.264 or Motion JPEG video track; SendPCM and SendVideoFrame push captured media in, OnAudio and OnVideoFrame deliver the decoded remote track.

Bandwidth estimation & resilience

A delay-based estimator in the style of Google Congestion Control tracks the link and drives the video encoder's target bitrate, backed by RTCP NACK/PLI retransmission, RFC 4588 RTX and RED/ULPFEC, the same toolbox a browser uses on a lossy network.

TsgcRTCPeerConnection

sgcWebRTC does not add a new class to the palette. It is the same TsgcRTCPeerConnection component that ships in sgcWebSockets Enterprise, with the SDP, SCTP, RTP and SRTP surface unlocked on top of the ICE/TURN connectivity Enterprise already gives you.

TsgcRTCPeerConnection

Manual SDP signaling, ICE/TURN connectivity, DTLS-SRTP encryption, SCTP data channels and RTP audio/video tracks on one component. Renegotiation, ICE restart and the W3C perfect-negotiation glare rule are built in.

View component →

See the full feature breakdown →

An Offer, and a Data Channel

Set an ICE server, hook the SDP and ICE events, open a data channel, then create the offer. The same API in Delphi and C++ Builder.

uses
  sgcP2P;

var
  oRTC: TsgcRTCPeerConnection;
begin
  oRTC := TsgcRTCPeerConnection.Create(nil);
  oRTC.RTCOptions.ICEServers.AddURL('stun:stun.l.google.com:19302');
  oRTC.OnLocalDescription      := OnLocalDescriptionHandler;
  oRTC.OnICECandidate          := OnICECandidateHandler;
  oRTC.OnConnectionStateChange := OnConnectionStateChangeHandler;
  oRTC.OnDataChannel           := OnDataChannelHandler;

  oRTC.CreateDataChannel('chat');   // forces RTCOptions.DTLS on
  oRTC.CreateOffer;                    // gathers ICE candidates, builds the SDP offer
end;

procedure TForm1.OnLocalDescriptionHandler(Sender: TObject;
  const aType, aSDP: string);
begin
  // send aType + aSDP to the remote peer over your own signaling channel
end;

procedure TForm1.OnDataChannelHandler(Sender: TObject;
  aChannel: TsgcRTCDataChannel);
begin
  aChannel.OnMessage := OnChannelMessageHandler;
  aChannel.Send('hello');
end;
// includes: sgcP2P.hpp

TsgcRTCPeerConnection *oRTC = new TsgcRTCPeerConnection(NULL);
oRTC->RTCOptions->ICEServers->AddURL("stun:stun.l.google.com:19302");
oRTC->OnLocalDescription      = OnLocalDescriptionHandler;
oRTC->OnICECandidate          = OnICECandidateHandler;
oRTC->OnConnectionStateChange = OnConnectionStateChangeHandler;
oRTC->OnDataChannel           = OnDataChannelHandler;

oRTC->CreateDataChannel("chat");    // forces RTCOptions->DTLS on
oRTC->CreateOffer();                  // gathers ICE candidates, builds the SDP offer

void __fastcall TForm1::OnLocalDescriptionHandler(TObject *Sender,
  const String aType, const String aSDP)
{
  // send aType + aSDP to the remote peer over your own signaling channel
}

void __fastcall TForm1::OnDataChannelHandler(TObject *Sender,
  TsgcRTCDataChannel *aChannel)
{
  aChannel->OnMessage = OnChannelMessageHandler;
  aChannel->Send("hello");
}

The RFCs sgcWebRTC Implements

A standards-based media engine, not a proprietary transport.

RFC 8445 & 8489 — ICE / STUN

Interactive Connectivity Establishment candidate gathering and nomination, and the STUN binding requests behind it. Exposed through TsgcICEClient and consumed automatically by TsgcRTCPeerConnection.

RFC 8656 — TURN

Relayed candidates through a TURN server when a direct or server-reflexive path is not reachable, via TsgcTURNClient.

RFC 8827 & 5764 — DTLS / DTLS-SRTP

The DTLS handshake that authenticates the peer connection and derives the SRTP keying material for encrypted media.

RFC 8831 & 8832 — SCTP Data Channels

SCTP over DTLS with the DCEP open handshake, stream id parity by DTLS role, and ordered / partially-reliable delivery.

RFC 3550 & 3711 — RTP / SRTP

Real-time transport for audio and video and its encrypted profile, with RTCP sender/receiver reports, NACK, PLI and REMB feedback.

RFC 8829 — JSEP

The offer/answer state machine behind CreateOffer / CreateAnswer / SetLocalDescription / SetRemoteDescription, including renegotiation and glare resolution.

An Add-On to sgcWebSockets Enterprise

sgcWebRTC is licensed as an add-on. All licenses include full source code, 1 year of updates and a 70% renewal discount.

sgcWebRTC

€299

Single, Team and Site licenses available. Full source code included.

  • TsgcRTCPeerConnection media engine
  • SDP signaling, SCTP data channels, RTP media
  • Delphi & C++ Builder
  • Full Source Code
  • 1 Year Updates

★ Requires sgcWebSockets Enterprise

Not available for Standard or Professional. Also included in the All-Access bundle.

View Pricing & Order

WebRTC in Delphi, Frequently Asked

The questions developers ask before adding real-time audio, video or data channels to a Delphi or C++ Builder application.

Not out of the box, and most third-party libraries stop at signaling. sgcWebSockets Enterprise ships the base TsgcRTCPeerConnection component for ICE/TURN connectivity; sgcWebRTC adds the media engine on top of it — manual SDP offer/answer, DTLS-SRTP encrypted transport, SCTP data channels, and Opus/G.711 audio with VP8/H.264 video — so the component can actually open a peer connection with a browser and exchange media, not just relay signaling messages.
Yes. CreateOffer / CreateAnswer build standard SDP and SetLocalDescription / SetRemoteDescription / AddIceCandidate consume it, following the JSEP state machine (RFC 8829) a browser expects. You carry the SDP and candidates over your own signaling channel, exactly as a browser application does through its signaling server.
Yes. CreateDataChannel opens an RTCDataChannel over SCTP-over-DTLS (RFC 8831/8832), ordered or unordered, reliable or with a retransmit or lifetime limit. OnDataChannel fires for a channel the remote peer opened, and Send / SendBytes move text or binary payloads once the channel is open.
Audio: Opus and G.711 (PCMU/PCMA). Video: VP8 through a libvpx binding, and H.264 through the operating system's own hardware encoder — Media Foundation on Windows, VideoToolbox on iOS/macOS, MediaCodec on Android — plus a Motion JPEG path on Windows. See the feature breakdown for the platform matrix.
Yes, and it cannot be turned off for media: a DTLS-SRTP handshake runs over the nominated ICE pair and every RTP, RTCP and SCTP packet on the connection is encrypted, the same mandatory-encryption model a browser enforces.
No. Several other approaches to WebRTC in Delphi work by embedding a full browser engine (a Chromium Embedded Framework wrapper or a TWebBrowser/TEdgeBrowser control) and driving its JavaScript WebRTC stack from Pascal. sgcWebRTC does not: TsgcRTCPeerConnection is compiled Object Pascal calling the operating system's own media APIs directly (Media Foundation on Windows, VideoToolbox on iOS/macOS, MediaCodec on Android), with no browser runtime, no embedded Chromium binary and no JavaScript bridge in the process. That keeps the binary small and lets the same component run on Android and iOS, and in headless services or kiosk devices with no browser installed at all.
sgcWebRTC follows the sgcWebSockets support matrix, Delphi 7 through Delphi 13 Florence and the matching C++ Builder versions. The trial installer is per IDE version and already contains the WebRTC components, so there is no separate download.
Not for the media engine. The sgcWebSockets .NET port includes a WebRTC signaling relay (TsgcWSProtocol_WebRTC_Server) for the classic AppRTC-style browser-to-browser demo, but no .NET equivalent of TsgcRTCPeerConnection. sgcWebRTC itself is Delphi and C++ Builder only.
sgcWebRTC is an add-on to sgcWebSockets Enterprise — it is not available for Standard or Professional — and it is also included in the All-Access bundle. Single, Team and Site licenses are available, each with full source code and one year of updates. Download the trial to evaluate it in your own project before buying.
3,000+Developers
20+Years
761+Components
30+API Integrations
5Platforms
30-Day Money-Back GuaranteeNot satisfied? Request a full refund within 30 days of purchase. See refund policy

Put a Real Peer Connection Behind Your Delphi App

Audio, video and data channels, encrypted end to end, from the language you already use.

Other Products by eSeGeCe

Pair sgcWebRTC with our other Delphi, C++ Builder and .NET component libraries.

sgcWebSockets

Enterprise WebSocket, HTTP/2, MQTT, AMQP and AI/LLM components. sgcWebRTC is an add-on to sgcWebSockets Enterprise.

Learn more →

sgcQUIC

QUIC (RFC 9000) and HTTP/3 (RFC 9114) client and server components on the native OpenSSL 3.5 QUIC engine.

Learn more →

sgcHTML

89 data-aware server-side HTML/UI components for Delphi, C++ Builder and .NET, with Bootstrap 5 and htmx.

Learn more →

sgcSign

Enterprise digital signatures — XAdES, PAdES, CAdES and ASiC with 10 key providers and 21 EU country profiles.

Learn more →

sgcOpenAPI

OpenAPI 3.0 parser and SDK generator. Turn any OpenAPI spec into a strongly-typed Delphi client in seconds.

Learn more →

sgcBiometrics

Native Windows Hello, fingerprint and Windows Biometric Framework components for Delphi and C++ Builder.

Learn more →

sgcIndy

Updated Indy TCP/IP components with modern TLS, IPv6 and HTTP/2 support for Delphi 7 through 13.

Learn more →

sgcAI

15 AI, LLM and MCP components for Delphi and C++ Builder. One chat component reaches OpenAI, Anthropic, Gemini, DeepSeek, Ollama, Grok and Mistral.

Learn more →

sgcMQ

MQTT 3.1.1 and 5.0, AMQP 0.9.1, AMQP 1.0, Apache Kafka and STOMP client components for Delphi and C++ Builder.

Learn more →