Issues with "live" streaming of opus file

Hi,

I’m trying to get the streaming plugin to play a simple opus file in “live” mode and am encountering some issues.

I am using a config like:

test: {
        type = "live"
        id = 1
        description = "test of the streaming plugin"
        filename = "/usr/share/janus/streams/test.opus"
        audio = true
        video = false
}

If I use my own file that I encoded with ffmpeg -i test.wav -c:a libopus -b:a 64K test.opus

I get the error: Can't add 'live' mountpoint 'test', unsupported format (we only support Opus and raw mu-Law/a-Law files right now)

If I use this file at https://opus-codec.org/static/examples/ehren-paper_lights-96.opus I get a different error: Can't add 'file' stream, opus file is not associated with an opus rtpmap

Are there specific opus encoding settings required for the streaming plugin?

And, how does one set the rtpmap setting? I don’t see how to do it it in the docs at Streaming plugin documentation

thanks!

You need to specify the codec to use when creating mountpoints.

Thanks for the reply!

Ok. setting audiocodec = "opus" makes the server happy.

I feel like I tried that before but forgot the quotes with: audiocodec = opus

It might help to add something to the docs that says audiocodec is required for ‘live’ and ‘ondemand’

I can open a separate issue if needed, but I can now connect and request the mountpoint using the generic janus.js api, but it seems to have issues: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to parse SessionDescription. a=rtpmap:0 opus/48000/2 Duplicate statically assigned payload type with conflicting codec name or clock rate.

I don’t see any duplicate entries in the sdp:

"v=0
o=- 1712072175180283 1 IN IP4 159.203.163.231
s=Mountpoint 1
t=0 0
a=group:BUNDLE 0
a=ice-options:trickle
a=fingerprint:sha-256 29:67:A6:67:41:C6:7F:36:BA:88:30:BC:6E:EB:74:DD:F7:48:9A:E1:87:4F:8C:77:05:A6:08:43:BF:29:8D:8B
a=extmap-allow-mixed
a=msid-semantic: WMS *
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 159.203.163.231
a=sendonly
a=mid:0
a=rtcp-mux
a=ice-ufrag:mbSG
a=ice-pwd:iaKa9sC4Vlze8E+HjiHy9l
a=ice-options:trickle
a=setup:actpass
a=rtpmap:0 opus/48000/2
a=rtcp-fb:0 transport-cc
a=msid:janus janus0
a=ssrc:87265777 cname:janus
a=candidate:1 1 udp 2015363327 159.203.163.231 56820 typ host
a=candidate:2 1 udp 2015363583 10.17.0.5 54974 typ host
a=candidate:3 1 udp 2015363839 10.108.0.2 47695 typ host
a=end-of-candidates
"

I’m using default debian pkg with janus v1.1, fwiw.

thanks again for the great work on Janus.

You need to set the payload type too. You’re not doing that so it defaults to 0, which is reserved to mu-law.

That was it!

Thanks so much.