Hello!
I’m testing the 12_camera_v4l2_cuda
sample. After compiling and running, I get a few seconds of a black screen and then the application quits with no frames displayed:
./12_camera_v4l2_cuda -d /dev/video0 -s 1920x1080 -f UYVY -v
INFO: camera_initialize(): (line:303) Camera ouput format: (1920 x 1080) stride: 3840, imagesize: 4147200, frate: 0 / 0
[INFO] (NvEglRenderer.cpp:110) <renderer0> Setting Screen width 1920 height 1080
INFO: init_components(): (line:342) Initialize v4l2 components successfully
WARN: request_camera_buff(): (line:380) Camera v4l2 buf length is not expected
WARN: request_camera_buff(): (line:380) Camera v4l2 buf length is not expected
WARN: request_camera_buff(): (line:380) Camera v4l2 buf length is not expected
WARN: request_camera_buff(): (line:380) Camera v4l2 buf length is not expected
INFO: prepare_buffers(): (line:527) Succeed in preparing stream buffers
INFO: start_stream(): (line:544) Camera video streaming on ...
----------- Element = renderer0 -----------
Total Profiling time = 0
Average FPS = 0
Total units processed = 0
Num. of late units = 0
-------------------------------------
INFO: stop_stream(): (line:710) Camera video streaming off ...
App run was successful
Running this gstreamer pipeline successfully shows video output:
gst-launch-1.0 -vvvvv \
v4l2src device=/dev/video0 ! 'video/x-raw, format=UYVY, width=1920, height=1080' ! \
nvvidconv flip-method=1 ! 'video/x-raw(memory:NVMM), format=I420, width=480, height=640' ! \
nvoverlaysink sync=false
Strangely, if I run 12_camera_v4l2_cuda
again after running gstreamer, the sample app works as expected and I can view video:
./12_camera_v4l2_cuda -d /dev/video0 -s 1920x1080 -f UYVY -v
INFO: camera_initialize(): (line:303) Camera ouput format: (1920 x 1080) stride: 3840, imagesize: 4147200, frate: 0 / 0
[INFO] (NvEglRenderer.cpp:110) <renderer0> Setting Screen width 1920 height 1080
INFO: init_components(): (line:342) Initialize v4l2 components successfully
WARN: request_camera_buff(): (line:380) Camera v4l2 buf length is not expected
WARN: request_camera_buff(): (line:380) Camera v4l2 buf length is not expected
WARN: request_camera_buff(): (line:380) Camera v4l2 buf length is not expected
WARN: request_camera_buff(): (line:380) Camera v4l2 buf length is not expected
INFO: prepare_buffers(): (line:527) Succeed in preparing stream buffers
INFO: start_stream(): (line:544) Camera video streaming on ...
^CQuit due to exit command from user!
----------- Element = renderer0 -----------
Total Profiling time = 10.0577
Average FPS = 30.0269
Total units processed = 303
Num. of late units = 0
-------------------------------------
INFO: stop_stream(): (line:710) Camera video streaming off ...
App run was successful
At this point, 12_camera_v4l2_cuda
will continue working fine until I restart the device, which brings it back to the original no-frames behavior and requires another “warm up” with gstreamer.
Any ideas what might be happening here?
thank you!
For context, this is using a TC358743 HDMI-to-CSI2 bridge configured using a slightly modified driver (ref A, ref B)