selkies-project / docker-nvidia-egl-desktop

KDE Plasma Desktop container designed for Kubernetes, supporting OpenGL EGL and GLX, Vulkan, and Wine/Proton for NVIDIA GPUs through WebRTC and HTML5, providing an open-source remote cloud/HPC graphics or game streaming platform.
https://github.com/selkies-project/docker-nvidia-egl-desktop/pkgs/container/nvidia-egl-desktop
Mozilla Public License 2.0
236 stars 49 forks source link

Missing gstreamer plugins nice, webrtc, dtls, ... #26

Closed elgalu closed 1 year ago

elgalu commented 1 year ago

Hi, thanks a lot for this repo, it's been extremely useful!

I've customized the container considerable and for some reason I get an error after running selkies-gstreamer --addr="127.0.0.1" --port="8080"

Traceback (most recent call last):
  File "/opt/conda/bin/selkies-gstreamer", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.10/site-packages/selkies_gstreamer/__main__.py", line 527, in main
    app = GSTWebRTCApp(stun_servers, turn_servers, enable_audio, audio_channels, curr_fps, args.encoder, curr_video_bitrate, curr_audio_bitrate)
  File "/opt/conda/lib/python3.10/site-packages/selkies_gstreamer/gstwebrtc_app.py", line 83, in __init__
    self.check_plugins()
  File "/opt/conda/lib/python3.10/site-packages/selkies_gstreamer/gstwebrtc_app.py", line 654, in check_plugins
    raise GSTWebRTCAppError('Missing gstreamer plugins:', missing)
gstwebrtc_app.GSTWebRTCAppError: ('Missing gstreamer plugins:', ['nice', 'webrtc', 'dtls', 'srtp', 'rtp', 'sctp', 'rtpmanager', 'ximagesrc', 'nvcodec'])

The plugins seem to be there, any tip on what to look at I would appreciate.

ll /opt/gstreamer/lib/x86_64-linux-gnu/libgstwebrtc-1.0.so
ll /opt/gstreamer/lib/x86_64-linux-gnu/libgstwebrtc-1.0.so.0
ll /opt/gstreamer/lib/x86_64-linux-gnu/libgstwebrtc-1.0.so.0.2005.0
etc...
ehfd commented 1 year ago

@danisla any clues?

elgalu commented 1 year ago

Perhaps related:

WARNING:root:Namespace(json_config='/tmp/selkies_config.json', addr='127.0.0.1', port='8080', enable_basic_auth='true',
basic_auth_user='lgallucci', basic_auth_password='****', web_root='/opt/gst-web', coturn_web_uri='',
coturn_web_username='selkies-0b71d3bd1522', coturn_auth_header_name='x-auth-user', rtc_config_json='/tmp/rtc.json',
turn_shared_secret='', turn_username='', turn_password='', turn_host='', turn_port='', turn_protocol='udp',
turn_tls='false', uinput_mouse_socket='', uinput_js_socket='', enable_audio='true', audio_channels='2',
enable_clipboard='true', app_auto_init='true', app_ready_file='/var/run/appconfig/appready', framerate='30',
video_bitrate='2000', audio_bitrate='64000', encoder='nvh264enc', enable_resize='false', enable_cursors='true',
debug_cursors='false', cursor_size='24', metrics_port='8000', debug=False)
ehfd commented 1 year ago

@elgalu Need all the logs. And which GStreamer did you use?

ehfd commented 1 year ago

@elgalu Oh, and thank you for the sponsorship. I am quite busy so the repository is in maintenance mode, thus I regret not being able to be more active but I really appreciate it. I will add more backlogs.

elgalu commented 1 year ago

Hi, thanks again:) here is the full output of GST_DEBUG=7 selkies-gstreamer --addr="0.0.0.0" --port="6080" https://gist.githubusercontent.com/elgalu/dc6e52d98e6effcc66c4df363bab9bbb/raw/91265f25082f94b2d2fd94a2ed66b0d5524406e5/selkies-gstreamer.sh

Now I switched from WEBRTC_ENCODER="nvh264enc" to "x264enc" so nvcodec is no longer in the list of missing plugins:

gstwebrtc_app.GSTWebRTCAppError: ('Missing gstreamer plugins:', 
['nice', 'webrtc', 'dtls', 'srtp', 'rtp', 'sctp', 'rtpmanager', 'ximagesrc'])

original posted error:

gstwebrtc_app.GSTWebRTCAppError: ('Missing gstreamer plugins:', 
['nice', 'webrtc', 'dtls', 'srtp', 'rtp', 'sctp', 'rtpmanager', 'ximagesrc', 'nvcodec'])
ehfd commented 1 year ago

Just to confirm, did you install all the apt dependencies?

elgalu commented 1 year ago

Yes, all apt dependencies are installed. GStreamer: SELKIES_VERSION="1.3.7". Perhaps the introduction of conda messed up the plugins search paths. We'll use xpra for now. I'll re-open if I can create a reproducible public container some day. Thanks!

ehfd commented 1 year ago

Yes, all apt dependencies are installed. GStreamer: SELKIES_VERSION="1.3.7". Perhaps the introduction of conda messed up the plugins search paths. We'll use xpra for now. I'll re-open if I can create a reproducible public container some day. Thanks!

Ah, wait. Conda. You need to install all the dependencies in Conda.

ehfd commented 1 year ago

Search in conda-forge all the dependencies including Cuda and install everything.

elgalu commented 1 year ago

Cool! so I installed a few gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-python gst-libav webrtcvad and now the list of missing plugins is reduced to 3: 'Missing gstreamer plugins:', ['nice', 'webrtc', 'srtp']

ehfd commented 1 year ago

sudo apt-get update && sudo apt-get install --no-install-recommends -y adwaita-icon-theme-full build-essential python3-pip python3-dev python3-gi python3-setuptools python3-wheel tzdata sudo udev xclip x11-utils xdotool wmctrl jq gdebi-core x11-xserver-utils xserver-xorg-core libopus0 libgdk-pixbuf2.0-0 libsrtp2-1 libxdamage1 libxml2-dev libwebrtc-audio-processing1 libcairo-gobject2 pulseaudio libpulse0 libpangocairo-1.0-0 libgirepository1.0-dev libjpeg-dev libvpx-dev zlib1g-dev x264

This was the long list of dependencies, where I believe you might want to find or build 'nice', 'webrtc', 'srtp' manually on Conda. An alternative for apt's libwebrtc-audio-processing1, libsrtp2-1, and gir1.2-nice-0.1 or libnice10 is needed. I see that there is a separate package gstreamer1.0-nice in apt.

I think: pylibsrtp provides srtp.

https://webrtc.googlesource.com/src https://gitlab.freedesktop.org/libnice/libnice

https://developer.ridgerun.com/wiki/index.php/GStreamer_WebRTC_Wrapper/Getting_the_Code/Building_and_Installation_Guide https://gitlab.freedesktop.org/libnice/libnice/-/issues/112 https://webrtcmagazine.wordpress.com/tag/libnice/

This is pretty much uncharted territory, and I would really appreciate if you could test things. You could ask on #gstreamer at oftc.org IRC or #_oftc_#gstreamer:matrix.org on Matrix for help from GStreamer devs.

Discussion continues on issue https://github.com/selkies-project/selkies-gstreamer/issues/63.

ehfd commented 3 months ago

@elgalu Very late, but a portable distribution is now ready, based on Conda (still can't conda install -c conda-forge selkies-gstreamer but the CI builds them for you).

elgalu commented 3 months ago

thanks!! highly apprecianted<3