diff --git a/server/pkg/types/codec/codecs.go b/server/pkg/types/codec/codecs.go index 07f51818..372975a2 100644 --- a/server/pkg/types/codec/codecs.go +++ b/server/pkg/types/codec/codecs.go @@ -31,6 +31,8 @@ func ParseStr(codecName string) (codec RTPCodec, ok bool) { codec = VP8() case VP9().Name: codec = VP9() + case AV1().Name: + codec = AV1() case H264().Name: codec = H264() case Opus().Name: @@ -134,6 +136,25 @@ func H264() RTPCodec { } } +// TODO: Profile ID. +func AV1() RTPCodec { + return RTPCodec{ + Name: "av1", + PayloadType: 96, + Type: webrtc.RTPCodecTypeVideo, + Capability: webrtc.RTPCodecCapability{ + MimeType: webrtc.MimeTypeAV1, + ClockRate: 90000, + Channels: 0, + SDPFmtpLine: "", + RTCPFeedback: RTCPFeedback, + }, + // https://gstreamer.freedesktop.org/documentation/av1/av1enc.html + // gstreamer1.0-plugins-bad + Pipeline: "av1enc target-bitrate=4096 cpu-used=4 end-usage=cbr undershoot=95 keyframe-max-dist=15 min-quantizer=4 max-quantizer=20", + } +} + func Opus() RTPCodec { return RTPCodec{ Name: "opus",