From 92c23de507bcfe759a34eb37d5582bf353fe6fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kita?= Date: Tue, 11 Jun 2024 17:13:41 +0200 Subject: [PATCH] Use zero-latency jitter buffer (#193) --- lib/membrane/live_compositor/live_compositor.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/membrane/live_compositor/live_compositor.ex b/lib/membrane/live_compositor/live_compositor.ex index b3376f3d..869ccff0 100644 --- a/lib/membrane/live_compositor/live_compositor.ex +++ b/lib/membrane/live_compositor/live_compositor.ex @@ -633,8 +633,10 @@ defmodule Membrane.LiveCompositor do links = get_child({:rtp_receiver, ref}) |> via_out(Pad.ref(:output, ssrc), - options: [depayloader: RTP.H264.Depayloader, clock_rate: 90_000] + options: [depayloader: nil, clock_rate: 90_000] ) + |> child(%Membrane.RTP.JitterBuffer{latency: 0, clock_rate: 90_000}) + |> child(RTP.H264.Depayloader) |> get_child({:output_processor, pad_id}) actions = [spec: {links, group: output_group_id(pad_id)}] @@ -652,8 +654,10 @@ defmodule Membrane.LiveCompositor do links = get_child({:rtp_receiver, ref}) |> via_out(Pad.ref(:output, ssrc), - options: [depayloader: RTP.Opus.Depayloader, clock_rate: 48_000] + options: [depayloader: nil, clock_rate: 48_000] ) + |> child(%Membrane.RTP.JitterBuffer{latency: 0, clock_rate: 48_000}) + |> child(RTP.Opus.Depayloader) |> get_child({:output_processor, pad_id}) {[spec: {links, group: output_group_id(pad_id)}], state}