I can't record a video from my laptop's webcam

I’ve never been able to record a video using my laptop’s webcam. This includes using Cheese, or Webcamoid or another app that I can’t remember the name of. I’ve tried on ASUS and HP laptops.

I can take a picture and it works as expected. But when I record a video, everything seems to work as in I can see the image, press the record button and it says it’s recording, but the file it creates is a stub with a .webm extension and only 463 bytes (webcamoid) in length.

Is there a setting or something I need to do to make it work? Does anyone else have this problem? I don’t have a separate webcam to test.

1 Like

I recorded a short video with both Cheese and Webcamoid and played back in Celluloid without any issues on my Dell running 24.04.3. There are no settings that I can see within Cheese that would effect how it records,it's a pretty simplistic app.All settings within Webcamoid are default as I just installed it to test.

1 Like

Thanks, Norm24. Maybe it’s just ASUS and HP.

I can understand if the system just didn’t recognize the camera, but it does since I can take a picture. Hopefully we’ll hear from others with laptops from other manufacturers.

1 Like

Are you able to use that webcam to participate in a video conference, e.g., using zoom?

1 Like

I’ve never had to video call with U-MATE. Maybe I can give that a try in the future.

1 Like

Checking the basics first ...

  • Is there any chance that your internal wiring for the camera is loose or disconnected?

  • Have you checked your BIOS to ensure that the video function is correctly recognized and enabled?

  • Have you checked to see if there are any "Linux hardware quirk" applicable to your particular laptop or the particular model of hardware used for your Video camera, which need to be added to GRUB's "GRUB_CMDLINE_LINUX_DEFAULT" parameter?



It would be helpful if you provided the reports from each of the following commands, to help recognize any specific situations unique to your circumstances:

  • v4l2-ctl --list-devices

  • inxi -Fxxx



I would like to point you to the (fully verified and functional) script I created a while back, which uses ffmpeg, the true workhorse of any video application that is available in Linux. You can find it here:

That was intended to provide the OP with a mechanism of recording with an embedded timestamp (with limited options for the date presentation).

I encourage you to review the entire discussion for additional insights, but I am sure you could adapt that to your circumstances.

As a quick test, you could try the following command, and hit CtlC to stop it after a few seconds, to see if you recorded anything:

ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0+0,0 -f pulse -ac 2 -i default -c:v libx264 -preset fast -crf 25 -c:a aac -b:a 128k output.mp4


If that doesn't work, you need to look an any error messages that you might be getting in your

  • /var/log/syslog

for any hints as to the cause of the non-functional behaviour.
:slight_smile:

1 Like

As I wrote, I can take a picture with the webcam. I have several ASUS and HP laptops and they all exhibit this behavior. I’m asking if anyone else has this same experience and if not, what is the laptop brand they are using. Or if anyone knows what is going on.

I know you mean well and appreciate your response but I’m not going down the rabbit hole of trying this that and the other. This is something that should work out of the box.

1 Like

Have you tried guvcview ?
It worked for me on difficult hardware where other apps failed.

1 Like

Yes I have in the past tried gucview without success. That was a couple of yes ago, probably with 20.04. That was the other app I couldn’t remember. That’s an option I could try again with 24.04, maybe something has improved.

Thanks.

2 Likes

My old ASUS G51J webcam worked just fine with guvcview. So its not something that happens to all ASUS laptops.

Other simple ways to test your webcam would be ffplay (i.e. ffplay /dev/video0) and less simply gstreamer:

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! xvimagesink

Both of these (command line) applications can record to a webm file with some extra work.

Shotcut is a GUI program that I use for recording and editing - give that a try too.

2 Likes

Thanks stephematician. All of my ASUS laptops are recent as in they came with Win 11. I don’t know if that makes a difference. I’ll look into the apps you mentioned.

I use Shotcut for video editing but didn’t know that it could record. Thanks for suggesting as I feel comfortable with it.

As a workaround I tried simplescreenrecorder by maximizing the camera app and recording it that way but the quality was poor.

I hate to say it but Windows works great works great with no problems for this purpose.

Thanks again.

1 Like

Yes, and although it "works" - recording in Shotcut isn't a great user experience either.

The basic gist is to "Open Other" then select "Video4Linux" then set device /dev/video0 (or whatever device number for the camera). You can then "Export" then Start/Stop capture. But the camera settings are really limited :frowning: I'll expand on this below.

Absolutely. It really shouldn't be this hard on Linux! :confused:

In the laptop and desktop space, most manufacturers provide way more support to Windows; I doubt we'll ever see parity because of this. And the user base for Windows is massive compared to Linux - so the developers of, say, OBS Studio are incentivised to spend more time supporting Windows, too - hence pipewire audio sources in the base libraries hasn't happened yet.

Back to Shotcut and camera settings...

Just to provide a workaround if anyone else is interested in using a webcam in Shotcut. As an example, I have a Logitech C270 that only supports high frame rates when using JPEG format. Shotcut doesn't allow the user to select the format - it sits on 5FPS at 1280x720 when using the default YUYV. To work around that, I stream the specific format I want to a loopback device:

# set up loopback
sudo modprobe v4l2loopback video_nr=10
# start streaming to loopback
gst-launch-1.0 v4l2src device=/dev/video0 ! \
    'image/jpeg,width=1280,height=720,framerate=30/1' ! \
    v4l2sink device=/dev/video10
# now in shotcut you can do your recording from /dev/video10
# ...
# once you're done, Ctrl-C to finish streaming to loopback, and then to cleanup the loopback:
sudo rmmod v4l2loopback

Here's the catch: If you're using 24.04 - the packaged version of v4l2loopback is so old that this gstreamer pipeline fails (there were a number of V4L2 UAPI hiccups in v4l2loopback at 0.13.2 - eventually the maintainer and myself got them sorted out). So even this workaround needs a workaround! It's madness.

1 Like

Success! I installed guvcview and so far it seems to be working on 4 of the latest ASUS machines I have, even the Lunar Lake machine which wouldn’t even load webcamoid. The only real issues I’m having with it are the proper audio settings to use in the MATE sound settings app which can be confusing at best.

Thanks for suggesting and motivating me to try it again.

3 Likes

So,

The issue was likely caused by a software incompatibility or a bug in the video pipeline on Linux (video driver, output format, V4L handling, etc.). The default application used (or Webcamoid / Cheese) does not properly handle video capture with the built-in webcams of the affected laptops (ASUS, HP). This type of problem seems specific to certain hardware and does not occur on all machines, which explains why other users did not encounter it.

6 Likes