VideoCapture unknown property string (Bug #1895)


Added by Stéphane Pinchaux almost 13 years ago. Updated over 9 years ago.


Status:Open Start date:2012-05-06
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:highgui-camera
Target version:-
Affected version:branch '2.4' (2.4-dev) Operating System:Linux
Difficulty: HW Platform:Any
Pull request:

Description

I'm trying to get the properties of my webcam using the function VideoCapture::get.

Most of properties returned are -1, and some errors are printed in the console:
Code:

cout << cam.get(CV_CAP_PROP_POS_MSEC) << endl;
cout << cam.get(CV_CAP_PROP_POS_FRAMES) << endl;
cout << cam.get(CV_CAP_PROP_POS_AVI_RATIO) << endl;
cout << cam.get(CV_CAP_PROP_FRAME_WIDTH) << endl;
cout << cam.get(CV_CAP_PROP_FRAME_HEIGHT) << endl;
cout << cam.get(CV_CAP_PROP_FPS) << endl;
cout << cam.get(CV_CAP_PROP_FOURCC) << endl;
cout << cam.get(CV_CAP_PROP_FRAME_COUNT) << endl;
cout << cam.get(CV_CAP_PROP_FORMAT) << endl;
cout << cam.get(CV_CAP_PROP_MODE) << endl;
cout << cam.get(CV_CAP_PROP_BRIGHTNESS) << endl;
cout << cam.get(CV_CAP_PROP_CONTRAST) << endl;
cout << cam.get(CV_CAP_PROP_SATURATION) << endl;
cout << cam.get(CV_CAP_PROP_HUE) << endl;
cout << cam.get(CV_CAP_PROP_GAIN) << endl;
cout << cam.get(CV_CAP_PROP_EXPOSURE) << endl;
cout << cam.get(CV_CAP_PROP_CONVERT_RGB) << endl;
cout << cam.get(CV_CAP_PROP_RECTIFICATION) << endl;

Properties:
-1
-1
-1
640
480
-1
-1
-1
-1
-1
0.501961
0.12549
0.12549
0
0.0862745
-1
-1
-1

Errors:
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(0) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(1) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(2) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(5) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(6) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(7) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(8) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(9) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property Hue(9963779) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property Exposure(9963793) - Argument invalide
HIGHGUI ERROR: V4L: Exposure control in V4L is not supported
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(16) - Argument invalide
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(18) - Argument invalide

The main problem in my case is I can't get the frame rate, this <unknown property string>(5) may the the root of this problem, V4L2 doesn't know what I want.
Furthermore, the documentation tells "When querying a property that is not supported by the backend used by the VideoCapture class, value 0 is returned.", and I get a lot of '-1'.

I'm using opencv 2.4 (rev 8315), on Fedora 16.
My wecam is a Logitech HD. I can use it with cheese and I can set parameters.


History

Updated by Joel Mckay almost 13 years ago

Many v4l2 drivers do not reliably support direct access to camera properties.

If you want to tweak camera exposure, or change 60/50Hz lighting filters use v4l2ucp xml configuration files:
http://sourceforge.net/projects/v4l2ucp/

Note, the v4l2ucp program may be buggy if changing driver settings that are not normally supported. However, you can run "cheese" to view the video feed as you adjust the camera driver settings on the fly.

Best of luck,
J

Updated by Andrey Kamaev over 12 years ago

  • Category changed from highgui-images to highgui-camera

Updated by Виктор Катаев over 12 years ago

@Joel about what drivers you talking? Guvcview support all this prop and more therefore, uvc driver (main driver fo Linux) support its too. Why it is no default support for uvc in opencv? How i can fix it?

Updated by Alexander Smorkalov almost 11 years ago

  • Assignee deleted (Alexander Reshetnikov)
  • HW Platform set to Any
  • Operating System set to Linux
  • Affected version set to branch '2.4' (2.4-dev)

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4355

Also available in: Atom PDF