Hi, I have DeepStream 6.0 with 4.6.0 JetPack with Jetson Nano 4GB.
I have uncalibrated fisheye camera and I want to calibrate it through the dewarp then process for some detection from deepstream but when I seacrh in issues in forum I found this issue that actually fits my problem but when I try to run same command in terminal I always get URI error like:
$sudo ./deepstream-dewarper-app 3 1 v4l2:///dev/video0 0 config_dewarper_perspective.txt
Now playing: 3, 1,
Using winsys: x11
Running...
ERROR from element uri-decode-bin: Invalid URI "3".
Error details: gsturidecodebin.c(1384): gen_source_element (): /GstPipeline:dewarper-app-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin
Returned, stopping playback
Deleting pipeline
In this command I tried every possibilites I can : changing tracker types, sink types, removing all numbers giving only v4l2 source , with and w/o config file but every time it gave me same o/p. I don’ know what I can do.
here is another trial:
$ sudo ./deepstream-dewarper-app v4l2:///dev/video0 0 config_dewarper_perspective.txt
Now playing: v4l2:///dev/video0,
Using winsys: x11
Decodebin child added: source
Decodebin child added: decodebin0
Running...
In cb_newpad
Error: Decodebin did not pick nvidia decoder plugin.
ERROR from element source: Internal data stream error.
Error details: gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:dewarper-app-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstV4l2Src:source:
streaming stopped, reason not-linked (-1)
Returned, stopping playback
Deleting pipeline
and the third:
$ sudo ./deepstream-dewarper-app 2 1 v4l2:///dev/video0 0 config_dewarper_perspective.txt
Now playing: 2, 1,
Using winsys: x11
Running...
ERROR from element uri-decode-bin: Invalid URI "2".
Error details: gsturidecodebin.c(1384): gen_source_element (): /GstPipeline:dewarper-app-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin
Returned, stopping playback
Deleting pipeline
Note that: I used default config just to see it’s working or not.
Your command line is all wrong,please enter the parameters in the correct order. You can refer to our README to learn how to use the command.
Example
// Single Stream
$ ./deepstream-dewarper-app file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_cam6.mp4 6
// Single Stream for Perspective Projection type
$ ./deepstream-dewarper-app --config config_dewarper_perspective.txt file:///opt/nvidia/deepstream/deepstream/samples/streams/yoga.mp4 0
// Multi Stream
$ ./deepstream-dewarper-app file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_cam6.mp4 6 file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_cam6.mp4 6
// Multi Stream for Perspective Projection type
$ ./deepstream-dewarper-app --config config_dewarper_perspective.txt file:///opt/nvidia/deepstream/deepstream/samples/streams/yoga.mp4 0 file:///opt/nvidia/deepstream/deepstream/samples/streams/yoga.mp4 0
// Fish eye distortion correction and perspective projetion
$ ./deepstream-dewarper-app --config config_dewarper_fish_dist_correction.txt file:///opt/nvidia/deepstream/deepstream/samples/streams/fisheye_dist.mp4 0
// Example usage of rot-axes config to get a dewarped surface useful for inferencing applications
$ ./deepstream-dewarper-app --config config_dewarper_rot_axes.txt file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_office.mp4 6
// Example usage of rot-matrix config to use the conventional rotation matrix
$ ./deepstream-dewarper-app --config config_dewarper_rot_matrix.txt file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_office.mp4 6
About the URI, please use the “v4l2:///dev/video0” in the command. But the format of your camera may not be compatible with the source code, you need to modify the source code according to your Camera.
It’s just a example to show how to use the command. Please do not randomly change the order of parameters. When you use the camera, you can change the uri to v4l2:///dev/video0 in the command. You should modify some source code to adapt your own camera, you can refer to the source code: create_camera_source_bin in sources\apps\apps-common\src\deepstream_source_bin.c.
I am able to run this command with fish eye camera: deepstream-app -c /home/ubuntu/Documents/gap/deepstream_app_config.txt /dev/video0
and here is the config file:
1.Deepstream-app demo cannot support dewarper with v4l2 source now. If you want to support it, you need to make some modifications to the source code on your end. Add the create_dewarper_bin logic in the create_camera_source_bin function in sources\apps\apps-common\src\deepstream_source_bin.c file.
2.Could you try to add the diff below to the deepstream_dewarper_test.c to test deepstream-dewarper-app again?
diff
diff --git a/deepstream_dewarper_test.c.bk b/deepstream_dewarper_test.c
index a7c39fa..179c630 100644
--- a/deepstream_dewarper_test.c.bk
+++ b/deepstream_dewarper_test.c
@@ -119,6 +119,7 @@ cb_newpad (GstElement * decodebin, GstPad * decoder_src_pad, gpointer data)
/* Need to check if the pad created by the decodebin is for video and not
* audio. */
if (!strncmp (name, "video", 5)) {
/* Link the decodebin pad only if decodebin has picked nvidia
* decoder plugin nvdec_*. We do this by checking if the pad caps contain
* NVMM memory features. */
@@ -132,6 +133,12 @@ cb_newpad (GstElement * decodebin, GstPad * decoder_src_pad, gpointer data)
gst_object_unref (bin_ghost_pad);
} else {
g_printerr ("Error: Decodebin did not pick nvidia decoder plugin.\n");
+ GstPad *bin_ghost_pad = gst_element_get_static_pad (source_bin, "src");
+ if (!gst_ghost_pad_set_target (GST_GHOST_PAD (bin_ghost_pad),
+ decoder_src_pad)) {
+ g_printerr ("Failed to link decoder src pad to source bin ghost pad\n");
+ }
+ gst_object_unref (bin_ghost_pad);
}
There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks
Yes. There may be some problems with the display format. I have made some changes. You can take a look again and it’s provided in the form of git diff.