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

Allow multiple negotiated A/V codecs respectively #2632

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pougetat
Copy link
Contributor

Description

Pion currently restricts the negotiated audio codec and negotiated video codec to the first exact / partial matches it finds in a remote description.

This causes issues in the following scenario:

  • Call RegisterCodec().
  • Call AddTransceiver() for multiple video codecs / multiple audio codecs.
  • Pion instance receives a remote description, call SetRemoteDescription() => This updates the list of negotiated codecs.
  • Pion instance creates an answer, call CreateAnswer().
  • Pion instance sets the local description, call SetLocalDescription => There is a conflict here between what transceivers have been configured and the negotiated codecs filtered down from the remote description.

Reference issue

Fixes #...

@pougetat pougetat changed the title Negotiated codecs should not be restricted to first codec found Audio negotiated codecs / video negotiated codecs can be multiple Dec 11, 2023
@pougetat pougetat changed the title Audio negotiated codecs / video negotiated codecs can be multiple Negotiated codecs too restricted. Dec 11, 2023
@pougetat pougetat changed the title Negotiated codecs too restricted. Allow multiple negotiated audio / video codecs respectively. Dec 11, 2023
@pougetat pougetat changed the title Allow multiple negotiated audio / video codecs respectively. Allow multiple negotiated A/V codecs respectively Dec 11, 2023
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (eed2bb2) 76.47% compared to head (50e3727) 76.44%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2632      +/-   ##
==========================================
- Coverage   76.47%   76.44%   -0.04%     
==========================================
  Files          87       87              
  Lines        9867     9895      +28     
==========================================
+ Hits         7546     7564      +18     
- Misses       1854     1861       +7     
- Partials      467      470       +3     
Flag Coverage Δ
go 77.98% <100.00%> (-0.05%) ⬇️
wasm 64.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@streamer45
Copy link
Contributor

FWIW I am hitting this same issue when trying to receive multiple differently encoded tracks.

@streamer45
Copy link
Contributor

@Sean-Der Any thoughts on this? We may actually need to make similar changes on our end so it would be great to get some feedback on what could be the best way forward to send multi codec tracks.

@Sean-Der
Copy link
Member

Sean-Der commented Mar 18, 2024

Hey @streamer45

Is this what you are trying to implement? You want to have one TrackLocal that can be used to send many different codecs? Since you are forwarding media created by someone else, you don't know the codec at PeerConnection creation time?

@streamer45
Copy link
Contributor

Hey @streamer45

Is this what you are trying to implement? You want to have one TrackLocal that can be used to send many different codecs? Since you are forwarding media created by someone else, you don't know the codec at PeerConnection creation time?

Hey @Sean-Der, to be honest I may have lost a bit of context on this one as I can't seem to reproduce the original issue (failing to negotiate the track) so maybe it was a simple misimplementation on our part.

Our use case is rather simple: we have one peer connection (sender) pushing two tracks with different encodings and then want to selectively forward one of the two to our receivers, depending on what they support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants