Deepstream_lpr_app does not work

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU): Jetson Orin Nano
• DeepStream Version : 7.0
• JetPack Version (valid for Jetson only): 6.0
• TensorRT Version: Version: 8.6.2
• NVIDIA GPU Driver Version (valid for GPU only) NA
• Issue Type( questions, new requirements, bugs) : questions and errors

I follow all the steps mentioned in deepstream_lpr_app/deepstream-lpr-app/lpr_app_infer_us_config.yml at master · NVIDIA-AI-IOT/deepstream_lpr_app · GitHub

My device is Jetson Orin Nano

When I run the

t-tech@ubuntu:~/deepstream_lpr_app/deepstream-lpr-app$ ./deepstream-lpr-app 
lpr_app_infer_us_config.yml
use_nvinfer_server:0, use_triton_grpc:0
Request sink_0 pad from streammux
One element could not be created. Exiting.

Can anyone help me where I am going wrong?

Orin nano does not support hardware encoding, Try modify the following code to

nvenc = gst_element_factory_make ("x264enc" ,"h264enc");

Okay, I made the changes and reran the make file; when running the./deepstream-lpr-app lpr_app_infer_us_config.yml result is the same.

What is the output of GST_DEBUG=3 ./deepstream-lpr-app lpr_app_infer_us_config.yml ?

t-tech@ubuntu:~/deepstream_lpr_app/deepstream-lpr-app$ GST_DEBUG=3 ./deepstream-lpr-app lpr_app_infer_us_config.yml
use_nvinfer_server:0, use_triton_grpc:0
Request sink_0 pad from streammux
0:00:00.164438638  6531 0xaaaaf3aaa590 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:754:gst_element_factory_make_valist: no such element factory "nvv4l2h264enc"!
One element could not be created. Exiting.

Did you recompile after modifying the code? This error still occurs because the hardware encoding elements cannot be created.

To recompile means using make clean && make right?

Yes, if you modify the code as above, there will be no error that no such element factory "nvv4l2h264enc"!

I have done that but still getting the same error. here are the attached logs
after running the make clean && make

make_log.txt (2.8 KB)

one more thing I noticed is that in deepstream-lpr-app. c file has nvvidconv and nvvidconv1

  /* Use convertor to convert from NV12 to RGBA as required by nvosd */
  nvvidconv = gst_element_factory_make ("nvvideoconvert", "nvvid-converter"); 
  //nvvidconv = gst_element_factory_make ("x264enc", "h264enc");
  /* Create OSD to draw on the converted RGBA buffer */
  nvosd = gst_element_factory_make ("nvdsosd", "nv-onscreendisplay");

  /*nvvidconv1 = gst_element_factory_make ("nvvideoconvert", "nvvid-converter1");*/

  nvvidconv1 = gst_element_factory_make ("x264enc", "h264enc1");

Do I need to make the change in both variable?

@junshengy Any update?

Can you share all the running logs? The log above only includes the compilation log, which cannot be used to analyze the problem.

GST_DEBUG=5 ./deepstream-lpr-app lpr_app_infer_us_config.yml > log.log 2>&1

If you want to use software encoding, you need to make some modifications to the pipeline, and copy the data from the GPU to the CPU.
Just like

...... nvvideoconvert --> capsfilter(video/x-raw,format=NV12) --> x264enc

Did you make any other changes to the code?

Hi @junshengy Thanks for your response.

I have attached the log for the provided command.

log.log (5.2 MB)

If you want to use software encoding, you need to make some modifications to the pipeline and copy the data from the GPU to the CPU.

can you please elaborate on this point?

Did you make any other changes to the code?

NO

install gstreamer-libav

# additional components the user can self install
sudo apt-get update
sudo apt-get install -y gstreamer1.0-libav
# ubuntu 22.04
sudo apt-get install --reinstall -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly  libswresample-dev libavutil-dev libavutil56 libavcodec-dev libavcodec58 libavformat-dev libavformat58 libavfilter7 libde265-dev libde265-0 libx265-199 libx264-163 libvpx7 libmpeg2encpp-2.1-0 libmpeg2-4 libmpg123-0
echo "Deleting GStreamer cache"
rm -rf ~/.cache/gstreamer-1.0/

Apply this patch

diff --git a/deepstream-lpr-app/deepstream_lpr_app.c b/deepstream-lpr-app/deepstream_lpr_app.c
index 85a095c..3baabc5 100644
--- a/deepstream-lpr-app/deepstream_lpr_app.c
+++ b/deepstream-lpr-app/deepstream_lpr_app.c
@@ -637,7 +637,8 @@ main (int argc, char *argv[])
   }
 
   if (isH264)
-      nvenc = gst_element_factory_make ("nvv4l2h264enc" ,"nvvideo-h264enc");
+      //nvenc = gst_element_factory_make ("nvv4l2h264enc" ,"nvvideo-h264enc");
+      nvenc = gst_element_factory_make ("x264enc" ,"nvvideo-h264enc");
   else
       nvenc = gst_element_factory_make ("nvv4l2h265enc" ,"nvvideo-h265enc");
 
@@ -683,6 +684,7 @@ main (int argc, char *argv[])
     sink = gst_element_factory_make ("nveglglessink", "nvvideo-renderer");
   }
 
+  g_print("nvenc %d\n", nvenc == NULL);
   if (!primary_detector || !secondary_detector || !nvvidconv
       || !nvosd || !sink  || !capfilt || !nvenc) {
     g_printerr ("One element could not be created. Exiting.\n");
@@ -768,8 +770,8 @@ main (int argc, char *argv[])
   caps =
       gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING,
           "I420", NULL);
-  feature = gst_caps_features_new ("memory:NVMM", NULL);
-  gst_caps_set_features (caps, 0, feature);
+  // feature = gst_caps_features_new ("memory:NVMM", NULL);
+  // gst_caps_set_features (caps, 0, feature);
   g_object_set (G_OBJECT (capfilt), "caps", caps, NULL);
 
   /* we add a bus message handler */

@junshengy, Thanks for your patience and support. It is working now Jetson Orin Nano. Thanks.

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