Autrun deepstream app at startup on jetson nano

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson Nano
• DeepStream Version 5.1
• JetPack Version (valid for Jetson only) 4.5.1
• TensorRT Version 7.1.3-1+cuda10.2
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
I want to run my deepstream-image-meta-test at the startup of my Jetson nano…i,e it must be able to Autorun once my system gets started. I tried it with Startup Applications tool in Jetson nano but it didn’t work.
(For a normal python script this was working fine)
After that i tried to insert the command in rc.local but that also didn’t work.
I am getting the error as:

Opening in BLOCKING MODE
Frame Number = 1 Number of objects = 0 Vehicle Count = 0 Person Count = 0
0:00:40.159035402 e[336m 5759e[00m 0x55abd094a0 e[33;01mWARN e[00m e[00m nvinfer gstnvinfer.cpp:1984:gst_nvinfer_output_loop:e[00m error: Internal data stream error.
0:00:40.159067433 e[336m 5759e[00m 0x55abd094a0 e[33;01mWARN e[00m e[00m nvinfer gstnvinfer.cpp:1984:gst_nvinfer_output_loop:e[00m error: streaming stopped, reason error (-5)
ERROR from element primary-nvinference-engine: Internal data stream error.
Error details: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(1984): gst_nvinfer_output_loop (): /GstPipeline:ds-image-meta-test-pipeline/GstNvInfer:primary-nvinference-engine:
streaming stopped, reason error (-5)
Returned, stopping playback
Deleting pipeline

So please help me with this issue and guide me the steps so that i can autorun my deepstream app with an ease.

Thanks!

Hi,
From the log it seems like you don’t execute $ export DISPLAY=:0(or 1) correctly. Please set it for a try. Or you can modify the sample to use nvoverlaysink plugin.

Hi @DaneLLL ,
Thanks for the reply can you please tell me where should i put this $ export DISPLAY=:0(or 1) in my deepstream-image-meta-test code or in rc.local?

Thanks!

my rc.local looks like this:

export DISPLAY=:0
sleep 20
/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-image-meta-test/deepstream-image-meta-test file:///home/photon/Downloads/short.mp4 >> /home/photon/log.txt 2>&1
exit 0

and the error which i am getting is as follows:

No EGL Display
nvbufsurftransform: Could not get EGL display connection

Please help me out with this issue

Hi,
Please try to customize the sample from

... ! nvegltransform ! nveglglessink

to

... ! queue ! nvoverlaysink

May refer to:
[Nano] Deepstream-test3-app not working as expected for multiple video source - #4 by DaneLLL

Not sure but it looks like rc.local runs in root permission and cannot run EGL-based sinks. Please try nvoverlaysink.

Tried this one but i am getting

No EGL Display
nvbufsurftransform: Could not get EGL display connection

What can i do next my requirement is to run deepstream app at startup

@DaneLLL
please provide me some inputs related to my concern on autorunning deepstream application

@DaneLLL
i have made following changes in my deepstream_image_meta_test.c file:

sink = gst_element_factory_make (“fakesink”, “fake-sink”);

earlier it was

sink = gst_element_factory_make (“nvoverlaysink”, “nvvideo-renderer”);

in my rc.local i have added this:

#!/bin/bash
export DISPLAY=:0
/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-image-meta-test/deepstream-image-meta-test file:///home/photon/Downloads/short.mp4 >> /home/photon/log.txt 2>&1
exit 0

But i am getting this as my log and program is not executing:

No protocol specified
No EGL Display
nvbufsurftransform: Could not get EGL display connection
No EGL Display
nvbufsurftransform: Could not get EGL display connection

Please help me out with this issue 🙏
I am facing a lot difficulties in moving to the next steps due to this issue

Hi,
Please refer to
How to Enable /etc/rc.local with Systemd - LinuxBabe

And try this command:

nvidia@dhcp-10-19-107-227:~$ cat /etc/rc.local
#!/bin/bash

/usr/bin/gst-launch-1.0 uridecodebin uri=file:///opt/nvidia/deepstream/deepstrea
m-6.0/samples/streams/sample_720p.mp4 ! mx.sink_0 nvstreammux width=1920 height=
1080 batch-size=1 name=mx ! nvinfer config-file-path=/opt/nvidia/deepstream/deep
stream-6.0/samples/configs/deepstream-app/config_infer_primary_nano.txt unique-i
d=7 ! nvvideoconvert ! nvdsosd ! nvoverlaysink sync=0

Please make sure you can run it and then try deepstream-image-meta-test.

May need to clean the cache:

nvidia@dhcp-10-19-107-227:~$ sudo su
root@dhcp-10-19-107-227:/home/nvidia# rm /root/.cache/gstreamer-1.0/registry.aar
ch64.bin

@DaneLLL

Thanks for the reply…
#!/bin/bash

/usr/bin/gst-launch-1.0 uridecodebin uri=file:///opt/nvidia/deepstream/deepstrea
m-6.0/samples/streams/sample_720p.mp4 ! mx.sink_0 nvstreammux width=1920 height=
1080 batch-size=1 name=mx ! nvinfer config-file-path=/opt/nvidia/deepstream/deep
stream-6.0/samples/configs/deepstream-app/config_infer_primary_nano.txt unique-i
d=7 ! nvvideoconvert ! nvdsosd ! nvoverlaysink sync=0

The above works fine for me…Thanks for that

But what will be the command if i want to run with deepstream-image-meta test that i must put in rc.local
i have tried following commands in my bash file:

#!/bin/bash
/usr/bin/gst-launch-1.0 uridecodebin uri=file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_720p.mp4 ! mx.sink_0 nvstreammux width=1920 height=1080 batch-size=1 name=mx ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-image-meta-test/ds_image_meta_pgie_config.txt unique-id=7 ! nvvideoconvert ! nvdsosd ! nvoverlaysink sync=0
exit 0

#!/bin/bash
/usr/bin/gst-launch-1.0 uridecodebin uri=file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_720p.mp4 ! mx.sink_0 nvstreammux width=1920 height=1080 batch-size=1 name=mx ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-image-meta-test/deepstream-image-meta-test unique-id=7 ! nvvideoconvert ! nvdsosd ! nvoverlaysink sync=0 >> /home/photonplay/log.txt 2>&1
exit 0

But none work for me…
The thing is i want to run my c code i.e deepstream_image_meta_test.c at the startup just like in a way your above solution works.
Please provide me what command should i compose so that i will be able to run my deepstream_image_meta_test.c

Thanks!

Hi,
We are able to run this:

#!/bin/bash
/usr/bin/gst-launch-1.0 uridecodebin uri=file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_720p.mp4 ! mx.sink_0 nvstreammux width=1920 height=1080 batch-size=1 name=mx ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-image-meta-test/ds_image_meta_pgie_config.txt unique-id=7 ! nvvideoconvert ! nvdsosd ! nvoverlaysink sync=0

The config file ds_image_meta_pgie_config.txt can be set and run. For running deepstream-image-meta-test, you would need to modify the sample to have all paths be absolute paths, or it cannot find the config file while the command is executing.

Hi @DaneLLL ,

Thanks for the reply.
I was able to play my video with the bash script provided by you.
But actually my requirement is to run the c code i.e. deepstream_image_meta_test.c

This deepstream_image_meta_test.c code clicks the snapshots of every frame and save the jpeg images corresponding to that this is actually i want to achieve and so i want to run this deepstream_image_meta_test.c at the startup.

I use to run my compiled c code by using:

./deepstream-image-meta-test file:///home/ubuntu/video1.mp4

It is running successfully by executing it from terminal.

My requirement is fulfilled by this c code and i have modified this c code as per my requirement. So my purpose will be only resolved when i will be able to run this c file at Autorun just like i am able to run this above provided bash script.

Looking for a Support from your side to help me run this application.

Thanks
Akshat

Hi,
Since the samples are open source, you should be able to check/build/run either sample and do further debugging. For this use-case, you can enter root user and run

$ /opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-image-meta-test/deepstream-image-meta-test

If you resolve the issues and can run the command successfully, it should work fine to put the command in rc.local.

Thanks a Lot @DaneLLL the above works for me…
Complete command to be added in rc.local will be like:

/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-image-meta-test/deepstream-image-meta-test file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_720p.mp4
1 Like

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