Kurento / bugtracker

[ARCHIVED] Contents migrated to monorepo: https://github.com/Kurento/kurento
46 stars 10 forks source link

No audio encoder available for source code installation of KMS #621

Closed neilyoung closed 2 years ago

neilyoung commented 2 years ago

Prerequisites

These are MANDATORY, otherwise the issue will be automatically closed.

Issue description

Kurento source installation on ARM - seem to miss an OPUS encoder...

https://gist.github.com/neilyoung/bc67892ec79a0f8de44b46642e7dceeb

Context

While trying to consume a video coming in via PlayerEndpoint I'm missing the audio on the subscriber side.

My KMS log shows this warning:

0:00:06.914841950 78952 0xfffec8014240 WARN              enctreebin kmsenctreebin.c:459:kms_enc_tree_bin_configure:<kmsenctreebin0> Invalid encoder for caps: audio/x-opus, channels=(int)[ 1, 2 ], channel-mapping-family=(int)0

And in fact: gst-inspect-1.5 doesn't show an OPUS encoder.

ubuntu@webrtc:~/kms-build/kms-core/build$ gst-inspect-1.5 | grep opus
libav:  avdec_opus: libav Opus decoder
libav:  avdec_cllc: libav Canopus Lossless Codec decoder
libav:  avdec_hq_hqa: libav Canopus HQ/HQA decoder
libav:  avdec_hqx: libav Canopus HQX decoder
libav:  avmux_opus: libav Ogg Opus muxer
rtp:  rtpopuspay: RTP Opus payloader
rtp:  rtpopusdepay: RTP Opus packet depayloader

What am I missing?

ubuntu@webrtc:~/kms-build/kms-core/build$ kurento-media-server -v
Kurento Media Server version: 6.16.0
Found modules:
    'core' version 6.16.1~15.gcf111ef4
    'elements' version 6.16.1~18.g0807a71
    'filters' version 6.16.1~3.gec9da10
github-actions[bot] commented 2 years ago

Hello @neilyoung! :wave: we're sorry you found a bug... so first of all, thank you very much for reporting it.

To know about progress, check in Triage. All issues are considered Backlog Candidates until work priorities align and the issue is selected for development. It will then become part of our official Backlog.

neilyoung commented 2 years ago

Solved. OPUS encoder was missing due to missing libopus-dev.

j1elo commented 2 years ago

I checked that message in source code and agree that it is a bit misleading. Will change it to something more descriptive:

No encoder plugin found for caps: ...

Also, please let me know if the libopus dependency was missing on some Kurento package, or in some of the gstreamer1.5 packages.

Good news, we're pushing hard these last weeks to bring all of Kurento to newer systems, specifically Ubuntu 20.04 (latest current LTS) while dropping all of our GStreamer fork repos, and using the official packages provided by Ubuntu (gstreamer1.0) instead of our outdated forks (gstreamer1.5).

So compilation of the Kurento project, in general for all architectures, is just about to become much simpler, with less custom dependencies that need to be built.

One nice thing is that on Ubuntu 20.04 we can also drop the libusrsctp and openwebrtc repos, as those are now also provided by the system.

And on the future Ubuntu 22.04, even the openh264 library is provided, so that's even one less custom dependency to build for Kurento! But support for 22.04 is not in the roadmap yet.

I think I should write a community post with this update :) but I'm telling you now because I know you dedicated quite some effort to bring Kurento compilation to ARM, so you'd be affected by all these changes (to the better, hopefully)

neilyoung commented 2 years ago

Hi Juan. Nice to meet you again :)

I checked that message in source code and agree that it is a bit misleading. Will change it to something more descriptive:

I found it very precisely pointing to the real problem :) I patched the mentioned source a bit and added one or two traces and was very quickly able to find the cause. It was really just the Opus encoder missing.

Also, please let me know if the libopus dependency was missing on some Kurento package, or in some of the gstreamer1.5 packages

After installing libopus-dev I was first trying to just re-compile gst-plugin-bad, but this wasn't sufficient. In the end I rebuilt all and it worked out of the box. All means: All the 25+ projects mentioned in the gist.

I don't currently remember, how I assembled all dependencies. However, I have assembled my knowledge in a lengthy gist you already know about (meanwhile updated) and I also have Ansible scripts for installing KMS from source with all dependencies on ARM or X86_64 servers, 20.40, 18.04, including OpenCV4 and all the required patches to make that run. It works like a charm. I'm still in love with your Media Server, because it is still the only one (?) which allows for OpenCV plugins. If you want me to share the scripts, let me know.

I recall that you have had documentation about dependencies for earlier versions, which listed all the required modules (can't find it anymore). My work was based on earlier gists I wrote back in 2018, so I suppose, I never compiled it with Opus encoding support. Up to now I not even noticed it, because I always try to prevent transcoding and in the rare cases when I was using Audio it just worked peer to peer.

Good news, we're pushing hard these last weeks to bring all of Kurento to newer systems, specifically Ubuntu 20.04 (latest current LTS) while dropping all of our GStreamer fork repos, and using the official packages provided by Ubuntu (gstreamer1.0) instead of our outdated forks (gstreamer1.5).

That's indeed a very good news, you are keeping it alive. I would be happy to give it a try, whenever it is available. Please let me know.