Skip to content

Commit

Permalink
Fix OPUS/48000/1 for RTSP from some cameras #1506
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 29, 2024
1 parent 8ecaabf commit 0d6b8fc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/rtsp/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@ func UnmarshalSDP(rawSDP []byte) ([]*core.Media, error) {
// Check buggy SDP with fmtp for H264 on another track
// https://github.com/AlexxIT/WebRTC/issues/419
for _, codec := range media.Codecs {
if codec.Name == core.CodecH264 && codec.FmtpLine == "" {
codec.FmtpLine = findFmtpLine(codec.PayloadType, sd.MediaDescriptions)
switch codec.Name {
case core.CodecH264:
if codec.FmtpLine == "" {
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
}
}

Expand Down

0 comments on commit 0d6b8fc

Please sign in to comment.