and there is the error:
(DEBUG) try_init_v4l2 VIDIOC_ENUMINPUT “/dev/video0”: Inappropriate ioctl for device
Unable to stop the stream.: Device or resource busy
Unable to stop the stream.: Bad file descriptor
1
VIDIOC_STREAMON: Inappropriate ioctl for device
I also try with gstreamer and nvgstcapture-1.0-sample,
Also the error:
Invalid FPSRange Input
Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingSocket read error. Camera Daemon stopped functioning…
gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn’t want to pause.
Setting pipeline to NULL …
Freeing pipeline …
And still cannot get the stream from camera,please help me!
Thanks!
Hello, ccchen:
Please search a tool called ‘yavta’, which can capture images from V4L2 device (usb camera in your case), to test your usb camera first.
Hi ChenJian:
I don’t find ‘yavta’,but I use ‘cheese’ to test my usb camera and it can work well.
But my opencv can’t work.I wonder if I miss something when I install opencv,cuda .Do you have the guide to install opencv2.4.10, ubuntu14.04 and cuda7.0 or newer version on my tx1 board.
Thank you very much!
Hi,jachen:
Thank you for your advice.
I try to flash the os with Jetpack2.2.1 and install opencv2.4.13 .It really works and I can grab the frame from usb camera,but I want to change the resolution from 640480 to 19201080 by set
V4L2 camera support level depends on kernel driver mostly. We do not exclude OpenCV issue for the particular case, but most probably, some IOCTLs are not implemented for particular camera and that’s why you cannot change camera resolution.
As possible solution, please, try to set resolution before or after cv::VideoCapture::open call.
Thank you for your advice.I have tried to set resolution from 640480 to 19201080 by set
VideoCapture cap(0);
Mat frame;
if(cap.isOpened())
{
cout<<"1"<<endl;
cap.set(CV_CAP_PROP_FRAME_WIDTH,1920);
cap.set(CV_CAP_PROP_FRAME_HEIGHT,1080);
after cv::VideoCapture::open call,but I cannot make any change.Can you give some advice about how to set resolution before open call?
Also,I tried to change resolution of a video ,
VideoCapture cap("video0.avi");
Mat frame;
if(cap.isOpened())
{
cout<<"1"<<endl;
cap.set(CV_CAP_PROP_FRAME_WIDTH,1920);
cap.set(CV_CAP_PROP_FRAME_HEIGHT,1080);
Hello, ccchen:
For USB camera support, it’s provided by openCV. You can track down the related code to dig why resolution-changing does not work.
Per my point, such functions are device-related. USB camera has capabilities for its own. Some support low-resolution with raw format like RGB, and high-resolution with compressed format like JPG.
I think you can find the answer by tracking down openCV core.
I just tried openCV 3.1.0 for usb camera resolution change. It works well.
First please confirm that usb camera can support frame size like 1920x1080. (v4l2-ctl --list-formats-ext -d /dev/video1)
Compile the openCV 3.1.0.
Compile the test program and link against openCV 3.1.0, the following code clip can change the resolution:
int width = 1280;
int height = 720;
printf("Set width to %d\n", width);
cap.set(CV_CAP_PROP_FRAME_WIDTH, width);
printf("Set height to %d\n", height);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, height);