# Blank output from webcam

## DarkMoon74

When I try to use my webcam, the recording light comes on next to the camera but the output on screen is blank (black).  Output from programs I've tried are below; I've also tried skypeforlinux (what I actually use the webcam with), but when I connect a video call, it crashes. I've tried looking up error messages, but haven't found anything useful yet, and I'm not sure which are actual errors that need to be resolved.

I'm fairly sure that when I first started building this system (about a month ago), it worked, but I've obviously changed something in between then and now, most likely to do with getting my hybrid graphics (Intel Iris Xe & Nvidia MX450) working, since it seems to be capturing fine but not displaying.  Any help would be appreciated.

quvcview

 *Quote:*   

> GUVCVIEW: version 2.0.6
> 
> V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
> 
> V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
> ...

 

cheese

 *Quote:*   

> ../mesa-21.1.7/src/intel/isl/isl.c:2024: FINISHME: ../mesa-21.1.7/src/intel/isl/isl.c:isl_surf_supports_ccs: CCS for 3D textures is disabled, but a workaround is available.
> 
> (cheese:2374): cheese-WARNING **: 06:57:10.822: Can't find vp8enc preset: "Profile Realtime", using alternate preset: "Cheese Realtime". If you see this, make a bug report!
> 
> (cheese:2374): GStreamer-WARNING **: 06:57:10.822: gst_value_deserialize_g_value_array: unimplemented
> ...

 

mplayer tv:// -tv driver=v4l2

 *Quote:*   

> MPlayer 1.4-10.3.0 (C) 2000-2019 MPlayer Team
> 
> Playing tv://.
> 
> TV file format detected.
> ...

 

----------

## wjb

This is quite useful for checking webcam setup

```

$ v4l2-ctl --list-devices

$ v4l2-ctl --all

```

Part of media-tv/v4l-utils

----------

## DarkMoon74

I'm not sure what it tells me, but nothing looks amiss?

v4l2-ctl --list-devices                                                                                                                                                                                                                                                                            

```
Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-6):                                                                                                                                                                                                                                                             

        /dev/video0                                                                                                                                                                                                                 

        /dev/video1

        /dev/media0
```

v4l2-ctl --all

```
Driver Info:

        Driver name      : uvcvideo

        Card type        : Integrated_Webcam_HD: Integrate

        Bus info         : usb-0000:00:14.0-6

        Driver version   : 5.10.61

        Capabilities     : 0x84a00001

                Video Capture

                Metadata Capture

                Streaming

                Extended Pix Format

                Device Capabilities

        Device Caps      : 0x04200001

                Video Capture

                Streaming

                Extended Pix Format

Media Driver Info:

        Driver name      : uvcvideo

        Model            : Integrated_Webcam_HD: Integrate

        Serial           : 

        Bus info         : usb-0000:00:14.0-6

        Media version    : 5.10.61

        Hardware revision: 0x00008262 (33378)

        Driver version   : 5.10.61

Interface Info:

        ID               : 0x03000002

        Type             : V4L Video

Entity Info:

        ID               : 0x00000001 (1)

        Name             : Integrated_Webcam_HD: Integrate

        Function         : V4L2 I/O

        Flags         : default

        Pad 0x01000007   : 0: Sink

          Link 0x02000013: from remote pad 0x100000a of entity 'Extension 4': Data, Enabled, Immutable

Priority: 2

Video input : 0 (Camera 1: ok)

Format Video Capture:

        Width/Height      : 1280/720

        Pixel Format      : 'MJPG' (Motion-JPEG)

        Field             : None

        Bytes per Line    : 0

        Size Image        : 1843789

        Colorspace        : Default

        Transfer Function : Default (maps to Rec. 709)

        YCbCr/HSV Encoding: Default (maps to ITU-R 601)

        Quantization      : Default (maps to Full Range)

        Flags             : 

Crop Capability Video Capture:

        Bounds      : Left 0, Top 0, Width 1280, Height 720

        Default     : Left 0, Top 0, Width 1280, Height 720

        Pixel Aspect: 1/1

Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 720, Flags: 

Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 720, Flags: 

Streaming Parameters Video Capture:

        Capabilities     : timeperframe

        Frames per second: 25.000 (25/1)

        Read buffers     : 0

                     brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=0

                       contrast 0x00980901 (int)    : min=0 max=95 step=1 default=0 value=0

                     saturation 0x00980902 (int)    : min=0 max=100 step=1 default=64 value=64

                            hue 0x00980903 (int)    : min=-2000 max=2000 step=1 default=0 value=0

 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1

                          gamma 0x00980910 (int)    : min=100 max=300 step=1 default=100 value=100

                           gain 0x00980913 (int)    : min=1 max=8 step=1 default=1 value=1

           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=2

                                0: Disabled

                                1: 50 Hz

                                2: 60 Hz

      white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive

                      sharpness 0x0098091b (int)    : min=1 max=7 step=1 default=2 value=2

         backlight_compensation 0x0098091c (int)    : min=0 max=3 step=1 default=3 value=3

                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3

                                1: Manual Mode

                                3: Aperture Priority Mode

              exposure_absolute 0x009a0902 (int)    : min=9 max=625 step=1 default=156 value=156 flags=inactive

         exposure_auto_priority 0x009a0903 (bool)   : default=0 value=0
```

