USB CAMERA error on TX1

I am trying to make new source code displaying camera input stream, but I can not fix errors which relate to camera connection. I already confirmed camera connection using software vendor’s application.

This is type 1) error in my source program.

[b]1)
#include “/usr/include/opencv2/opencv.hpp”
using namespace cv;
int main(int argc, char** argv)
{
VideoCapture cap(0);
Mat frame;
if(!cap.isOpened())
{
std::cout<<“open Fail”<<std::endl;
return 0;
}
for(;;)
{
std::cout<<“good”<<std::endl;
cap>>frame;
if(frame.empty()) break;
imshow(“window”,frame);
if(waitKey(1)==27) break;
}
return 0;
}

  1. error:

Unable to stop the stream.: Device or resource busy
Unable to stop the stream.: Bad file descriptor
good
VIDIOC_STREAMON: Bad file descriptor
Unable to stop the stream.: Bad file descriptor[/b]

Type 1) error seems to be appeared after right connection. my source should work, but it’s not.
How can I set camera device input to test on TX1?

Hi nohcap,

Except to try with OpenCV, could you try below gst pipeline to confirm it’s working well?

$ gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvvidconv flip-method=2 ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvoverlaysink -e

Besides, your error message is the same as below one:
https://devtalk.nvidia.com/default/topic/898129/jetson-tx1/enabling-camera-on-jetson-tx1-board/post/4859874/#4859874

Maybe you could try other suggestions from there.

Thanks