How do I make appsrc start processing multiple images immediately?

Hi,

I’m running a pipeline for processing multiple jpeg images using “appsrc”,

a simple example pipeline:
pipeline = “appsrc ! jpegdec ! videoconvert ! nvvideoconvert ! videoconvert ! jpegenc ! fakesink”

It woks when I send 1,000 images (bytes format) to “appsrc” with "“end-of-stream”
snippets of codes:
(1) .emit(“push-buffer”, buffered_image)
(2) .emit(“end-of-stream”)

However, I had to wait until “appsrc” receive “end-of-stream” signal.
The pipeline paused/stalled if I don’t send “end-of-stream” signal at the end of 1,000 images.
It seems like “loop.run()” is waiting for this “end-of-stream” signal to start processing… not sure.

Is there a way to “appsrc” start processing immediately it receive the first image?

– Sean.

My environments are:

  • Jetson AGX Orin
  • JetPack 5.0.2 (L4T R35.1.0)
  • Deepstream6.1
  • Python 3.8

Could you try to use multifilesrc?

Thanks for reply. Well… however it seems like I cannot use multifilesrc because multifilesrc is reading image files from the local file system, so it doesn’t have a built-in mechanism for receiving image bytes via REST API calls – I need to use xx.emit(“push-buffer”, buffered_image) with rest api call.

Only the thing is that I can send multiple .emit(“push-buffer”, buffered_image) with .emit(“end-of-stream”) at the end, but without .emit(“end-of-stream”) the pipeline (with loop.run()) does not work.

Any suggestions will be appreciated!
Thanks.
–Sean

And, I also removed “loop.run()” and tried to use rest api call but it requires very strict calls of gst-streamer built-in functions – eventually, it failed.
Is there anyone who successfully run a pipeline without loop.run() when using rest api call (Flask) ?

You can refer to our demo code opt\nvidia\deepstream\deepstream\sources\apps\sample_apps\deepstream-appsrc-test\deepstream_appsrc_test_app.c
Appsrc is driven by callback functions.

  g_signal_connect (data.app_source, "need-data", G_CALLBACK (start_feed),
      &data);
  g_signal_connect (data.app_source, "enough-data", G_CALLBACK (stop_feed),
      &data);

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