Compare commits

...

2 commits

Author SHA1 Message Date
Nickiel12
823f1313af added mediamtx example files 2024-08-07 03:23:02 +00:00
Nickiel12
f30acbcd76 figured out the plugin conflict 2024-08-07 03:22:52 +00:00
4 changed files with 29 additions and 11 deletions

View file

@ -39,10 +39,10 @@ Some utility commands:
openssl
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
# gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad # contains gst-webrtc
gst_all_1.gst-plugins-ugly
gst_all_1.gst-plugins-rs
gst_all_1.gst-plugins-ugly # contains x264enc
# gst_all_1.gst-plugins-rs #contains whipclientsink
mediamtx
];
cargoHash = nixpkgs.lib.fakeHash;

View file

@ -1,3 +1,9 @@
webrtcAdditionalHosts: [localhost, 0.0.0.0, 127.0.0.1, 10.0.0.114]
logLevel: debug
webrtcLocalTCPAddress: :8188
api: yes
paths:
mystream:
source: publisher

View file

@ -0,0 +1,13 @@
api: no
apiAddress: :9997
apiEncryption: no
paths:
mystream:
source: publisher
webrtc: yes
webrtcAddress: :8889
webrtcLocalUDPAddress: :8189
webrtcEncryption: no

View file

@ -2,7 +2,6 @@ use std::sync::{atomic::AtomicBool, Arc};
use anyhow::Error;
use gstreamer::{prelude::*, Element, ElementFactory, Pipeline, State};
use tracing::info;
use gstrswebrtc::{signaller::Signallable, webrtcsink::WhipWebRTCSink};
@ -22,6 +21,7 @@ fn main() -> Result<(), Error> {
})?;
gstreamer::init()?;
gstrswebrtc::plugin_register_static()?;
let pipeline = Pipeline::with_name("rstp-pipeline");
@ -36,13 +36,12 @@ fn main() -> Result<(), Error> {
.name("whip-sink_123059")
.build()?;
// THIS IS THE LINE CAUSING THE ERROR
if let Some(whipsink) = whipsink.dynamic_cast_ref::<WhipWebRTCSink>() {
//let signaller = whipsink.property::<Signallable>("signaller");
//signaller.set_property_from_str(
// "whip-endpoint",
// &format!("http://localhost:{}/whip_sink/{}", 8889, "mystream"),
//);
if let Some(whipsink) = whipsink.dynamic_cast_ref::<gstrswebrtc::webrtcsink::WhipWebRTCSink>() {
let signaller = whipsink.property::<Signallable>("signaller");
signaller.set_property_from_str(
"whip-endpoint",
&format!("http://localhost:{}/{}/whip", 8889, "mystream"),
);
}
pipeline.add_many([&source, &convert, &whipsink]).unwrap();