----------

## larrys

DarkMoon74,

I don't know if you noticed this error in your output:

```
Failed to open VDPAU backend libvdpau_va_gl.so: cannot open shared object file: No such file or directory

```

When I did a google search for that library and gentoo, I got directed to this overlay: 

```
  [385] wjn-overlay (https://bitbucket.org/wjn/wjn-overlay)

```

I haven't tried it, and I don't have NVIDIA, so I don't know if this will work for you.

If you haven't used an overlay before, please be aware that you should mask every thing, and then unmask only what you need. For example:

```
$ cat /etc/portage/package.mask/stefantalpalaru 

*/*::stefantalpalaru

$ cat /etc/portage/package.unmask/stefantalpalaru 

app-emulation/vmware-modules::stefantalpalaru

app-emulation/vmware-workstation::stefantalpalaru

```

----------

## DarkMoon74

Hi larrys,

I did notice that in mplayer, but when I tried to look that up, it almost seemed like that was an info message rather than an error?  Nevertheless, I tried emerging libva-vdpau-driver, which I was given to understand should provide that, along with vdpauinfo, but that didn't help.  I'll have a look at that overlay and ebuild and see if that helps.

----------

## DarkMoon74

That hasn't worked:

mplayer tv:// -tv driver=v4l2

 *Quote:*   

> MPlayer 1.4-10.3.0 (C) 2000-2019 MPlayer Team
> 
> Playing tv://.
> 
> TV file format detected.
> ...

 

----------

## wjb

The v4l2-ctl details do look ok, I was mostly wondering if a stray /dev/videoN device had been selected.

The messages from mplayer look like its struggling with the output devices - do the driver files its complaining about actually exist?

Also, I think you can confirm the webcam side is working by using ffmpeg to take a snapshot to a file:

```

$ ffmpeg -i /dev/video0 snapshot.jpg

```

Not too interested in the terminal output this produces, it only matters whether it produces a picture in the jpg file. Yes would mean the problem is with your screen driver setup.

----------

## DarkMoon74

Information below; iHD_drv_video.so doesn't exist, but i965 does.  For ffmpeg, it resulted in a blank image.  I also tried with the two switches it mentioned; -frame gave the same output, but -update gave a "Unrecognized option 'update'" error; maybe it's positional and adding at the end doesn't work?  Adding the pattern resulted in many snapshots; all were black as well.  So I guess it's not the display, it's the camera.  Thanks for the help in ruling that out.

Any ideas from that end?  From what I understand, I should just need UVC support in the kernel, and it's there?

