Skip to content

Commit

Permalink
Use sequence parameter sets for h.264 keyframe detection (#551)
Browse files Browse the repository at this point in the history
Similar to the change made in Galene by jech, use SPS to detect keyframes
jech/galene@4435a30
  • Loading branch information
davidzhao authored Jul 8, 2021
1 parent a229414 commit cf4a550
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/buffer/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func isH264Keyframe(payload []byte) bool {
return false
}
n := payload[i+offset] & 0x1F
if n == 5 {
if n == 7 {
return true
} else if n >= 24 {
// is this legal?
Expand All @@ -184,7 +184,7 @@ func isH264Keyframe(payload []byte) bool {
// not a starting fragment
return false
}
return payload[1]&0x1F == 5
return payload[1]&0x1F == 7
}
return false
}

0 comments on commit cf4a550

Please sign in to comment.