diff --git a/docs/changelog.md b/docs/changelog.md index ff2f5477..2c20b69b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,7 @@ - Broadcast status change is sent to all admins now. - NordVPN replaced with Sponsorblock extension in default configuration #144. - Removed `vncviewer` image, as its functionality is replaced and extended by remmina. +- Opus uses `useinbandfec=1` from now on, hopefully fixes minor audio loss issues. ## [n.eko v2.5](https://github.com/m1k1o/neko/releases/tag/v2.5) diff --git a/server/internal/gst/gst.go b/server/internal/gst/gst.go index a63c3f62..e1d270c8 100644 --- a/server/internal/gst/gst.go +++ b/server/internal/gst/gst.go @@ -160,7 +160,7 @@ func CreateAppPipeline(codecName string, pipelineDevice string, pipelineSrc stri return nil, err } - pipelineStr = fmt.Sprintf(audioSrc+"opusenc bitrate=%d"+pipelineStr, pipelineDevice, bitrate*1000) + pipelineStr = fmt.Sprintf(audioSrc+"opusenc inband-fec=true bitrate=%d"+pipelineStr, pipelineDevice, bitrate*1000) case "G722": // https://gstreamer.freedesktop.org/documentation/libav/avenc_g722.html?gi-language=c // gstreamer1.0-libav diff --git a/server/internal/webrtc/webrtc.go b/server/internal/webrtc/webrtc.go index 44748b74..126d40b9 100644 --- a/server/internal/webrtc/webrtc.go +++ b/server/internal/webrtc/webrtc.go @@ -322,7 +322,7 @@ func (manager *WebRTCManager) createTrack(codecName string) (*webrtc.TrackLocalS codec = webrtc.RTPCodecParameters{RTPCodecCapability: webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypeH264, ClockRate: 90000, Channels: 0, SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f", RTCPFeedback: fb}, PayloadType: 102} id = "video" case "Opus": - codec = webrtc.RTPCodecParameters{RTPCodecCapability: webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypeOpus, ClockRate: 48000, Channels: 2, SDPFmtpLine: "", RTCPFeedback: fb}, PayloadType: 111} + codec = webrtc.RTPCodecParameters{RTPCodecCapability: webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypeOpus, ClockRate: 48000, Channels: 2, SDPFmtpLine: "useinbandfec=1", RTCPFeedback: fb}, PayloadType: 111} id = "audio" case "G722": codec = webrtc.RTPCodecParameters{RTPCodecCapability: webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypeG722, ClockRate: 8000, Channels: 0, SDPFmtpLine: "", RTCPFeedback: fb}, PayloadType: 9}