hls: fix reading AV1 from OBS+WHIP (#3886) (#4177)
Some checks are pending
code_lint / golangci_lint (push) Waiting to run
code_lint / mod_tidy (push) Waiting to run
code_lint / api_docs (push) Waiting to run
code_test / test_64 (push) Waiting to run
code_test / test_32 (push) Waiting to run
code_test / test_highlevel (push) Waiting to run

This commit is contained in:
Alessandro Ros 2025-01-19 18:40:18 +01:00 committed by GitHub
parent e86a7a8217
commit 5bb751a4c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 6 deletions

View file

@ -148,7 +148,8 @@ func videoTrackFromSequenceStart(msg *message.VideoExSequenceStart) (format.Form
switch msg.FourCC {
case message.FourCCAV1:
// parse sequence header and metadata contained in ConfigOBUs, but do not use them
_, err := av1.BitstreamUnmarshal(msg.AV1Header.ConfigOBUs, false)
var tu av1.Bitstream
err := tu.Unmarshal(msg.AV1Header.ConfigOBUs)
if err != nil {
return nil, fmt.Errorf("invalid AV1 configuration: %w", err)
}
@ -538,7 +539,8 @@ func (r *Reader) OnDataAV1(track *format.AV1, cb OnDataAV1Func) {
r.onVideoData[r.videoTrackID(track)] = func(msg message.Message) error {
switch msg := msg.(type) {
case *message.VideoExFramesX:
tu, err := av1.BitstreamUnmarshal(msg.Payload, true)
var tu av1.Bitstream
err := tu.Unmarshal(msg.Payload)
if err != nil {
return fmt.Errorf("unable to decode bitstream: %w", err)
}
@ -546,7 +548,8 @@ func (r *Reader) OnDataAV1(track *format.AV1, cb OnDataAV1Func) {
cb(msg.DTS, tu)
case *message.VideoExCodedFrames:
tu, err := av1.BitstreamUnmarshal(msg.Payload, true)
var tu av1.Bitstream
err := tu.Unmarshal(msg.Payload)
if err != nil {
return fmt.Errorf("unable to decode bitstream: %w", err)
}