paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.72k stars 350 forks source link

media-sender vs streamer #709

Open H4k4nn opened 2 years ago

H4k4nn commented 2 years ago

Hello there.

I could send gstreamer video and audio buffer seperately to media-sender application to show on browser successfuly.

But what I need is that I need to send video and audio buffers together to be able to play synchronised on browser. I have checked streamer example a bit but for now I would like to know

Do I need to go with streamer example to make my wish work? Is there any way to play video and audio simultaneously on browser with media-sender?

If not my questions will be continue :)

paullouisageneau commented 2 years ago

You don't need to go with the streamer example, you only need to extend the media-sender one to create two different tracks. The browser should then receive a single stream with two tracks.

H4k4nn commented 2 years ago

Thanks Paul.

Is it true way? Because I could not make it work.

ask

paullouisageneau commented 2 years ago

You have to use a different payload type for Opus (which must match the payload type of the external Opus RTP stream), and a different SSRC for the second track.