LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-08-2023, 09:34 AM   #1
bomberb17
Member
 
Registered: Jul 2005
Posts: 71

Rep: Reputation: 0
Can't capture image or audio from Logitech webcam on Ubuntu server


I have a Logitech C500 webcam and I want to periodically capture image and audio from it, so I am looking to write a simple script. My server is a VM on esxi.

Here is the related info:

Code:
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 006: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 004: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 003: ID 046d:0807 Logitech, Inc. Webcam B500
Bus 001 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ v4l2-ctl --list-devices
UVC Camera (046d:0807) (usb-0000:02:01.0-2):
        /dev/video0

then I run:

Code:
$ fswebcam -r 640x480 --jpeg 85 -D 1 web-cam-shot.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Delaying 1 seconds.
--- Capturing frame...
Timed out waiting for frame!
No frames captured.
I also ran

Code:
$ ffmpeg -f pulse -ac 2 -i default -f v4l2 -i /dev/video0 -t 00:00:10 -vcodec libx264 record.mp4
but the text output stops after the "libpostproc" line and no file is produced.
Any help?
 
Old 12-10-2023, 11:34 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Does the webcam work in a normal app, like vlc/sane/skype or even Zoom?

The two webcams I used were not sensitive enough to use audio input at the levels required. Zoom or pavucontrol let you see the audio input. What do you see?
 
Old 12-11-2023, 09:44 AM   #3
bomberb17
Member
 
Registered: Jul 2005
Posts: 71

Original Poster
Rep: Reputation: 0
My setup is on an Ubuntu server, so no GUI to work with skype or zoom
 
Old 12-11-2023, 11:14 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
Originally Posted by bomberb17 View Post
My setup is on an Ubuntu server, so no GUI to work with skype or zoom
If you're trying to use X apps without X, I have no advice for you really.

EDIT: The fact that you're trying not to use X shopuld really have been in post #1. Do you have any console onlyh video apps on your server?

Last edited by business_kid; 12-11-2023 at 11:29 AM.
 
Old 12-11-2023, 03:36 PM   #5
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 774

Rep: Reputation: 243Reputation: 243Reputation: 243
Do you have all the audio and video modules for it?
Code:
v4l2-ctl --list-devices
HD Webcam C525 (usb-0000:11:00.3-1.1):
	/dev/video0
	/dev/video1
	/dev/media0

lsmod | grep uvc
uvcvideo              118784  0
videobuf2_vmalloc      12288  1 uvcvideo
uvc                    12288  1 uvcvideo
videobuf2_v4l2         36864  1 uvcvideo
videodev              286720  2 videobuf2_v4l2,uvcvideo
videobuf2_common       69632  4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
mc                     65536  5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common

lsusb | grep Logitech
Bus 001 Device 004: ID 046d:0826 Logitech, Inc. HD Webcam C525
There's a CONFIG_HID_LOGITECH for older devices, but I don't have that enabled. I use VideoLAN. The ffmpeg command works, but the output is really long.
 
  


Reply

Tags
audio sound, video streaming



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't capture audio without introducing noise (sound-card line-in or capture card) Holering Linux - Hardware 7 01-02-2014 09:33 PM
LXer: Soul Capture 2.0.0 has now been released audio/video capture LXer Syndicated Linux News 0 04-01-2013 12:01 PM
[SOLVED] Webcam image capture how? linfax Studio 13.37 13 08-14-2012 12:45 PM
Exact time of image capture and Unicap library for video capture devices Dstruct0 Programming 3 09-10-2011 06:34 PM
Running Xvidcap (for screen capture ) + audacity (for audio capture) simultaneously vikram_cvk Linux - Software 2 05-20-2011 03:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration