12_camera_v4l2_cuda not working

Hi Guys,

I am trying to understand the sample code available in tegra multimedia api called “12_camera_v4l2_cuda”. When I build the code and run command mentioned in USAGE , I seem to be getting an error.

Command :

./camera_v4l2_cuda -d /dev/video0 -s 640x480 -f YUYV -n 30 -c

Error :

ERROR: camera_initialize(): (line:238) Failed to set camera output format: Invalid argument (22)
ERROR: init_components(): (line:336) Failed to initialize camera device
ERROR: main(): (line:718) Failed to initialize v4l2 components
App run failed

When I checked /dev folder I could find video0 device. Hence, from my guess there is something else which has not been set correctly ( eg. pixel format ) . Please let me know how to resolve this error.


A similar post https://devtalk.nvidia.com/default/topic/1016726/jetson-tx2/cannot-run-example-12_camera_v4l2_cuda-/post/5179174/#5179174

Hi DaneLLL,

Thanks for referring me to this link. However, I have a query. I am able to run camera_recording example successfully but not camera_v4l2_cuda. Could you please suggest what is the difference between the two and why camera_v4l2_cuda might not be working ?


camera_v4l2_cuda is for yuv sensors / usb cameras which don’t go into Tegra ISP.

Hi DaneLLL,

Thanks for your response. If I understand you correctly do you wish to convey that this code will not work using the sensor (IMX274) that I am using ?


Yes, IMX274 is a bayer sensor going into Tegra ISP.