CSI Camera Flip method for Python Deepstream 5

• Hardware Platform Jetson Nano 4GB
• DeepStream Version - 5.1
• JetPack Version - 4.5
• TensorRT Version - 7.1.3.0
• Issue Type - questions

Hello,

I am using deepstream 5.1 and CSI camera. I have the issue of 180 degree flipped camera. obviously flip method is not supported in nvvideoconvert in deepstream 5.1 as stated in other posts. I also wish to stay in this version of deepstream.
I read this post and I changed the c code of sources\apps\apps\common\src\deepstream_source_bin.c and saved it. Then I changed in sources\apps\sample_apps\deepstream-app\Makefile and make.

I am not sure what is the next step to see the result in my python code. should I change the pipeline in some way?

I am adding and linking these elements in the beginning of my pipeline.

source = Gst.ElementFactory.make("nvarguscamerasrc", "src-elem")
nvvidconv_src = Gst.ElementFactory.make("nvvideoconvert", "convertor_src")
caps_nvvidconv_src = Gst.ElementFactory.make("capsfilter", "nvmm_caps")

here is the both files I have changed.
deepstream_source_bin.c (49.0 KB)

Makefile (2.6 KB)

I would appericate your feedback and help.

Hi @NegarAbbasi , Could you upgrade your deepstream to the latest version? It may be more convenient to realize your functions with nvvideoconvert plugin. You can refer the following link to check the ‘flip-method’ para:
https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvvideoconvert.html

Thanks for your response. I actually know that I can do it in deepstream 6. However, I would rather stay on my version for this project of mine. Is there any way you could help me with the next step of this process so that I will be able to flip the camera in deepstream 5.1?

@NegarAbbasi , If you use python, you can just refer the c code without change it. You can write the similar code in your python file.

1.add a probe to get the raw data
2.add the flip algorithm in the probe function

yes I use python. would please guide me on how to write a probe to get the raw data? Is there any sample I can follow?

You can refer the link below:
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/blob/master/apps/deepstream-imagedata-multistream/deepstream_imagedata-multistream.py

1 Like

I will give it a try. Thanks.

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