# Deepstream\_lpr\_app does not work

**URL:** <https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418>\
**Category:** DeepStream SDK\
**Tags:** jetson, deepstream\
**Created:** [September 11, 2024, 6:59am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418 "2024-09-11T06:59:29Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarodeanil35](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarodeanil35/32/290548_2.png) [@sarodeanil35](https://forums.developer.nvidia.com/u/sarodeanil35)\
**Post date:** [September 11, 2024, 6:59am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/1 "2024-09-11T06:59:29Z")

</div>

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](https://github.com/NVIDIA-AI-IOT/deepstream_lpr_app/blob/master/deepstream-lpr-app/lpr_app_infer_us_config.yml)

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?

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [September 11, 2024, 8:32am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/3 "2024-09-11T08:32:02Z")

</div>

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

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

```

> <https://github.com/NVIDIA-AI-IOT/deepstream_lpr_app/blob/master/deepstream-lpr-app/deepstream_lpr_app.c#L640>

---

<div class="post-metadata">

**Author:** ![sarodeanil35](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarodeanil35/32/290548_2.png) [@sarodeanil35](https://forums.developer.nvidia.com/u/sarodeanil35)\
**Post date:** [September 11, 2024, 8:43am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/4 "2024-09-11T08:43:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [September 11, 2024, 8:46am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/5 "2024-09-11T08:46:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sarodeanil35](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarodeanil35/32/290548_2.png) [@sarodeanil35](https://forums.developer.nvidia.com/u/sarodeanil35)\
**Post date:** [September 11, 2024, 9:06am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/6 "2024-09-11T09:06:02Z")

</div>

> [@junshengy](#):
>
> GST\_DEBUG=3 ./deepstream-lpr-app lpr\_app\_infer\_us\_config.yml

```auto
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.

```

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [September 11, 2024, 9:10am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/7 "2024-09-11T09:10:10Z")

</div>

> [@junshengy](#):
>
> `nvenc = gst_element_factory_make ("x264enc" ,"h264enc");`

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

---

<div class="post-metadata">

**Author:** ![sarodeanil35](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarodeanil35/32/290548_2.png) [@sarodeanil35](https://forums.developer.nvidia.com/u/sarodeanil35)\
**Post date:** [September 11, 2024, 10:19am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/8 "2024-09-11T10:19:47Z")

</div>

To recompile means using `make clean && make` right?

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [September 11, 2024, 10:50am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/9 "2024-09-11T10:50:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sarodeanil35](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarodeanil35/32/290548_2.png) [@sarodeanil35](https://forums.developer.nvidia.com/u/sarodeanil35)\
**Post date:** [September 11, 2024, 11:00am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/10 "2024-09-11T11:00:55Z")

</div>

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

[make\_log.txt](https://forums.developer.nvidia.com/uploads/short-url/hEccuOPJKAZlqi2ghg5lbsiRjsB.txt) (2.8 KB)

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

```auto
  /* 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?

---

<div class="post-metadata">

**Author:** ![sarodeanil35](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarodeanil35/32/290548_2.png) [@sarodeanil35](https://forums.developer.nvidia.com/u/sarodeanil35)\
**Post date:** [September 12, 2024, 8:07am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/11 "2024-09-12T08:07:44Z")

</div>

@junshengy Any update?

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [September 12, 2024, 9:11pm UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/12 "2024-09-12T21:11:27Z")

</div>

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

```auto
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

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

```

Did you make any other changes to the code?

---

<div class="post-metadata">

**Author:** ![sarodeanil35](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarodeanil35/32/290548_2.png) [@sarodeanil35](https://forums.developer.nvidia.com/u/sarodeanil35)\
**Post date:** [September 13, 2024, 7:22am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/13 "2024-09-13T07:22:17Z")

</div>

Hi @junshengy Thanks for your response.

I have attached the log for the provided command.

[log.log](https://forums.developer.nvidia.com/uploads/short-url/lcawqFdD9eZhBwHjToCrBhTXRvW.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

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [September 14, 2024, 6:06am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/14 "2024-09-14T06:06:45Z")

</div>

install gstreamer-libav

```auto
# 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

```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 */

```

---

<div class="post-metadata">

**Author:** ![sarodeanil35](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarodeanil35/32/290548_2.png) [@sarodeanil35](https://forums.developer.nvidia.com/u/sarodeanil35)\
**Post date:** [September 16, 2024, 9:08am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/15 "2024-09-16T09:08:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [September 30, 2024, 9:09am UTC](https://forums.developer.nvidia.com/t/deepstream-lpr-app-does-not-work/306418/16 "2024-09-30T09:09:40Z")

</div>

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