Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump elixir webrtc to 0.3 #3

Merged
merged 17 commits into from
Aug 2, 2024
Merged

bump elixir webrtc to 0.3 #3

merged 17 commits into from
Aug 2, 2024

Conversation

mat-hek
Copy link
Member

@mat-hek mat-hek commented Jul 11, 2024

Before merging, we need to figure out the ex_sdp version conflicts, see membraneframework/ex_sdp#50

@mat-hek mat-hek requested a review from mickel8 July 11, 2024 14:46
Copy link
Member

@mickel8 mickel8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I just want to make sure that you know that we introduced MediaStreams in 0.3 and right now, your implementation alaways adds tracks separately. So on the FE in ontrack callback, those tracks won't have any streams assigned.

Your examples will work as you do videoPlayer.srcObject.addTrack but I am just mentioning.

You can read more here: https://github.com/elixir-webrtc/ex_webrtc/releases/tag/v0.3.0

@FelonEkonom FelonEkonom requested a review from mickel8 July 31, 2024 13:01
@FelonEkonom
Copy link
Member

@mickel8 I have implemented handling keyframe requests since your last review, could you review my changes?

rtcp_packets
|> Enum.reduce(false, fn packet, request_keyframe? ->
case packet do
{_track_id, %ExRTCP.Packet.PayloadFeedback.PLI{}} ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would make sure that track_id refers to video track. Just to be sure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, there is no track_id here

true

_other ->
Membrane.Logger.debug("Ignoring RTCP packet: #{inspect(packet)}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be pretty verbose

actions =
if request_keyframe? do
ctx.pads
|> Enum.flat_map(fn {pad_ref, pad_data} ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why sending keyframe on all video pads? Just send on a pad that refers to track_id from line 142

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, there is notrack_id there

ctx.pads
|> Enum.flat_map(fn {pad_ref, pad_data} ->
case pad_data.options.kind do
:video -> [event: {pad_ref, %Membrane.KeyframeRequestEvent{}}]
Copy link
Member Author

@mat-hek mat-hek Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we somehow 'debounce' the keyframe requests? AFAIR the browser is going to spam us with PLIs when it's unable to decode the stream to make sure we receive a PLI ASAP. And we shouldn't generate as many keyframes as PLIs. cc @mickel8

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds resonable but how to distinct between PLI retransmission and real PLI 🤔

@FelonEkonom FelonEkonom merged commit 68fb6db into master Aug 2, 2024
3 checks passed
@FelonEkonom FelonEkonom deleted the ex_webrtc-0.3 branch August 2, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants