14

For meetings, I need to change the background to a particular image. I could not see the "Show background effects" feature in my ubuntu 18.04. How can we add a virtual background?

Sivaram Rasathurai
  • 239
  • 1
  • 3
  • 16
  • https://askubuntu.com/q/1228501/367990 includes suggestions how you can use a third party software to emulate a virtual webcam and do the body detection and background merging on the fly. This would work for Teams too. – Byte Commander Aug 20 '21 at 07:21
  • Browse teams.com to and then you can use virtual background option. – Musaddiq Khan Mar 13 '23 at 09:45

4 Answers4

8

As of January 2022, the Teams Background Effects (change/blur) works in Microsoft Edge for Linux. I have it running on Ubuntu 20.04.

Here's what it looks like (option highlighted in red): enter image description here

Create Teams on Edge desktop file

You can also create .desktop file to open MS Edge with Teams. You can do this by:

  1. Copy and rename existing Edge .desktop file from terminial: cp /usr/share/applications/microsoft-edge.desktop ~/.local/share/applications/microsoft-teams-edge.desktop
  2. Edit the file: gedit ~/.local/share/applications/microsoft-teams-edge.desktop
  3. Change Name entry at the top of the file and replace it with something like Name=Teams on Edge Microsoft
  4. Find the Exec entry in the file and replace it with Exec=/usr/bin/microsoft-edge-stable --profile-directory="Default" https://teams.live.com/. If you use multiple MS Edge profiles, change "Default" in the above command to the profile you use for Teams (eg --profile-directory="Profile 1").
  5. Optional: You can also set a unique icon so that Teams on Edge looks different to the default Edge icon. Here is the icon I created for this purpose.

Background

This functionality update is related to Microsoft Feature ID: 85738. It may also work in Chromium-based browsers like Chrome or Brave. Also see here for more info.

Jaydin
  • 1,631
  • 1
  • 23
  • 47
  • I tried running Teams on MS Edge and Google Chrome on my Ubuntu 20.04 machine. As far as I can tell, Teams in browsers provides even less functionalities that the Teams app for Linux. The devices tab in settings is missing and /testcall is not enabled. @JayDin I am guessing that you took the screenshot while receiving a call. If not, please clarify how to access the background settings. Thank you – IvanP May 03 '22 at 08:35
  • UPDATE: the blur background functionality is enabled both on MS Edge and on Google Chrome. Since devices cannot be configured before the beginning of a call and test calls are not enabled in Teams web app, the blurred background can only be enabled when an invite link is opened in browser, or when a call is accepted. Besides the background functionality, I've noticed that screen-sharing is slightly improved in the web app compared to Teams desktop app for Linux – IvanP May 03 '22 at 09:09
  • @IvanP I can do a test call just by using the Meet Now button, so I didn't need an invite link to access the settings. – Jaydin May 03 '22 at 09:12
  • Thank you for your comment. Yes, I did the same. The point is that using Meet Now allows to test the background functionality, but not to test microphone and speakers...which is my main reason for making a test call in view of a meeting. – IvanP May 03 '22 at 09:21
  • If you are still looking for a solution to blur or add background on teams linux native app, I have created a workaround solution to do so.

    https://github.com/prabhakar-sivanesan/MS-Teams-background-changer

    You can check this github repository and follow the instructions there.

    – prabhakar-sivanesan Jul 24 '22 at 21:02
6

The feature is currently absent for Linux systems. According to Change your background for a Teams meeting - Office Support:

  • For now, Linux users aren't able to use this feature.
Kulfy
  • 18,163
0

I use teams-for-linux electron app installed as deb in Ubuntu 22.04 with the following launch parameters

teams-for-linux \
  --isCustomBackgroundEnabled=true \
  --customBGServiceBaseUrl=http://localhost:8888/evergreen-assets/backgroundimages/ \
  --appLogLevels error,warn,info,debug

teams-for-linux is installed from GitHub releases:

VERSION=1.12.6
wget "https://github.com/IsmaelMartinez/teams-for-linux/releases/download/v$VERSION/teams-for-linux_$VERSION_amd64.deb"
sudo dpkg -i "teams-for-linux_$VERSION_amd64.deb"
  1. Prepare the background images
