From bbed24d91975696316892e687fafe35119444d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 5 Aug 2020 10:47:07 +0300 Subject: [PATCH] webrtc: Change H264 examples to use aggregate-mode=zero-latency for best compatibility The default changed back to none because it broke existing code. See https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/749 Part-of: --- webrtc/janus/janusvideoroom.py | 2 +- webrtc/janus/rust/src/janus.rs | 2 +- webrtc/sendonly/webrtc-unidirectional-h264.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webrtc/janus/janusvideoroom.py b/webrtc/janus/janusvideoroom.py index 37a6824434..1364864ee3 100644 --- a/webrtc/janus/janusvideoroom.py +++ b/webrtc/janus/janusvideoroom.py @@ -78,7 +78,7 @@ from gi.repository import GstSdp if DO_VP8: ( encoder, payloader, rtp_encoding) = ( "vp8enc target-bitrate=100000 overshoot=25 undershoot=100 deadline=33000 keyframe-max-dist=1", "rtpvp8pay picture-id-mode=2", "VP8" ) else: - ( encoder, payloader, rtp_encoding) = ( "x264enc", "rtph264pay", "H264" ) + ( encoder, payloader, rtp_encoding) = ( "x264enc", "rtph264pay aggregate-mode=zero-latency", "H264" ) PIPELINE_DESC = ''' webrtcbin name=sendrecv stun-server=stun://stun.l.google.com:19302 diff --git a/webrtc/janus/rust/src/janus.rs b/webrtc/janus/rust/src/janus.rs index 2540f2205b..dfecc9230f 100644 --- a/webrtc/janus/rust/src/janus.rs +++ b/webrtc/janus/rust/src/janus.rs @@ -66,7 +66,7 @@ const VP8: VideoParameter = VideoParameter { const H264: VideoParameter = VideoParameter { encoder: "x264enc tune=zerolatency", encoding_name: "H264", - payloader: "rtph264pay", + payloader: "rtph264pay aggregate-mode=zero-latency", }; impl std::str::FromStr for VideoParameter { diff --git a/webrtc/sendonly/webrtc-unidirectional-h264.c b/webrtc/sendonly/webrtc-unidirectional-h264.c index e297a534d5..4dba828fcb 100644 --- a/webrtc/sendonly/webrtc-unidirectional-h264.c +++ b/webrtc/sendonly/webrtc-unidirectional-h264.c @@ -179,7 +179,7 @@ create_receiver_entry (SoupWebsocketConnection * connection) gst_parse_launch ("webrtcbin name=webrtcbin stun-server=stun://" STUN_SERVER " " "v4l2src ! videorate ! video/x-raw,width=640,height=360,framerate=15/1 ! videoconvert ! queue max-size-buffers=1 ! x264enc bitrate=600 speed-preset=ultrafast tune=zerolatency key-int-max=15 ! video/x-h264,profile=constrained-baseline ! queue max-size-time=100000000 ! h264parse ! " - "rtph264pay config-interval=-1 name=payloader ! " + "rtph264pay config-interval=-1 name=payloader aggregate-mode=zero-latency ! " "application/x-rtp,media=video,encoding-name=H264,payload=" RTP_PAYLOAD_TYPE " ! webrtcbin. ", &error); if (error != NULL) {