bluenviron / gortsplib

RTSP 1.0 client and server library for the Go programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass RTP packet to pion/webrtc NewTrackLocalStaticRTP

Coimbra1984 opened this issue · comments

Hi,

I used you sample code client-read-h264. I want to send the H264 stream to a pion/webrtc PeerConnection. Therefore I created a new Pion stream:
rtpTrack, errTrack := webrtc.NewTrackLocalStaticRTP(webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypeH264}, "video", "pion")
The pion stream has a function rtpTrack.WriteRTP(p *rtp.Packet), but they include the following package:
"github.com/pion/rtp"
On the other hand I have your client:
c := gortsplib.Client{} with a
c.OnPacketRTP = func(trackID int, pkt *rpt.Packet) {...} signature, but you include
"github.com/pion/rtp/v2"
This means I cannot pass directly your packets to the PeerConnection track because of this mismatch. Do you have an idea on how to convert from one world into the other. As far as I see the struct definitions are exactly the same...

Thanks

@Coimbra1984 I have the same issue when I used the latest version of gortsplib, the urgly way to make this repo and pion/webrtc work together is downgrade this to github.com/aler9/gortsplib v0.0.0-20220303160144-a541ae8f963c.

hello, due to popular demand, pion/rtp was downgraded to v1. This restores integration with pion/webrtc.

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.