diff --git a/internal/ffmpeg/ffmpeg.go b/internal/ffmpeg/ffmpeg.go index b8b8627a..a2447cc1 100644 --- a/internal/ffmpeg/ffmpeg.go +++ b/internal/ffmpeg/ffmpeg.go @@ -92,8 +92,6 @@ var defaults = map[string]string{ "pcml/8000": "-c:a pcm_s16le -ar:a 8000 -ac:a 1", "pcml/44100": "-c:a pcm_s16le -ar:a 44100 -ac:a 1", - "opus/48000/2": "-c:a libopus -application:a lowdelay -min_comp 0 -ar:a 48000 -ac:a 2", - // hardware Intel and AMD on Linux // better not to set `-async_depth:v 1` like for QSV, because framedrops // `-bf 0` - disable B-frames is very important diff --git a/internal/ffmpeg/producer.go b/internal/ffmpeg/producer.go index 8cb3cb10..867286ff 100644 --- a/internal/ffmpeg/producer.go +++ b/internal/ffmpeg/producer.go @@ -34,16 +34,19 @@ func NewProducer(url string) (core.Producer, error) { p.Type = "FFmpeg producer" p.Medias = []*core.Media{ { + // we can support only audio, because don't know FmtpLine for H264 and PayloadType for MJPEG Kind: core.KindAudio, Direction: core.DirectionRecvonly, + // codecs in order from best to worst Codecs: []*core.Codec{ + // OPUS will always marked as OPUS/48000/2 {Name: core.CodecOpus, ClockRate: 48000, Channels: 2}, {Name: core.CodecAAC, ClockRate: 16000, FmtpLine: aac.FMTP + "1408"}, {Name: core.CodecPCM, ClockRate: 16000}, - {Name: core.CodecPCM, ClockRate: 8000}, {Name: core.CodecPCMA, ClockRate: 16000}, - {Name: core.CodecPCMA, ClockRate: 8000}, {Name: core.CodecPCMU, ClockRate: 16000}, + {Name: core.CodecPCM, ClockRate: 8000}, + {Name: core.CodecPCMA, ClockRate: 8000}, {Name: core.CodecPCMU, ClockRate: 8000}, }, }, @@ -96,7 +99,7 @@ func (p *Producer) newURL() string { case core.CodecAAC: s += "#audio=aac/16000" case core.CodecOpus: - s += "#audio=opus/48000/2" + s += "#audio=opus" } } // add other params