Camera not working in Teams

Because of Coronavirus I have to work in home-office. To be able to have meetings, I had to install Teams (formerly Skype).

Anything works in Teams, except of the camera. The camera works in any other application (Cheese, Guvcview, VLC, …)

I already tried preloading v4l1compat.so and v4l2convert.so:

LD_PRELOAD=/usr/lib64/libv4l/v4l1compat.so /usr/bin/teams
LD_PRELOAD=/usr/lib64/libv4l/v4l2convert.so /usr/bin/teams

I also tried to install Teams with snap and connect the camera:

snap connect teams-for-linux:camera core:camera

I suspect that I have to give Teams permission to access the camera somehow. Can anyone give me a hint to solve this problem?

What does this command report?

snap connections teams-for-linux

I would be surprised if it were a permissions issue as you claim other apps are working as expected, but check the following…

ls -l /dev/video*

Sorry, but I do not use the version installed with snap, because some features are missing. I use the version from the teams repository.

>ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 Mär 31 07:58 /dev/video0

Ok…I made that assumption based on your reference to ‘snap connect teams-for-linux:camera core:camera’

>ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 Mär 31 07:58 /dev/video0

I assume that your user account is a member of the ‘video’ group?

List with

groups
> groups
users video audio

That checks out as expected.

With gstreamer I’m able to stream the output of my usb camera to a v4l2loopback device. Guvcview and Cheese show the output of the usb camera when choosing the v4l2loopback device as video source, but Teams does not.

Whit ffmpeg I’m able to stream a video file to the v4l2loopback device and Teams shows the video file when choosing the v4l2loopback device as video source, but I’m not able to stream the output of my usb camera to the v4l2loopback device with ffmpeg:

Cannot find a proper format for codec 'none' (id 0), pixel format 'none' (id -1)
Assertion *codec_id != AV_CODEC_ID_NONE failed at libavdevice/v4l2.c:811

Or could it be a security feature which prohibits this? For example AppArmor?

How do you load the v4l2loopback device, i.e. with which options? I don’t use Zoom ( and refuse to for the dozens of reasons that are out on the web over the last couple of weeks ), but in other applications it only started working when I configured it like this:


Knurpht-HP:/home/knurpht # cat /etc/modules-load.d/v4l2loopback.conf 
v4l2loopback
Knurpht-HP:/home/knurpht # cat /etc/modprobe.d/50-v4l2loopback.conf 
options v4l2loopback exclusive_caps="1" video_nr=2 card_label="Phone Camera"

With these options, the cam shows up by label, like f.e. the internal cam of my laptop does.


Knurpht-HP:/home/knurpht # cat /etc/modules-load.d/v4l2loopback.conf 
v4l2loopback
Knurpht-HP:/home/knurpht # cat /etc/modprobe.d/50-v4l2loopback.conf 
options v4l2loopback exclusive_caps="1" video_nr=2 card_label="Phone Camera"

And how do I have to stream from /dev/video0 (USBCamera) to /dev/video2, that Teams understand the video stream?

In the internet I read, that many used this method, to get their camera working with Skype.

Evwentualli I solved the problem:

I have to stream from /dev/video0 (USB Camera) to /dev/video1 (Loopback Camera) with the command:

gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert ! v4l2sink device=/dev/video1

With the followinf configureation:

/etc/modules-load.d/v4l2loopback.conf:

v4l2loopback

/etc/modprobe.d/50-v4l2loopback.conf:

options v4l2loopback exclusive_caps="1" video_nr=1 card_label="TeamsCamera"

exclusive_caps has to be the number of the video device created by the v4l2loopback kernel module.

And in Teams I have to select the “TeamsCamera”.

It works with:

gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert ! v4l2sink device=/dev/video1
> cat /etc/modules-load.d/v4l2loopback.conf
v4l2loopback
options v4l2loopback exclusive_caps="1" video_nr=1 card_label="TeamsCamera"

exclusive_caps has to be the number of the video device created by the v4l2loopback kernel module.

Eventually I solved the problem:

I have to stream from /dev/video0 (USB Camera) to /dev/video1 (Loopback Camera) with the command:
Code:

gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert ! v4l2sink device=/dev/video1

With the following configuration:

/etc/modules-load.d/v4l2loopback.conf:
Code:

v4l2loopback

/etc/modprobe.d/50-v4l2loopback.conf:
Code:

options v4l2loopback exclusive_caps=“1” video_nr=1 card_label=“TeamsCamera”

exclusive_caps has to be the number of the video device created by the v4l2loopback kernel module.

In addition in Teams I have to select the “TeamsCamera”.

Since I upgraded to openSUSE 15.2 this does not work anymore.

Streaming the test picture works fine:

PC1:/home/amadrits # gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video1
 Setting pipeline to PAUSED ...
 Pipeline is PREROLLING ...
 Pipeline is PREROLLED ...
 Setting pipeline to PLAYING ...
 New clock: GstSystemClock

And Teams shows the test picture.

Streaming the camera signal to a window does not work anymore:

PC1:/home/amadrits # gst-launch-1.0 -v v4l2src device=/dev/video0 ! ximagesink
 Setting pipeline to PAUSED ...
 Pipeline is live and does not need PREROLL ...
 ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
 Additional debug info:
 gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
 streaming stopped, reason not-negotiated (-4)
 ERROR: pipeline doesn't want to preroll.
 Setting pipeline to PAUSED ...
 Setting pipeline to READY ...
 Setting pipeline to NULL ...
 Freeing pipeline ...

It looks like gstreamer cannot read the camera signal anymore.

Guvcview works fine with this camera.

Could it bee, that a gstreamer package or configuration is missing, or is this a bug in gstreamer?

I have the same problem with my Opensuse Leap 15.2 installation. Strange to say, it once worked, but after an update, it didn’t any more.

As this is an old (15.1) thread and the problem is with 15.2, better start a new thread with the correct prefix to draw the attention of people.

Thanks for the hint, I’ve opened a new thread:

https://forums.opensuse.org/showthread.php/556921-MS-Teams-Microphone-and-video-not-working-after-update