mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-27 03:56:08 +08:00
多slice的情况下,同步同一帧的时间戳
`vpacketer.Packetize`再打包的过程中会把当前的timestamp+samples作为下一次打包的时间戳,如果多slice会连续传递samples导致同一帧的时间戳不一致
This commit is contained in:
@@ -98,7 +98,13 @@ func (sh *RTSPServer) OnDescribe(ctx *gortsplib.ServerHandlerOnDescribeCtx) (*ba
|
||||
var st uint32
|
||||
onVideo := func(ts uint32, pack *engine.VideoPack) {
|
||||
for i, nalu := range pack.NALUs {
|
||||
packs := vpacketer.Packetize(nalu, (ts-st)*90)
|
||||
var samples uint32
|
||||
if i == len(pack.NALUs)-1 {
|
||||
samples = (ts-st)*90
|
||||
} else {
|
||||
samples = 0
|
||||
}
|
||||
packs := vpacketer.Packetize(nalu, samples)
|
||||
for j, rtpack := range packs {
|
||||
rtpack.Marker = i == len(pack.NALUs)-1 && j == len(packs)-1
|
||||
rtp, _ := rtpack.Marshal()
|
||||
|
Reference in New Issue
Block a user