AppSink with pull_sample issue


I’m trying to add following appsink into gstreamer pipeline and get the video out from the gst-meet. But pull_sample method not get frames. Could you please tell me what’s wrong in this code?

  let bin = gstreamer::Bin::new(None);
  let sink_video = gstreamer::ElementFactory::make("appsink", None)?;

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

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

There’s nothing wrong with that part of the code, your problem is going to be in the code around it. Can you provide the full code to reproduce this problem?

Also, instead of spawning a new thread you can go via the new-sample callback like in this example. It will be called whenever a new sample is available (in your case it would still never be called though until you solved the other problem).

Thanks @sdroege

Above code was created as wrapper of gst-meet. I think some linking not happen properly. Same issue for new-sample as well.

This doesn’t have the code to create the actual pipeline.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.