Skip to content

Commit 928c98a

Browse files
committed
WHIP: Update muxers.texi for RTC.
1 parent 5c7c95d commit 928c98a

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

doc/muxers.texi

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,56 @@ Set custom HTTP headers, can override built in default headers. Applicable only
13331333

13341334
@end table
13351335

1336+
@anchor{rtc}
1337+
@section rtc
1338+
1339+
WebRTC (Real-Time Communication) muxer that supports sub-second latency streaming according to
1340+
the WHIP (WebRTC-HTTP ingestion protocol) specification.
1341+
1342+
It uses HTTP as a signaling protocol to exchange SDP capabilities and ICE lite candidates. Then,
1343+
it uses STUN binding requests and responses to establish a session over UDP. Subsequently, it
1344+
initiates a DTLS handshake to exchange the SRTP encryption keys. Lastly, it splits video and
1345+
audio frames into RTP packets and encrypts them using SRTP.
1346+
1347+
Ensure that you use H.264 without B frames and Opus for the audio codec. For example, to convert
1348+
an input file with @command{ffmpeg} to WebRTC:
1349+
@example
1350+
ffmpeg -re -i input.mp4 -acodec libopus -ar 48000 -ac 2 \
1351+
-vcodec libx264 -profile:v baseline -tune zerolatency -threads 1 -bf 0 \
1352+
-f rtc "http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream"
1353+
@end example
1354+
1355+
For this example, we have employed low latency options, resulting in an end-to-end latency of
1356+
approximately 150ms.
1357+
1358+
@subsection Options
1359+
1360+
This muxer supports the following options:
1361+
1362+
@table @option
1363+
1364+
@item ice_arq_max @var{size}
1365+
Set the maximum number of retransmissions for the ICE ARQ mechanism.
1366+
Default value is 5.
1367+
1368+
@item ice_arq_timeout @var{size}
1369+
Set the start timeout in milliseconds for the ICE ARQ mechanism.
1370+
Default value is 30.
1371+
1372+
@item dtls_arq_max @var{size}
1373+
Set the maximum number of retransmissions for the DTLS ARQ mechanism.
1374+
Default value is 5.
1375+
1376+
@item dtls_arq_timeout @var{size}
1377+
Set the start timeout in milliseconds for the DTLS ARQ mechanism.
1378+
Default value is 50.
1379+
1380+
@item pkt_size @var{size}
1381+
Set the maximum size, in bytes, of RTP packets that send out.
1382+
Default value is 1500.
1383+
1384+
@end table
1385+
13361386
@anchor{ico}
13371387
@section ico
13381388

libavformat/rtcenc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ enum StunAttr {
139139
STUN_ATTR_FINGERPRINT = 0x8028, /// rfc5389
140140
};
141141

142-
#if CONFIG_OPENSSL
143142
typedef struct DTLSContext {
144143
/* For av_log to write log to this category. */
145144
void *log_avcl;
@@ -685,8 +684,6 @@ static int dtls_context_handshake(DTLSContext *ctx)
685684
return ret;
686685
}
687686

688-
#endif
689-
690687
typedef struct RTCContext {
691688
AVClass *av_class;
692689

0 commit comments

Comments
 (0)