# create a folder for the backgrounds
mdkir ~/teams-backgrounds
cd ~/teams-backgrounds

create subfolders

mkdir -p evergreen-assets/backgroundimages

convert your backgrounds with imagemagick

sudo apt install imagemagick convert /tmp/YourCompanyTeamsBG-4.png
-resize 1920x
-colors 256
-depth 8
-colorspace RGB
evergreen-assets/backgroundimages/YourCompanyTeamsBG-4.png

convert /tmp/YourCompanyTeamsBG-4.png
-resize 280x
-colorspace RGB
-alpha off
evergreen-assets/backgroundimages/YourCompanyTeamsBG-4_thumb.png

remove metadata with exiftool

sudo apt install libimage-exiftool-perl exiftool -all= YourCompanyTeamsBG-4.png

  1. Prepare config.json file

Put the following text to ~/teams-backgrounds/evergreen-assets/backgroundimages/config.json

{
    "videoBackgroundImages": [{
            "name": "YourCompanyTeamsBG-1",
            "id": "YourCompanyTeamsBG-1",
            "filetype": "png",
            "src": "/evergreen-assets/backgroundimages/YourCompanyTeamsBG-1.png?v=0.1",
            "thumb_src": "/evergreen-assets/backgroundimages/YourCompanyTeamsBG-1_thumb.png?v=0.1"
        },
        {
            "name": "YourCompanyTeamsBG-4",
            "id": "YourCompanyTeamsBG-4",
            "filetype": "png",
            "src": "/evergreen-assets/backgroundimages/YourCompanyTeamsBG-4.png?v=0.1",
            "thumb_src": "/evergreen-assets/backgroundimages/YourCompanyTeamsBG-4_thumb.png?v=0.1"
        }
    ]
}
  1. Compare your config.json and pictures' properties with the official ones

https://statics.teams.cdn.office.net/evergreen-assets/backgroundimages/config.json

vimdiff config.json https://statics.teams.cdn.office.net/evergreen-assets/backgroundimages/config.json
vimdiff <(exiftool YourCompanyTeamsBG-4.png) <(exiftool inTheZone1.png)
vimdiff <(exiftool YourCompanyTeamsBG-4_thumb.png) <(exiftool inTheZone1_thumb.png)
  1. Start up local web server

Create ~/nginx_default.conf with the following text

server {
    listen       80;
    server_name  localhost;

location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    autoindex on;

    add_header 'Access-Control-Allow-Origin' '*';
}

error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}

}

Start up the server

cd ~/teams-backgrounds
docker run --rm --name docker_nginx -v "$PWD:/usr/share/nginx/html:ro" -v "$HOME/nginx_default.conf:/etc/nginx/conf.d/default.conf:ro" -p 8888:80 nginx:alpine

I used Nginx instead of python3 -m http.server 8888, because CORS '*' has to be configured, and OPTIONS protocol needs to be supported.

  1. Start teams-for-linux with launch parameters mentioned above.

enter image description here

0

Use obs-studio with obs-backgroundremoval plugin.

  1. Install obs-studio
sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt update
sudo apt install obs-studio
  1. Install obs-backgroundremoval plugin from Github releases
VERSION=1.1.13
wget "https://github.com/locaal-ai/obs-backgroundremoval/releases/download/$VERSION/obs-backgroundremoval-$VERSION-x86_64-linux-gnu.deb"
dpkg -i "obs-backgroundremoval-$VERSION-x86_64-linux-gnu.deb"
  1. Follow video instructions posted on Github to

    a. create a scene

    b. add new source: Video Capture Device (V4L2)

    c. in Video Capture Device (V4L2) Filters add Background Removal (see my params below)

    d. add new Source Image (your Teams background)

  2. Press Start Virtual Camera

  3. Open Teams and choose OBS Virtual Camera

enter image description here

enter image description here

obs-backgroundremoval params that worked fine for me

* Threshold: 0.50 -> 0.15
* Contour Filters (% of image): 0.05
* Smooth silhouette: 0.50
* Feather blend silhouette: 0.00
* Interference device: CPU
* Calculate every X frame: 1
* # CPU threads: 1 -> 4
* Segmentation model: Robust Video Matting
* TemporalSmoothFactor: 0.85
* Sim. thresh.: 35.00
* Blur background: 0.00