Setup track based on codec negotiation #3389
Unanswered
pschichtel
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently building a test tool that is supposed to simulate calls to a telephony system using local audio files. I've already setup a gstreamer pipeline that transcodes the audio to alaw, ulaw, g722 and opus. So I'm offering all of these codecs in my INVITE and I'm receiving exactly one of them back in the OK.
How can I setup my track, such that it picks the traffic based on the negotiation?
(1) When creating a track via pc.AddTrack, then I have to supply a codec and if that codec is not part of the remote SDP during pc.SetRemoteDescription, then pc.SetRemoteDescription will fail.
(2) When I setup an audio transceiver via pc.AddTransceiverFromKind, in order to do a RTPSender.ReplaceTrack after the pc.SetRemoteDescription, I have the same issue, because under the hood a track with a codec from the media engine will be created. Thus this fails with the same problem.
(3) Creating a transceiver and then removing the implicitly created track after creating the offer seems to work, at least pc.SetRemoteDescription works due to a lack of track binds and it allows me to set a new sender and track. This does feel very hacky and there also doesn't seem to arrive any audio on the remote side.
Variant (2) feels like it should be the version that works and as long as the negotiated codec is the first in the list of preferred codecs in the transceiver, but shouldn't it also work when the codec is "less preferred" ?
webrtc-rs/webrtc#737 (comment) seems to describe a similar scenario.
Any hint is welcome!
Beta Was this translation helpful? Give feedback.
All reactions