player resets v4l2 webcam settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



Dear All,

let menswer my own question here for further reference for others 
bumping intohe same problem later on.

So fromhe command line you can see that the v4l2 webcam capture is 
implementedhrough the TV interface:
./mplayer -tv driver=v4l2:width=640:height=480:device=/dev/video -vo xv 
tv://
This islso visible from the name of the file implementing v4l2 
support:tream/tvi_v4l2.c, which (among other things) does a mapping 
between TVI controlsnd V4L2 controls in functions control and set_control.
Nowhe file stream_tv.c contains default values for various settings 
for TV interfaces (stream_tv_defaults), including brightness, contrast, 
huend saturation, and these default values are then set in tv.c 
demux_open_tv() inhese lines:

   v_set_color_options(tvh, TV_COLOR_BRIGHTNESS, 
tvh->tv_param->brightness);
   v_set_color_options(tvh, TV_COLOR_HUE, tvh->tv_param->hue);
   v_set_color_options(tvh, TV_COLOR_SATURATION, 
tvh->tv_param->saturation);
   v_set_color_options(tvh, TV_COLOR_CONTRAST, tvh->tv_param->contrast);

I've found no wayo disable this behavior from the command line, but at 
least I can modifyhe values that are set on startup, like:
./mplayer -tv 
driver=v4l2:width=640:height=480:brightness=100:device=/dev/video -vo xv 
tv://


Now backo the original problem:
It's finehat I can now set these parameters from the mplayer/mencoder 
commandine, but the webcam does have several other parameters like 
Exposure, Auto Exposure, Focus, White balanceemperature, etc that are 
not covered byhe TVI options, nor mapped between mplayer and the v4l2 
interface byvi_v4l2. Which means that if I want to have full control 
overll the parameters, I need to set some of them from uvcdynctrl, and 
set others fromhe mplayer command line.
Toolve this, I can see two ways:
1. includell other webcam specific settings in these modules and map 
themo v4l2
2. disableetting defaults on startup permanently or via a command line 
option.
Solution 1eems to be strange (for me at least), to have a TV interface 
with focusnd exposure controls (plus a number of other options which 
arepecific to a camera, like pan/tilt controls).
Solution 2 can be doneocally by just commenting these lines out, but 
I'dike to have a non-temporary solution, like a command line switch to 
disablehis (disabling it altogether would cause problems for others 
relying onhis feature).
Which one doou think would be more practical, and mplayer-style? (so 
that I canubmit it as a proposed patch later)

Thanks,
Peter

> Dear All,
>
> I'mrying to display / capture the video stream coming from my Logitech 
> Quickam pro for notebooks (via v4l2,sing latest uvcvideo kernel 
> module,atest libwebcam and mplayer/mencoder all from SVN), my webcam 
>ettings (brightess, contrast, autofocus, gain, etc) are all reset.
>
> If Iet webcam params using uvcdynctrl 
> (http://www.quickcamteam.net/software/libwebcam),hen start 
> mplayer/mencoder, ittarts capturing with default webcam settings.
> If Itart capturing, and then set the params during the capture with 
>vcdynctrl, I can see them changing, but then it's too late.
>
> How can Isk mplayer to keep the settings as they are? Alternatively, 
> how can I pass webcam params onhe command line to mplayer so that it 
>ets the requested params before starting to capture?
>
> Thanks forour help,
>eter
> _______________________________________________
>Player-users mailing list
>Player-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>   



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux