1
Fork 0

Decrease keyframe interval when writing to disk.

This commit is contained in:
Juliusz Chroboczek 2021-01-03 13:45:46 +01:00
parent f53276b89e
commit ddafca5780
1 changed files with 2 additions and 3 deletions

View File

@ -359,10 +359,9 @@ func (t *diskTrack) WriteRTP(packet *rtp.Packet) error {
}
t.lastKf = ts
} else if t.writer != nil {
// Request a keyframe every 10s
// Request a keyframe every 4s
delta := ts - t.lastKf
if (delta&0x80000000) == 0 &&
delta > 10*90000 {
if (delta&0x80000000) != 0 || delta > 4*90000 {
kfNeeded = true
}
}