Fix OPUS/48000/1 for RTSP from some cameras #1506
This commit is contained in:
+8
-1
@@ -70,9 +70,16 @@ func UnmarshalSDP(rawSDP []byte) ([]*core.Media, error) {
|
|||||||
// Check buggy SDP with fmtp for H264 on another track
|
// Check buggy SDP with fmtp for H264 on another track
|
||||||
// https://github.com/AlexxIT/WebRTC/issues/419
|
// https://github.com/AlexxIT/WebRTC/issues/419
|
||||||
for _, codec := range media.Codecs {
|
for _, codec := range media.Codecs {
|
||||||
if codec.Name == core.CodecH264 && codec.FmtpLine == "" {
|
switch codec.Name {
|
||||||
|
case core.CodecH264:
|
||||||
|
if codec.FmtpLine == "" {
|
||||||
codec.FmtpLine = findFmtpLine(codec.PayloadType, sd.MediaDescriptions)
|
codec.FmtpLine = findFmtpLine(codec.PayloadType, sd.MediaDescriptions)
|
||||||
}
|
}
|
||||||
|
case core.CodecOpus:
|
||||||
|
// fix OPUS for some cameras https://datatracker.ietf.org/doc/html/rfc7587
|
||||||
|
codec.ClockRate = 48000
|
||||||
|
codec.Channels = 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if media.Direction == "" || forceDirection {
|
if media.Direction == "" || forceDirection {
|
||||||
|
|||||||
Reference in New Issue
Block a user