notedit / media-server-go

WebRTC media server for go
GNU General Public License v2.0
538 stars 119 forks source link

Manually write video packets to outgoing stream #50

Closed niklaskorz closed 4 years ago

niklaskorz commented 5 years ago

There currently does not seem to be a way to directly write data to an outgoing stream track, similar to the OnMediaFrame callback of the ingoing stream track. Is there a possibility to add something like a WriteMediaFrame method?

niklaskorz commented 5 years ago

The only possible way right now seems to be the streamer session which opens a UDP socket. But since I already have the data as a byte array in my Go code, I'd like to avoid this extra step.

notedit commented 5 years ago

@niklaskorz I am working on this on mediaframe-bridge branch. It does not work yet.

notedit commented 4 years ago

https://github.com/notedit/media-server-go/blob/master/mediaframesession.go#L57

you can write rtp data now.