mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-27 03:56:08 +08:00
过滤开头的NonIDR
This commit is contained in:
20
main.go
20
main.go
@@ -234,15 +234,17 @@ func (rtsp *RTSP) handleNALU(nalType byte, payload []byte, ts int64) {
|
|||||||
r.Write(payload)
|
r.Write(payload)
|
||||||
rtsp.PushVideo(uint32(ts), r.Bytes())
|
rtsp.PushVideo(uint32(ts), r.Bytes())
|
||||||
case NALU_Non_IDR_Picture:
|
case NALU_Non_IDR_Picture:
|
||||||
r := bytes.NewBuffer([]byte{})
|
if rtsp.avcsent {
|
||||||
pframeHead := []byte{0x27, 0x01, 0, 0, 0}
|
r := bytes.NewBuffer([]byte{})
|
||||||
util.BigEndian.PutUint24(pframeHead[2:], 0)
|
pframeHead := []byte{0x27, 0x01, 0, 0, 0}
|
||||||
r.Write(pframeHead)
|
util.BigEndian.PutUint24(pframeHead[2:], 0)
|
||||||
nalLength := []byte{0, 0, 0, 0}
|
r.Write(pframeHead)
|
||||||
util.BigEndian.PutUint32(nalLength, uint32(vl))
|
nalLength := []byte{0, 0, 0, 0}
|
||||||
r.Write(nalLength)
|
util.BigEndian.PutUint32(nalLength, uint32(vl))
|
||||||
r.Write(payload)
|
r.Write(nalLength)
|
||||||
rtsp.PushVideo(uint32(ts), r.Bytes())
|
r.Write(payload)
|
||||||
|
rtsp.PushVideo(uint32(ts), r.Bytes())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (rtsp *RTSP) handleRTP(pack *RTPPack) {
|
func (rtsp *RTSP) handleRTP(pack *RTPPack) {
|
||||||
|
Reference in New Issue
Block a user