webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

How can I specify more than one codec when I invoke NewTrackLocalStaticRTP

Open ChenMoGe2 opened this issue 3 years ago • 3 comments

ChenMoGe2 avatar Oct 18 '22 11:10 ChenMoGe2

Hi @ChenMoGe2

That isn't possible today. What are you trying to implement?

We could modify it to make your use case work, or maybe it is possible to implement your idea another way.

Sean-Der avatar Oct 23 '22 03:10 Sean-Der

Hi @ChenMoGe2

That isn't possible today. What are you trying to implement?

We could modify it to make your use case work, or maybe it is possible to implement your idea another way.

Thanks for you reply.I want do this because the sender sends video codec either h264 or vp8.

Maybe I already resovle it.I create two video track to distinguish different video codec

ChenMoGe2 avatar Oct 24 '22 09:10 ChenMoGe2

Hi @ChenMoGe2

That isn't possible today. What are you trying to implement?

We could modify it to make your use case work, or maybe it is possible to implement your idea another way.

Hello,I made an SFU server and use different clients to connect it just one peerconnection.Some clients send video using H264 and the other clients send video using VP8.Or the SFU server supports forwarding all codecs video

ChenMoGe2 avatar Nov 04 '22 08:11 ChenMoGe2

Hi @ChenMoGe2

Sorry I never got around to responding to this. This is possible with pion/webrtc@v3 now! TrackLocal is an interface so as long as you satisfy it you can send w/e codec you want.

Here is an example of the pattern you are requesting in Broadcast box trackMultiCodec allows the caller to switch between H264/VP8/VP9/AV1 at anytime.

I think it would make sense to add this pattern to Pion itself! Make TrackLocalDynamicRTP and TrackLocalDynamicSample it would require some thought around the API design/error handling though!

Sean-Der avatar Mar 31 '24 03:03 Sean-Der