Black Screen while detectnet

Hi,
When i run the ./detectnet.py /dev/video1
black screen appeared

the v4l2 check
sadsavunma@sadsavunma-desktop:~$ v4l2-ctl --list-devices
vi-output, ov5693 2-0036 (platform:15700000.vi:2):
/dev/video0

ZED (usb-3530000.xhci-1):
	/dev/video1

sadsavunma@sadsavunma-desktop:~$

ZED encodes both of it’s left/right video frames side-by-side, so you probably wouldn’t want to pass it through detectNet without cropping the image to be only the left or right image first. For an example of that, see this example of using cudaCrop() function -

https://github.com/dusty-nv/jetson-inference/blob/master/docs/aux-image.md#cropping

Regarding the black video, can you try running video-viewer /dev/video1 first? If it is still black, please post the log of the console output.

while i run that you said
video-viewer /dev/video1

it shows

sadsavunma@sadsavunma-desktop:/media/sadsavunma/SD/jetson-inference/build/aarch64/bin$ video-viewer /dev/video1
[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstCamera -- attempting to create device v4l2:///dev/video1

(video-viewer:9100): GStreamer-CRITICAL **: 14:52:54.265: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed

(video-viewer:9100): GStreamer-CRITICAL **: 14:52:54.266: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
[gstreamer] gstCamera -- found v4l2 device: ZED
[gstreamer] v4l2-proplist, device.path=(string)/dev/video1, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)uvcvideo, v4l2.device.card=(string)ZED, v4l2.device.bus_info=(string)usb-3530000.xhci-1, v4l2.device.version=(uint)264588, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera -- found 2 caps for v4l2 device /dev/video1
[gstreamer] [0] video/x-raw, format=(string)YUY2, width=(int)3840, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)2/1;
[gstreamer] [1] video/x-raw, format=(string)YUY2, width=(int)2560, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)4/1;
[gstreamer] gstCamera -- selected device profile:  codec=raw format=yuyv width=2560 height=720
[gstreamer] gstCamera pipeline string:
[gstreamer] v4l2src device=/dev/video1 ! video/x-raw, format=(string)YUY2, width=(int)2560, height=(int)720 ! appsink name=mysink
[gstreamer] gstCamera successfully created device v4l2:///dev/video1
[video]  created gstCamera from v4l2:///dev/video1
------------------------------------------------
gstCamera video options:
------------------------------------------------
  -- URI: v4l2:///dev/video1
     - protocol:  v4l2
     - location:  /dev/video1
     - port:      1
  -- deviceType: v4l2
  -- ioType:     input
  -- codec:      raw
  -- width:      2560
  -- height:     720
  -- frameRate:  4.000000
  -- bitRate:    0
  -- numBuffers: 4
  -- zeroCopy:   true
  -- flipMethod: none
  -- loop:       0
------------------------------------------------
[OpenGL] glDisplay -- X screen 0 resolution:  1280x1024
[OpenGL] glDisplay -- X window resolution:    1280x1024
[OpenGL] glDisplay -- display device initialized (1280x1024)
[video]  created glDisplay from display://0
------------------------------------------------
glDisplay video options:
------------------------------------------------
  -- URI: display://0
     - protocol:  display
     - location:  0
  -- deviceType: display
  -- ioType:     output
  -- codec:      raw
  -- width:      1280
  -- height:     1024
  -- frameRate:  0.000000
  -- bitRate:    0
  -- numBuffers: 4
  -- zeroCopy:   true
  -- flipMethod: none
  -- loop:       0
