How to set appsink on gst-meet

Hello,

I’m trying to set appsink bin to GStreamer pipeline in lib-gst-meets. And not getting the data from conferences via pull_sample and callback method. Could you please help me on this ?

let bin = gstreamer::Bin::new(None);
  let sink_video = gstreamer::ElementFactory::make("appsink", None)?;
  bin.add(&sink_video)?;
  conference.add_bin(&bin).await?;

  let appsink_video: gstreamer_app::AppSink = sink_video
    .dynamic_cast::<gstreamer_app::AppSink>()
    .expect("Sink element is expected to be an appsink!");

  if let Some(video_element) = bin.by_name("video") {
    conference
    .set_remote_participant_video_sink_element(Some(video_element))
    .await;
  }
  
  thread::spawn(move || {
      loop {
        if let sample = appsink_video.pull_sample().map_err(|_| gstreamer::FlowError::Eos) {
          println!("appsink => {:?}",sample);
        }
      }
  });

Thanks.

bin.by_name("video") will return None because there is no element named video in your bin. You probably want to give that name to the appsink that you create on line 2 of your code (pass Some("video") instead of None as the second parameter to ElementFactory::make).

You can read the gstreamer-rs documentation here (read the documentation for ElementFactory::make in particular), and I recommend asking for general gstreamer help in #gstreamer on OFTC IRC or on the gstreamer forums — I will try to help when I can, but don’t have a lot of time to teach gstreamer basics.

1 Like