ls -l /usr/lib64/va/drivers/*

```
-rwxr-xr-x 1 root root 8119048 Oct  2 12:36 /usr/lib64/va/drivers/i965_drv_video.so

lrwxrwxrwx 1 root root      18 Oct  2 12:36 /usr/lib64/va/drivers/nvidia_drv_video.so -> vdpau_drv_video.so

lrwxrwxrwx 1 root root      18 Oct  2 12:36 /usr/lib64/va/drivers/s3g_drv_video.so -> vdpau_drv_video.so

-rwxr-xr-x 1 root root     996 Oct  2 12:36 /usr/lib64/va/drivers/vdpau_drv_video.la

-rwxr-xr-x 1 root root   96936 Oct  2 12:36 /usr/lib64/va/drivers/vdpau_drv_video.so
```

ffmpeg -i /dev/video0 snapshot.jpg

```
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers

  built with gcc 10.3.0 (Gentoo 10.3.0-r2 p3)

  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-4.4-r1/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --nm=x86_64-pc-linux-gnu-nm --ranlib=x86_64-pc-linux-gnu-ranlib --pkg-config=x86_64-pc-linux-gnu-pkg-config --optflags='-march=native -mtune=native -O2 -pipe' --extra-libs= --disable-static --enable-avfilter --enable-avresample --disable-stripping --disable-optimizations --disable-libcelt --disable-indev=oss --disable-indev=jack --disable-indev=sndio --disable-outdev=oss --disable-outdev=sndio --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --enable-gnutls --disable-gmp --enable-gpl --disable-hardcoded-tables --enable-iconv --disable-libxml2 --disable-lzma --enable-network --disable-opencl --disable-openssl --enable-postproc --disable-libsmbclient --disable-ffplay --disable-sdl2 --disable-vaapi --enable-vdpau --disable-vulkan --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --enable-opengl --disable-libv4l2 --disable-libpulse --disable-libdrm --disable-libjack --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libcodec2 --enable-libdav1d --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libgme --disable-libgsm --disable-libaribb24 --disable-mmal --disable-libmodplug --disable-libopus --disable-libilbc --disable-librtmp --disable-libssh --disable-libspeex --disable-libsrt --enable-librsvg --enable-ffnvcodec --disable-libvorbis --enable-libvpx --disable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-cuda-llvm --disable-libflite --disable-frei0r --disable-libfribidi --disable-fontconfig --disable-ladspa --disable-libass --disable-libtesseract --disable-lv2 --enable-libfreetype --disable-libvidstab --disable-librubberband --disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-libvo-amrwbenc --enable-libmp3lame --disable-libkvazaar --disable-libaom --disable-libopenh264 --disable-librav1e --disable-libsnappy --enable-libtheora --disable-libtwolame --disable-libwebp --disable-libx264 --disable-libx265 --disable-libxvid --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-vsx --disable-power8 --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --cpu=host --disable-doc --disable-htmlpages --enable-manpages

  libavutil      56. 70.100 / 56. 70.100

  libavcodec     58.134.100 / 58.134.100

  libavformat    58. 76.100 / 58. 76.100

  libavdevice    58. 13.100 / 58. 13.100

  libavfilter     7.110.100 /  7.110.100

  libavresample   4.  0.  0 /  4.  0.  0

  libswscale      5.  9.100 /  5.  9.100

  libswresample   3.  9.100 /  3.  9.100

  libpostproc    55.  9.100 / 55.  9.100

Input #0, video4linux2,v4l2, from '/dev/video0':

  Duration: N/A, start: 106865.793209, bitrate: 147456 kb/s

  Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc

File 'snapshot.jpg' already exists. Overwrite? [y/N] y

Stream mapping:

  Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))

Press [q] to stop, [?] for help

[swscaler @ 0x56042c4f84c0] deprecated pixel format used, make sure you did set range correctly

Output #0, image2, to 'snapshot.jpg':

  Metadata:

    encoder         : Lavf58.76.100

  Stream #0:0: Video: mjpeg, yuvj422p(pc, progressive), 640x480, q=2-31, 200 kb/s, 30 fps, 30 tbn

    Metadata:

      encoder         : Lavc58.134.100 mjpeg

    Side data:

      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A

[image2 @ 0x56042c4ea080] Could not get frame filename number 2 from pattern 'snapshot.jpg'. Use '-frames:v 1' for a single image, or '-update' option, or use a pattern such as %03d within the filename.

av_interleaved_write_frame(): Invalid argument

[image2 @ 0x56042c4ea080] Could not get frame filename number 2 from pattern 'snapshot.jpg'. Use '-frames:v 1' for a single image, or '-update' option, or use a pattern such as %03d within the filename.

av_interleaved_write_frame(): Invalid argument

[image2 @ 0x56042c4ea080] Could not get frame filename number 2 from pattern 'snapshot.jpg'. Use '-frames:v 1' for a single image, or '-update' option, or use a pattern such as %03d within the filename.

av_interleaved_write_frame(): Invalid argument

frame=    4 fps=0.0 q=1.6 Lsize=N/A time=00:00:00.13 bitrate=N/A dup=2 drop=0 speed=  14x    

video:12kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Conversion failed!
```

----------

## wjb

Your ffmoeg logging output is pretty similar to mine, including all the errors/fails.

For kernel config, I have:

```

CONFIG_USB_F_UVC=m

CONFIG_USB_CONFIGFS_F_UVC=y

CONFIG_MEDIA_CAMERA_SUPPORT=y

CONFIG_USB_G_WEBCAM=m

CONFIG_VIDEO_V4L2=y

CONFIG_VIDEO_V4L2_I2C=y

CONFIG_VIDEO_V4L2_SUBDEV_API=y

CONFIG_VIDEOBUF2_V4L2=m

```

----------

## wjb

I've also got the v4l use flag set globally in make.conf, so affects ffmpeg/gstreamer abilities.

----------

## DarkMoon74

I've checked my kernel config; I didn't have the first two UVC options, but the rest were set.  I've set those two, recompiled the kernel, and rebooted; still getting blank output.

And I also already had the v4l USE set globally.

----------

## smartding

There's some recent updates about kernel config for webcams in gentoo wiki: https://wiki.gentoo.org/wiki/Webcam

I followed it, and now the integrated webcam of my laptop is working.

----------

## NeddySeagoon

DarkMoon74,

What errors do you get now?

Are you actually using the new kernel?

Look at the date/time in 

```
uname -a
```

that's the build date/time of the running kernel.

----------

## DarkMoon74

Hi @NeddySeagoon,

Unfortunately, between this and a number of other issues I was having, I've decided to give Arch a try.  On the plus side, I had issues with the web cam on that as well, but it's finally working, so maybe there was a kernel update that fixed this issue.

Cheers for getting back to me though, I do appreciate it.

----------