------------------------------------------------
[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0
[gstreamer] gstreamer changed state from NULL to READY ==> v4l2src0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> v4l2src0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer message new-clock ==> pipeline0
[gstreamer] gstreamer message stream-start ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> v4l2src0
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame
^Creceived SIGINT
video-viewer:  failed to capture video frame
video-viewer:  shutting down...
[gstreamer] gstCamera -- stopping pipeline, transitioning to GST_STATE_NULL
[gstreamer] gstCamera -- pipeline stopped
sadsavunma@sadsavunma-desktop:/media/sadsavunma/SD/jetson-inference/build/aarch64/bin$

by the way, flashed the jetson and install jetpack4.4.1 and i installed ZED SDK

* [ZED SDK for Jetpack 4.4](https://download.stereolabs.com/zedsdk/3.3/jp44/jetsons)3.3.0 (Jetson Nano, NX, TX2, Xavier, CUDA 10.2)

Hi @savunmasad - sorry for the delay. Can you try running video-viewer with the --debug flag and post the console output?

 video-viewer --debug /dev/video1

Also, are you able to confirm that you can view the video through the ZED SDK’s viewer tool?

while run this it shows

glDisplay video options:
------------------------------------------------
  -- URI: display://0
     - protocol:  display
     - location:  0
  -- deviceType: display
  -- ioType:     output
  -- codec:      raw
  -- width:      1360
  -- height:     768
  -- frameRate:  0.000000
  -- bitRate:    0
  -- numBuffers: 4
  -- zeroCopy:   true
  -- flipMethod: none
  -- loop:       0
------------------------------------------------
[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0
[gstreamer] gstreamer changed state from NULL to READY ==> v4l2src0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> v4l2src0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer message new-clock ==> pipeline0
[gstreamer] gstreamer message stream-start ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> v4l2src0
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame
video-viewer:  failed to capture video frame

and same thing happened with /dev/video0

By the way my jetpack is
Screenshot from 2020-11-14 13-06-16

should i downgrade jetpack to 4.2 as you shared in your github page:

or upgrade to 4.4.1

which version would be better?

when i run camera-capture /dev/video0
it shows:
sadsavunma@sadsavunma-desktop:/media/sadsavunma/SD/jetson-inference/python/training/classification$ camera-capture /dev/video0
[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstCamera – attempting to create device v4l2:///dev/video0

(camera-capture:15131): GStreamer-CRITICAL **: 08:48:00.943: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed

(camera-capture:15131): GStreamer-CRITICAL **: 08:48:00.944: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
[gstreamer] gstCamera -- didn't discover any v4l2 devices
[gstreamer] gstCamera -- device discovery failed, but /dev/video0 exists
[gstreamer]              support for compressed formats is disabled
[gstreamer] gstCamera pipeline string:
[gstreamer] v4l2src device=/dev/video0 ! appsink name=mysink
[gstreamer] gstCamera successfully created device v4l2:///dev/video0
[video]  created gstCamera from v4l2:///dev/video0
------------------------------------------------
gstCamera video options:
------------------------------------------------
  -- URI: v4l2:///dev/video0
     - protocol:  v4l2
     - location:  /dev/video0
  -- deviceType: v4l2
  -- ioType:     input
  -- codec:      unknown
  -- width:      1280
  -- height:     720
  -- frameRate:  30.000000
  -- bitRate:    0
  -- numBuffers: 4
  -- zeroCopy:   true
  -- flipMethod: none
  -- loop:       0
------------------------------------------------

camera-capture:  successfully initialized video device (1280x720)
[OpenGL] glDisplay -- X screen 0 resolution:  1360x768
[OpenGL] glDisplay -- X window resolution:    1290x730
[OpenGL] glDisplay -- display device initialized (1290x730)
[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> v4l2src0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> v4l2src0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer message new-clock ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> v4l2src0
[gstreamer] gstCamera -- end of stream (EOS)
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer message stream-start ==> pipeline0
[gstreamer] gstreamer v4l2src0 ERROR Internal data stream error.
[gstreamer] gstreamer Debugging info: gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
[gstreamer] gstreamer changed state from READY to PAUSED ==> mysink
camera-capture:  failed to capture RGBA image from camera
camera-capture:  failed to capture RGBA image from camera
camera-capture:  failed to capture RGBA image from camera
camera-capture:  failed to capture RGBA image from camera
^Creceived SIGINT
camera-capture:  failed to capture RGBA image from camera
camera-capture:  shutting down...
[gstreamer] gstCamera -- stopping pipeline, transitioning to GST_STATE_NULL
[gstreamer] gstCamera -- pipeline stopped
camera-capture:  shutdown complete.
sadsavunma@sadsavunma-desktop:/media/sadsavunma/SD/jetson-inference/python/training/classification$

You can stay with JetPack 4.4.1 - I would not downgrade to 4.2.

It doesn’t seem to be getting any data from the camera. Are you able to confirm that the sample(s) that come with the ZED SDK are able to show the video?

Unfortunately.
Even zed was working without installing sdk. Now show this error and while run with jetson’s own camera.
Actually black screen problem solved but now camera freeze.

I also opened a topic for freezing here

And only i run
Cv.videoCapture(1) for usb camera it’s working but freezing