Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: [SOLVED] Webcam image turned 180 degrees (upside down)?

  1. #11
    Join Date
    Nov 2006
    Location
    UK
    Beans
    661
    Distro
    Ubuntu Development Release

    Lightbulb Re: [SOLVED] Webcam image turned 180 degrees (upside down)?

    Quote Originally Posted by vasilis34 View Post
    I have a similar problem with my camera and I want to adjust the horizontal orientation plus the brightness and contrast. I tried doing what is described in the previous posts but my camera's driver seems to be the uvcvideo driver. I checked the modinfo uvcvideo command but the only parameter I get is trace.

    Could u give me some further help?
    If it is using uvcvideo then it doesn't have the same capabilities. It may be the camera doesn't fully implement the UVC standard - there are several - and therefore uvcvideo can't access all the controls.

    Check the boot log for any clues. You might see something like this:
    Code:
    grep  uvcvideo /var/log/dmesg
    
    [   39.879066] uvcvideo: Found UVC 1.00 device <unnamed> (05ca:1836)
    [   39.879302] uvcvideo: Failed to query (135) UVC control 1 (unit 0) : -32 (exp. 26).
    [   39.879551] uvcvideo: Failed to query (129) UVC control 1 (unit 0) : -32 (exp. 26).
    [   39.879553] uvcvideo: Failed to initialize the device (-5).
    [   39.879572] usbcore: registered new interface driver uvcvideo

  2. #12
    Join Date
    Apr 2008
    Location
    Southern California, USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Webcam image turned 180 degrees (upside down)?

    Quote Originally Posted by IntuitiveNipple View Post
    Thanks, that helps a lot! For information, the driver that manages the camera is stk11xx. It has the vflip option so let's try it. (You can check all the options the driver offers using the command "modinfo stk11xx").

    Unload the driver and then re-load it with the vflip option:
    Code:
    sudo modprobe -r stk11xx
    sudo modprobe stk11xx vflip=1
    Now try your applications. If that has solved the issue you can add the option to the system settings so the driver always uses it when it loads:
    Code:
    echo "options stk11xx vflip=1" | sudo tee -a /etc/modprobe.d/options
    TJ You have to be the Guru on webcams. How did you figure out about "flipping" the above camera? Great find. You have given the best answers to webcam trouble that I have seen so far!

  3. #13
    Join Date
    Jan 2007
    Location
    Stockholm, Sweden
    Beans
    18
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Webcam image turned 180 degrees (upside down)?

    No I don't get any errors. Here is the output of the command

    vasilis@vasilis-laptop:~$ grep uvcvideo /var/log/dmesg
    [ 41.942248] uvcvideo: Found UVC 1.00 device Chicony USB 2.0 Camera (04f2:b008)
    [ 41.944292] usbcore: registered new interface driver uvcvideo
    vasilis@vasilis-laptop:~$

    Generally speaking, what I am trying to find out is how can I tweak my webcam's properties(contrast, brightness, etc). For example I open skype with video and if there isn't enough light I see a really dark picture whereas the same time in cheese the picture looks fine.

  4. #14
    Join Date
    Nov 2006
    Location
    UK
    Beans
    661
    Distro
    Ubuntu Development Release

    Wink Re: Webcam image turned 180 degrees (upside down)?

    Quote Originally Posted by VMC View Post
    TJ You have to be the Guru on webcams. How did you figure out about "flipping" the above camera? Great find. You have given the best answers to webcam trouble that I have seen so far!
    Thanks... it's about time all the hours I've spent working with the kernel and video for my own projects gave some pay-back

    The 'vflip' option is pretty common in webcam drivers - you wouldn't believe how many manufacturers have put the CCDs (Charge-Coupled Devices) in upside down. The 'hflip' option is good if users want a mirror output.

    As with anything technical, if you are precise and get to the crux of an issue the solution will show up. This kind of issue can't be solved with wishy-washy questions or imprecise instructions, or 'cut and paste' solutions, especially for non-technical users. Every step has to be given by example, tested, and contextual explanations help too.

    I have to admit also that I get fed up of users blaming the web-cam when in most cases it is crappy application programming and/or not keeping up with the APIs and protocols.

  5. #15
    Join Date
    Nov 2006
    Location
    UK
    Beans
    661
    Distro
    Ubuntu Development Release

    Lightbulb Re: Webcam image turned 180 degrees (upside down)?

    Quote Originally Posted by vasilis34 View Post
    No I don't get any errors. Here is the output of the command

    vasilis@vasilis-laptop:~$ grep uvcvideo /var/log/dmesg
    [ 41.942248] uvcvideo: Found UVC 1.00 device Chicony USB 2.0 Camera (04f2:b008)
    [ 41.944292] usbcore: registered new interface driver uvcvideo
    vasilis@vasilis-laptop:~$

    Generally speaking, what I am trying to find out is how can I tweak my webcam's properties(contrast, brightness, etc). For example I open skype with video and if there isn't enough light I see a really dark picture whereas the same time in cheese the picture looks fine.
    Okay, that looks good, so you're happy the driver works but yet again it is an application issue.

    If you have a uvcvideo camera you could try installing luvcview from Michel Xhaard's site (scroll almost to the end of the page for the link to the download).

    Here's the instruction for downloading, extracting, building and running it:
    Code:
    cd ~
    wget http://mxhaard.free.fr/spca50x/Investigation/uvc/luvcview-20070512.tar.gz
    tar -xzf luvcview-20070512.tar.gz
    cd luvcview-20070512
    make
    Now run it. Set the device path if it isn't video0:
    Code:
    ./luvcview -f yuv /dev/video0
    With that you can try adjusting settings such as brightness, contrast, saturation, and gain in the GUI. It will report what it is doing in the console:
    Code:
    luvcview version 0.2.1 
    Video driver: x11
    A window manager is available
    video /dev/video0 
    max 127, min 0, step 1, default 63 ,current 64 
    Control name:Brightness set to value:64
    max 127, min 0, step 1, default 63 ,current 65 
    Control name:Brightness set to value:65
    max 127, min 0, step 1, default 63 ,current 66 
    Control name:Brightness set to value:66
    max 127, min 0, step 1, default 63 ,current 67 
    Control name:Brightness set to value:67
    Set Gain up error
    ioctl querycontrol error 22
    Control name:Contrast set to value:78
    max 127, min 0, step 1, default 52 ,current 79

  6. #16
    Join Date
    Jan 2007
    Location
    Stockholm, Sweden
    Beans
    18
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Webcam image turned 180 degrees (upside down)?

    Thx IntuitiveNipple for your quick reply. I ve installed the programm u refer too and it really works.

    Thanks a lot!!!

  7. #17
    Join Date
    Mar 2007
    Beans
    Hidden!

    Question Re: [SOLVED] Webcam image turned 180 degrees (upside down)?

    Hi there,

    I hope you can help me with a similar problem, concerning my usb-camera. The output of

    udevinfo --query=all --name=/dev/video0 --attribute-walk

    is
    Code:
    Udevinfo starts with the device specified by the devpath and then
    walks up the chain of parent devices. It prints for every device
    found, all possible attributes in the udev rules key format.
    A rule to match, can be composed by the attributes of the device
    and the attributes from one single parent device.
    
      looking at device '/devices/pci0000:00/0000:00:02.2/usb3/3-1/3-1.3/video4linux/video0':
        KERNEL=="video0"
        SUBSYSTEM=="video4linux"
        DRIVER==""
        ATTR{dev}=="81:0"
        ATTR{name}=="GSPCA USB Camera"
        ATTR{stream_id}=="JPEG"
        ATTR{model}=="Z-star Vimicro zc0302"
        ATTR{pictsetting}=="force_rgb=0, gamma=3, OffRed=0, OffBlue=0, OffGreen=0, GRed=256, GBlue=256, GGreen= 256 "
    
      looking at parent device '/devices/pci0000:00/0000:00:02.2/usb3/3-1/3-1.3/video4linux':
        KERNELS=="video4linux"
        SUBSYSTEMS==""
        DRIVERS==""
    
      looking at parent device '/devices/pci0000:00/0000:00:02.2/usb3/3-1/3-1.3':
        KERNELS=="3-1.3"
        SUBSYSTEMS=="usb"
        DRIVERS=="usb"
        ATTRS{dev}=="189:262"
        ATTRS{configuration}==""
        ATTRS{bNumInterfaces}==" 3"
        ATTRS{bConfigurationValue}=="1"
        ATTRS{bmAttributes}=="a0"
        ATTRS{bMaxPower}=="160mA"
        ATTRS{urbnum}=="699"
        ATTRS{idVendor}=="0ac8"
        ATTRS{idProduct}=="0302"
        ATTRS{bcdDevice}=="0100"
        ATTRS{bDeviceClass}=="00"
        ATTRS{bDeviceSubClass}=="00"
        ATTRS{bDeviceProtocol}=="00"
        ATTRS{bNumConfigurations}=="1"
        ATTRS{bMaxPacketSize0}=="8"
        ATTRS{speed}=="12"
        ATTRS{busnum}=="3"
        ATTRS{devnum}=="7"
        ATTRS{version}==" 1.10"
        ATTRS{maxchild}=="0"
        ATTRS{quirks}=="0x0"
        ATTRS{authorized}=="1"
        ATTRS{manufacturer}=="V Micro. Corp."
        ATTRS{product}=="PC Camera"
    
      looking at parent device '/devices/pci0000:00/0000:00:02.2/usb3/3-1':
        KERNELS=="3-1"
        SUBSYSTEMS=="usb"
        DRIVERS=="usb"
        ATTRS{dev}=="189:257"
        ATTRS{configuration}==""
        ATTRS{bNumInterfaces}==" 1"
        ATTRS{bConfigurationValue}=="1"
        ATTRS{bmAttributes}=="e0"
        ATTRS{bMaxPower}==" 98mA"
        ATTRS{urbnum}=="1693"
        ATTRS{idVendor}=="0424"
        ATTRS{idProduct}=="a700"
        ATTRS{bcdDevice}=="0000"
        ATTRS{bDeviceClass}=="09"
        ATTRS{bDeviceSubClass}=="00"
        ATTRS{bDeviceProtocol}=="02"
        ATTRS{bNumConfigurations}=="1"
        ATTRS{bMaxPacketSize0}=="64"
        ATTRS{speed}=="480"
        ATTRS{busnum}=="3"
        ATTRS{devnum}=="2"
        ATTRS{version}==" 2.00"
        ATTRS{maxchild}=="4"
        ATTRS{quirks}=="0x0"
        ATTRS{authorized}=="1"
    
      looking at parent device '/devices/pci0000:00/0000:00:02.2/usb3':
        KERNELS=="usb3"
        SUBSYSTEMS=="usb"
        DRIVERS=="usb"
        ATTRS{dev}=="189:256"
        ATTRS{configuration}==""
        ATTRS{bNumInterfaces}==" 1"
        ATTRS{bConfigurationValue}=="1"
        ATTRS{bmAttributes}=="e0"
        ATTRS{bMaxPower}=="  0mA"
        ATTRS{urbnum}=="57"
        ATTRS{idVendor}=="0000"
        ATTRS{idProduct}=="0000"
        ATTRS{bcdDevice}=="0206"
        ATTRS{bDeviceClass}=="09"
        ATTRS{bDeviceSubClass}=="00"
        ATTRS{bDeviceProtocol}=="01"
        ATTRS{bNumConfigurations}=="1"
        ATTRS{bMaxPacketSize0}=="64"
        ATTRS{speed}=="480"
        ATTRS{busnum}=="3"
        ATTRS{devnum}=="1"
        ATTRS{version}==" 2.00"
        ATTRS{maxchild}=="6"
        ATTRS{quirks}=="0x0"
        ATTRS{authorized}=="1"
        ATTRS{manufacturer}=="Linux 2.6.24-19-generic ehci_hcd"
        ATTRS{product}=="EHCI Host Controller"
        ATTRS{serial}=="0000:00:02.2"
        ATTRS{authorized_default}=="1"
    
      looking at parent device '/devices/pci0000:00/0000:00:02.2':
        KERNELS=="0000:00:02.2"
        SUBSYSTEMS=="pci"
        DRIVERS=="ehci_hcd"
        ATTRS{vendor}=="0x10de"
        ATTRS{device}=="0x0068"
        ATTRS{subsystem_vendor}=="0x1043"
        ATTRS{subsystem_device}=="0x0c11"
        ATTRS{class}=="0x0c0320"
        ATTRS{irq}=="16"
        ATTRS{local_cpus}=="ff"
        ATTRS{modalias}=="pci:v000010DEd00000068sv00001043sd00000C11bc0Csc03i20"
        ATTRS{broken_parity_status}=="0"
        ATTRS{msi_bus}==""
    
      looking at parent device '/devices/pci0000:00':
        KERNELS=="pci0000:00"
        SUBSYSTEMS==""
        DRIVERS==""
    Thus, I don't know which driver is used.
    Could you help me?

    Streifenhoernchen

  8. #18
    Join Date
    Nov 2006
    Location
    UK
    Beans
    661
    Distro
    Ubuntu Development Release

    Lightbulb Re: [SOLVED] Webcam image turned 180 degrees (upside down)?

    When in doubt use the USB vendor and device ID:
    Code:
        ATTRS{idVendor}=="0ac8"
        ATTRS{idProduct}=="0302"
    The kernel keeps a text-file with a list of all the supported IDs in /lib/modules/$(uname -r)/modules.usbmap

    You can search that file for the entry that matches. Add the prefix 0x that indicates these are hexadecimal (base 16) numbers:
    Code:
    egrep '0x0ac8.*0x0302'  /lib/modules/$(uname -r)/modules.usbmap
    
    gspca                0x0003      0x0ac8   0x0302    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x0
    The first column is the name of the driver; in this case gspca.
    Last edited by IntuitiveNipple; September 13th, 2008 at 07:44 PM.

  9. #19
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: [SOLVED] Webcam image turned 180 degrees (upside down)?

    Thanks for this hint! Is there for the gspca driver a similar workaround as for the stk11xx driver in the first post? In skype the video of my webcam is upside down ...

    Streifenhoernchen

  10. #20
    Join Date
    Nov 2006
    Location
    UK
    Beans
    661
    Distro
    Ubuntu Development Release

    Lightbulb Re: [SOLVED] Webcam image turned 180 degrees (upside down)?

    When you know the name of a kernel module it is easy to discover what parameters it supports. I won't copy the entire output here since there are a lot of alias entries (they are the list of device IDs the module can manage - this is where the lists in modules.pcimap and modules.usbmap come from), but you can do it yourself:
    Code:
    modinfo gspca
    
    filename:       /lib/modules/2.6.24-21-generic/ubuntu/media/gspcav1/gspca.ko
    license:        GPL
    description:    GSPCA/SPCA5XX USB Camera Driver
    author:         Michel Xhaard <mxhaard@users.sourceforge.net> based on spca50x driver by Joel Crisp <cydergoth@users.sourceforge.net>,ov511 driver by Mark McClelland <mwm@i.am>
    srcversion:     5B17DAD9AD01F291B7EBC04
    alias:          usb:v093Ap2463d*dc*dsc*dp*ic*isc*ip*
    alias:          usb:v093Ap2472d*dc*dsc*dp*ic*isc*ip*
    ...
    alias:          usb:v0733p0430d*dc*dsc*dp*ic*isc*ip*
    depends:        usbcore,videodev,compat_ioctl32
    vermagic:       2.6.24-21-generic SMP mod_unload 
    parm:           autoexpo:Enable/Disable auto exposure (default=1: enabled) (PC-CAM 600/Zc03xx/spca561a/Etoms Only !!!) (int)
    parm:           debug:Debug level: 0=none, 1=init/detection, 2=warning, 3=config/control, 4=function call, 5=max (int)
    parm:           force_rgb:Read RGB instead of BGR (int)
    parm:           gamma:gamma setting range 0 to 7 3-> gamma=1 (int)
    parm:           OffRed:OffRed setting range -128 to 128 (int)
    parm:           OffBlue:OffBlue setting range -128 to 128 (int)
    parm:           OffGreen:OffGreen setting range -128 to 128 (int)
    parm:           GRed:Gain Red setting range 0 to 512 /256  (int)
    parm:           GBlue:Gain Blue setting range 0 to 512 /256  (int)
    parm:           GGreen:Gain Green setting range 0 to 512 /256  (int)
    parm:           compress:Turn on/off compression (not functional yet) (int)
    parm:           usbgrabber:Is a usb grabber 0x0733:0x0430 ? (default 1)  (int)
    parm:           lightfreq:Light frequency banding filter. Set to 50 or 60 Hz, or 0 for NoFlicker (default=50) Zc03xx only (int)
    parm:           force_gamma_id:Forced assigning ID of contrast settings (0=default,1,2,3) Zc03xx only (int)
    parm:           force_sensor_id:Forced assigning ID sensor (Zc03xx only). Dangerous, only for experts !!! (int)
    There is no obvious param that suggest a flip.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •