Cheese, the default app for taking photos or recording via webcam, is not working properly in my case in Ubuntu 22.04.
By launching the app, webcam light turns on and persists only for a few seconds. Then it displays a blank screen with following text:
“There was an error playing video from the webcam”
According to the Ubuntu bug report and the upstream one, it seems to have something to do with the patch for MJPEG output support that causes issue on low end PC (I guess).
And, here are a few workarounds that works in my laptop with HP TrueVision HD Camera.
Workaround 1: Change output resolution
Firstly, launch Cheese and open “Preference” dialog from the hamburger menu. When it opens, change the resolution from 1280×720 to 640×480. Then close the app.
Next, launch Cheese again. It display a blank screen but camera light keeps on in my case. Continue decreasing the resolution until it works again. Then switch back a higher photo/video resolution.
However, the highest 1280×720 resolution produces a corrupted display just as the bug reported. While 640×480 works great in my case.
Workaround 2: Install Cheese 3.38 via Flatpak
The previous v3.38 does not has the issue. It’s available to install via the universal Flatpak package.
1. Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to install the daemon:
sudo apt install flatpak
2. Next, install Cheese as Flatpak using command:
flatpak install https://dl.flathub.org/repo/appstream/org.gnome.Cheese.flatpakref
There’ll be a few hundreds more MB run-time libraries to install for the first time.
Finally, run the command below to launch the Flatpak to see if it works:
flatpak run org.gnome.Cheese
3. (Optional) Remove the pre-installed Cheese package.
The make the app icon in search result to launch Cheese as Flatpak instead of the pre-installed package. You may remove the original package via command:
sudo apt remove cheese
And a system restart is required if you’re first time installing an app as Flatpak.
How to Restore
To remove the Flatpak package, use command:
flatpak uninstall --delete-data org.gnome.Cheese
And install back the original Cheese package using command:
sudo apt install cheese
Workaround 3: PPA with Cheese package (patched)
As @matthew.ruffell mentioned in the bug report, revert the commit will make it work again. This could be a workaround until the upstream fixed the issue.
I’m building the package into PPA. And I’ll add it here for those prefer to use this method.