webrtcsink: 'async-std/runtime' panicked at 'called `Option::unwrap()` on a `None` error
I've noticed there are some other issues ( #275 (closed), #278 (closed) ) along these lines but I've been unable to find a solution...
I am installing gstreamer 1.22 as part of lunar:
FROM ubuntu:lunar as base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get upgrade -y
RUN apt-get update && apt-get install -y --no-install-recommends \
ibgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
gstreamer1.0-tools \
gstreamer1.0-x \
gstreamer1.0-alsa \
gstreamer1.0-gl \
gstreamer1.0-gtk3 \
gstreamer1.0-qt5 \
gstreamer1.0-pulseaudio
FROM base as gst-plugin-rs-builder
# install rust
RUN apt-get update && apt-get install -y curl ca-certificates build-essential libssl-dev
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="${PATH}:/root/.cargo/bin"
RUN cargo install cargo-c
# build gst-plugins-rs
WORKDIR /install/gst-plugins-rs
COPY deps/gst-plugins-rs . # THIS IS gst-plugins-rs@gstreamer-1.22.1, I have tried gstreamer-1.22.0 also, same error
RUN apt-get update && apt-get install -y libpango1.0-dev libpangocairo-1.0-0 libcairo2-dev
RUN cargo build
ENV GST_PLUGIN_PATH=/install/gst-plugins-rs/target/debug:$GST_PLUGIN_PATH
ENV WEBRTCSINK_SIGNALLING_SERVER_LOG=debug
ENV RUST_BACKTRACE=1
After building and running this docker image as --network host --privileged
... In 3 terminals I run:
cargo run --bin gst-webrtc-signalling-server
python3 -m http.server -d net/webrtc/www/
gst-launch-1.0 webrtcsink name=ws videotestsrc ! ws. audiotestsrc ! ws.
After connecting on localhost:8000
the following errors is raised:
oot@pop-os:/install/gst-plugins-rs# gst-launch-1.0 webrtcsink congestion-control=disabled name=ws videotestsrc ! ws. audiotestsrc ! ws.
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
Redistribute latency...
thread 'async-std/runtime' panicked at 'called `Option::unwrap()` on a `None` value', net/webrtc/src/webrtcsink/imp.rs:869:14
stack backtrace:
0: rust_begin_unwind
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14
2: core::panicking::panic
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:114:5
3: core::option::Option<T>::unwrap
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/option.rs:823:21
4: gstrswebrtc::webrtcsink::imp::Session::request_webrtcbin_pad
at ./net/webrtc/src/webrtcsink/imp.rs:866:19
5: gstrswebrtc::webrtcsink::imp::WebRTCSink::start_session::{{closure}}
at ./net/webrtc/src/webrtcsink/imp.rs:1672:37
6: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/iter/traits/iterator.rs:834:29
7: core::iter::traits::iterator::Iterator::fold
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/iter/traits/iterator.rs:2438:21
8: core::iter::traits::iterator::Iterator::for_each
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/iter/traits/iterator.rs:837:9
9: gstrswebrtc::webrtcsink::imp::WebRTCSink::start_session
at ./net/webrtc/src/webrtcsink/imp.rs:1669:9
10: gstrswebrtc::webrtcsink::WebRTCSink::start_session
at ./net/webrtc/src/webrtcsink/mod.rs:128:9
11: gstrswebrtc::signaller::imp::Signaller::connect::{{closure}}::{{closure}}
at ./net/webrtc/src/signaller/imp.rs:141:45
12: <async_std::task::builder::SupportTaskLocals<F> as core::future::future::Future>::poll::{{closure}}
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.12.0/src/task/builder.rs:199:17
13: async_std::task::task_locals_wrapper::TaskLocalsWrapper::set_current::{{closure}}
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.12.0/src/task/task_locals_wrapper.rs:60:13
14: std::thread::local::LocalKey<T>::try_with
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/thread/local.rs:446:16
15: std::thread::local::LocalKey<T>::with
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/thread/local.rs:422:9
16: async_std::task::task_locals_wrapper::TaskLocalsWrapper::set_current
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.12.0/src/task/task_locals_wrapper.rs:55:9
17: <async_std::task::builder::SupportTaskLocals<F> as core::future::future::Future>::poll
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.12.0/src/task/builder.rs:197:13
18: async_executor::Executor::spawn::{{closure}}
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.5.0/src/lib.rs:139:19
19: async_task::raw::RawTask<F,T,S>::run
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.3.0/src/raw.rs:511:20
20: async_executor::Executor::run::{{closure}}::{{closure}}
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.5.0/src/lib.rs:230:21
21: <futures_lite::future::Or<F1,F2> as core::future::future::Future>::poll
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:529:33
22: async_executor::Executor::run::{{closure}}
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.5.0/src/lib.rs:237:31
23: <futures_lite::future::Or<F1,F2> as core::future::future::Future>::poll
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:529:33
24: async_io::driver::block_on
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-io-1.12.0/src/driver.rs:146:33
25: async_global_executor::reactor::block_on::{{closure}}
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-global-executor-2.3.1/src/reactor.rs:3:18
26: async_global_executor::reactor::block_on
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-global-executor-2.3.1/src/reactor.rs:12:5
27: async_global_executor::threading::thread_main_loop::{{closure}}::{{closure}}
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-global-executor-2.3.1/src/threading.rs:95:17
28: std::thread::local::LocalKey<T>::try_with
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/thread/local.rs:446:16
29: std::thread::local::LocalKey<T>::with
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/thread/local.rs:422:9
30: async_global_executor::threading::thread_main_loop::{{closure}}
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-global-executor-2.3.1/src/threading.rs:89:13
31: std::panicking::try::do_call
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:483:40
32: std::panicking::try
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:447:19
33: std::panic::catch_unwind
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panic.rs:140:14
34: async_global_executor::threading::thread_main_loop
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/async-global-executor-2.3.1/src/threading.rs:88:12
35: core::ops::function::FnOnce::call_once
at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Some other issues suggested it may be in issue with dtls
or srtp
but these are installed:
root@pop-os:/install/gst-plugins-rs# gst-inspect-1.0 dtls
Plugin Details:
Name dtls
Description DTLS decoder and encoder plugins
Filename /lib/x86_64-linux-gnu/gstreamer-1.0/libgstdtls.so
Version 1.22.0
License BSD
Source module gst-plugins-bad
Documentation https://gstreamer.freedesktop.org/documentation/dtls/
Source release date 2023-01-23
Binary package GStreamer Bad Plugins (Ubuntu)
Origin URL https://launchpad.net/ubuntu/+source/gst-plugins-bad1.0
dtlsdec: DTLS Decoder
dtlsenc: DTLS Encoder
dtlssrtpdec: DTLS-SRTP Decoder
dtlssrtpdemux: DTLS SRTP Demultiplexer
dtlssrtpenc: DTLS-SRTP Encoder
5 features:
+-- 5 elements
root@pop-os:/install/gst-plugins-rs# gst-inspect-1.0 srtp
Plugin Details:
Name srtp
Description GStreamer SRTP
Filename /lib/x86_64-linux-gnu/gstreamer-1.0/libgstsrtp.so
Version 1.22.0
License LGPL
Source module gst-plugins-bad
Documentation https://gstreamer.freedesktop.org/documentation/srtp/
Source release date 2023-01-23
Binary package GStreamer Bad Plugins (Ubuntu)
Origin URL https://launchpad.net/ubuntu/+source/gst-plugins-bad1.0
srtpdec: SRTP decoder
srtpenc: SRTP encoder
2 features:
+-- 2 elements
rtsp is also installed:
root@pop-os:/install/gst-plugins-rs# gst-inspect-1.0 rsrtp
Plugin Details:
Name rsrtp
Description GStreamer Rust RTP Plugin
Filename /install/gst-plugins-rs/target/debug/libgstrsrtp.so
Version 0.9.10-RELEASE
License MPL
Source module gst-plugin-rtp
Documentation https://gstreamer.freedesktop.org/documentation/rsrtp/
Source release date 2023-03-17
Binary package gst-plugin-rtp
Origin URL https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
rtpav1depay: RTP AV1 Depayloader
rtpav1pay: RTP AV1 payloader
rtpgccbwe: Google Congestion Control bandwidth estimator
3 features:
+-- 3 elements
I would really appreciate any further direction.
It would be fantastic to be able do have Dockerfiles which get this going for both lunar
and more ideally for me - jammy
. I was having quite a few issues when compiling gstreamer
to work this gst-plugins-rs
on jammy
which is why I've resorted to the pre-compiled gstreamer
on lunar
.
Thanks for your great work!