mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-26 17:20:23 +08:00
allow RTMP streaming with codecid=av01 or hvc1 (#2232)
* allow RTMP streaming with codecid=av01 or hvc1 Prior to this change, when trying to stream AV1 over enhanced RTMP using XSplit Broadcaster, the server was refusing the content with "unsupported video codec: av01" message. * add tests --------- Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
package message
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bluenviron/mediamtx/internal/rtmp/rawmessage"
|
||||
)
|
||||
|
||||
// ExtendedSequenceStart is a sequence start extended message.
|
||||
type ExtendedSequenceStart struct {
|
||||
FourCC [4]byte
|
||||
Config []byte
|
||||
ChunkStreamID byte
|
||||
MessageStreamID uint32
|
||||
FourCC [4]byte
|
||||
Config []byte
|
||||
}
|
||||
|
||||
// Unmarshal implements Message.
|
||||
func (m *ExtendedSequenceStart) Unmarshal(raw *rawmessage.Message) error {
|
||||
m.ChunkStreamID = raw.ChunkStreamID
|
||||
m.MessageStreamID = raw.MessageStreamID
|
||||
copy(m.FourCC[:], raw.Body[1:5])
|
||||
m.Config = raw.Body[5:]
|
||||
|
||||
@@ -22,5 +24,16 @@ func (m *ExtendedSequenceStart) Unmarshal(raw *rawmessage.Message) error {
|
||||
|
||||
// Marshal implements Message.
|
||||
func (m ExtendedSequenceStart) Marshal() (*rawmessage.Message, error) {
|
||||
return nil, fmt.Errorf("TODO")
|
||||
body := make([]byte, 5+len(m.Config))
|
||||
|
||||
body[0] = 0b10000000 | byte(ExtendedTypeSequenceStart)
|
||||
copy(body[1:5], m.FourCC[:])
|
||||
copy(body[5:], m.Config)
|
||||
|
||||
return &rawmessage.Message{
|
||||
ChunkStreamID: m.ChunkStreamID,
|
||||
Type: uint8(TypeVideo),
|
||||
MessageStreamID: m.MessageStreamID,
|
||||
Body: body,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user