Custom camera plugin in Deepstream

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) AGX Xavier
• DeepStream Version Deepstream 5.0
• JetPack Version (valid for Jetson only) JP 4.4.1
• TensorRT Version Version

I am trying to modify the way a source is created in deepstream-test5-app to include a custom plugin that reads frames from our camera. I am able to run a Gstreamer pipeline to read frames and perform inference on the input. But, I want to include this as a possible source in deepstream-test5, so that I can easily change the output type - a filesink/RTSP output etc. I was looking at create_source_bin() functon. Is this the right place to modify? Which other place will I need to change code to allow for this? Can anyone kindly guide me through this?

Thank you!

Yes. create_source_bin() function is the write place. But create_source_bin() function use hardware decoder to output video frames, you need to gurantee that your implementation can output hardware output too. Details please refer to the source code.

It is important to understand the code before you modify it. The code itself is the best help.

Thank you for your reply, Fiona Chen. I see a create_multi_source_bin() as well in the code. When I set the input to be a file, in the config file, it is actually hitting this function, instead of create_source_bin(), even when I set the “type” of source to ‘2’ and not ‘3’. Can you kindly explain?
When you say create_source_bin() uses a hardware decoder, do you mean the nvv4l2decoder?

Thank you once again for your reply.

The create_source_bin() is used by the samples such as deepstream-test3, deepstream-opencv-test,…

If you are using deepstream-test5-app, create_multi_source_bin() is used. deepstream-test5-app is relatively complicated. If your pipeline is fixed, you can refer to other simple samples.

nvv4l2decoder is the hardware decoder.