add AV1 codec.

This commit is contained in:
Miroslav Šedivý 2024-07-18 18:45:08 +02:00
parent ac76894800
commit 51fb1e7bbe

View File

@ -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",