# Issues with "live" streaming of opus file

**URL:** <https://janus.discourse.group/t/issues-with-live-streaming-of-opus-file/969>\
**Category:** General\
**Created:** [April 2, 2024, 3:05am UTC](https://janus.discourse.group/t/issues-with-live-streaming-of-opus-file/969 "2024-04-02T03:05:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![augustblack](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/augustblack/32/150_2.png) [@augustblack](https://janus.discourse.group/u/augustblack)\
**Post date:** [April 2, 2024, 3:05am UTC](https://janus.discourse.group/t/issues-with-live-streaming-of-opus-file/969/1 "2024-04-02T03:05:10Z")

</div>

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:

```auto
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](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](https://janus-legacy.conf.meetecho.com/docs/streaming)

thanks!

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [April 2, 2024, 7:17am UTC](https://janus.discourse.group/t/issues-with-live-streaming-of-opus-file/969/2 "2024-04-02T07:17:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![augustblack](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/augustblack/32/150_2.png) [@augustblack](https://janus.discourse.group/u/augustblack)\
**Post date:** [April 2, 2024, 3:47pm UTC](https://janus.discourse.group/t/issues-with-live-streaming-of-opus-file/969/3 "2024-04-02T15:47:01Z")

</div>

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:

```auto
"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.

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [April 2, 2024, 3:49pm UTC](https://janus.discourse.group/t/issues-with-live-streaming-of-opus-file/969/4 "2024-04-02T15:49:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![augustblack](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/augustblack/32/150_2.png) [@augustblack](https://janus.discourse.group/u/augustblack)\
**Post date:** [April 3, 2024, 11:36pm UTC](https://janus.discourse.group/t/issues-with-live-streaming-of-opus-file/969/5 "2024-04-03T23:36:52Z")

</div>

That was it!

Thanks so much.
