OvenMediaEngine
OvenMediaEngine copied to clipboard
Support OPUS in SRT Provider
Is your feature request related to a problem? Please describe.
SRT not support OPUS codec.
[2021-06-15 12:57:47.681] E [SPSRT:81] MPEGTS_DEPACKETIZER | mpegts_depacketizer.cpp:555 | Unsupported codec has been received. (pid : 257 stream_type : 6)
Describe the solution you'd like Add OPUS codec for incoming SRT stream. Then audio will be prepared to WebRTC in source, not transcoded with OvenMediaEngine. https://airensoft.gitbook.io/ovenmediaengine/live-source/srt-beta
Do you know where is the documentation on how to packetize/depacketize OPUS in MPEG-2 TS? And how did you transmit OPUS over SRT?
I compiled ffmpeg with srt and opus codec and used command like this: ffmpeg -re -i mp4file.mp4 -vcodec libx264 -vb 2M -acodec libopus -ab 192k -ac 2 -ar 48000 -f mpegts srt://...
I can't find any documentation that can send OPUS over MPEG-2 TS. I thought OPUS/MPEG2-TS was not supported. If anyone knows this, I would be very grateful if you could send me a link to the documentation or information.
I don't know if it's supported or not. But i wanna to move audio transcoding from Oven to encoding server. For now with +/- 14 streams Oven takes 80% CPU with audio encoding...
You can avoid opus encoding if you use webrtc input. I will analyze ffmpeg in the future to try opus support.
Just tested this with ffmpeg as caller and listener. While some codecs get assigned as Private data streams in ffmpeg opus seems to be muxed just fine and is automatically decoded on the receiving end (ffmpeg) while other codecs that get muxed as private data have to be manually extracted.
@getroot just +1'ing this request we could really use this in our workflow as well. there's an OPUS IRC and SRT Alliance Slack i can post in and see if i can get some info passed along.
@getroot OPUS IRC for the win! ( https://kiwiirc.com/nextclient/#ircs://irc.libera.chat/opus )
Some links they provided.
MPEG TS Encap spec that they are working on. https://gitlab.xiph.org/xiph/opus-website/-/merge_requests/10/diffs?commit_id=f3b4351a15f4a05ca9afaa7e2d0b25266f54e578
Tips on checking how ffmpeg is handling the OPUS codec "https://github.com/mpv-player/mpv/issues/8678"
And apparently GStreamer is able to handle the OPUS codec if you wanted to look into that some. https://gstreamer.freedesktop.org/documentation/opus/opusdec.html?gi-language=c
Hope this helps! Happy to test anything you can come up with.
@mithrand1rr Thanks for finding good information. I'll wait for OPUS/MPEG-TS to become an official standard.
As I have seen so far, FFMPEG still handles OPUS as a private stream of MPEG-TS, so it can be used only when the receiving end is aware that the private stream is OPUS in advance. This is not an acceptable method for streaming servers.
I will work on the OPUS/MPEG-TS draft you sent me when it becomes a formal specification. (Even before the document becomes the official version, a little bit in advance if I'm not busy)
@getroot sounds good and totally understand! They sent an updated Draft docs last night here is the link https://opus-codec.org/docs/ETSI_TS_opus-v0.1.3-draft.pdf
I'll let you know if i hear any other updates. And feel free to let me know if there's something in the future to test out. Happy to lend a hand.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.