mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-26 19:51:14 +08:00
兼容sdp中没有包含sps和pps的情况
This commit is contained in:
@@ -63,8 +63,12 @@ func (p *RTSPPublisher) SetTracks() error {
|
||||
}
|
||||
p.Tracks[trackId] = vt
|
||||
t := track.(*gortsplib.TrackH264)
|
||||
vt.WriteSlice(common.NALUSlice{t.SPS})
|
||||
vt.WriteSlice(common.NALUSlice{t.PPS})
|
||||
if len(t.SPS) > 0 {
|
||||
vt.WriteSlice(common.NALUSlice{t.SPS})
|
||||
}
|
||||
if len(t.PPS) > 0 {
|
||||
vt.WriteSlice(common.NALUSlice{t.PPS})
|
||||
}
|
||||
case "h265", "hevc":
|
||||
vt := NewH265(p.Stream)
|
||||
if payloadType, err := strconv.Atoi(vals[0]); err == nil {
|
||||
|
Reference in New Issue
Block a user