Opened 6 years ago

Last modified 6 years ago

#2305 new enhancement

v4l2 user control configuration mechanism

Reported by: elkq Owned by:
Priority: wish Component: avdevice
Version: git-master Keywords: v4l2
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


avdevice/v4l2.c does not provide a v4l2 user control ( V4L2_CID_* ) listing and configuration mechanism, see

something similar to the capabilities offered by v4l2-ctl --set-ctrl=<ctrl>=<val>[,<ctrl>=<val>] is needed

Change History (4)

comment:1 follow-up: Changed 6 years ago by cehoyos

  • Priority changed from normal to wish
  • Version changed from unspecified to git-master

As-is, this is an invalid ticket.

Please describe in more detail which v4l2 feature FFmpeg is missing.

comment:2 Changed 6 years ago by elkq

I apologize if I am not using the correct format to report this issue.
Please correct me so I might learn the appropriate approach.

In Geotz Dapp asks for an option to ioctl V4L2_CID_AUTO_WHITE_BALANCE false, and an option to ioctl
(from /usr/include/linux/videodev2.h) V4L2_CID_FOCUS_AUTO to V4L2_FOCUS_MANUAL (0).

In addition would very much like to have options to ioctl V4L2_CID_EXPOSURE to zero, V4L2_CID_AUTOGAIN to false, V4L2_CID_CHROMA_AGC to false, V4L2_CID_HUE_AUTO to false, V4L2_CID_AUTOBRIGHTNESS to false.

Last edited 6 years ago by elkq (previous) (diff)

comment:3 in reply to: ↑ 1 Changed 6 years ago by elkq

Replying to cehoyos:

As-is, this is an invalid ticket.

Please describe in more detail which v4l2 feature FFmpeg is missing.

Does the comment above provide sufficient detail to make this a valid ticket?

Last edited 6 years ago by elkq (previous) (diff)

comment:4 Changed 6 years ago by dronus

I think using v4l2-ctl before ffmpeg would be ok if it would work.

Currently ffmpeg does a mess on the settings made by v4l2-ctl. The pixel format is not honored, but must be set by -pixel_format. Doing so it seems tend to reset other parameters, eg. exposure settings or something on some cameras. As those cannot be controlled by ffmpeg, they must be reapplied by v4l2-ctl after starting the capture, a need which renders the first seconds of the capture useless.

So ffmpeg should either provide the full range of controls like cehoyos suggested (much work to do) or just keep whats set up and honor it. As v4l2.c matches up libav and v4l2 pixel formats it may be tricky to keep the already set v4l2 format and honor it, however ffmpeg could fail if no support is possible and suggest a compatible format to be set with v4l2-ctl.

Note: See TracTickets for help on using tickets.