1

Using Linux Mint 18.1 32bit, Logitech pro 9000, vlc 2.2.2

I have searched many sites for tips and have found many to record the video, but none that come close to streaming or recording both the video and the audio.

The closest was from Trouble getting VLC to record from the webcam via command line. This streams the video but does not play the audio.

cvlc v4l2:// :input-slave=alsa:// :v4l-vdev="/dev/video0" :v4l-norm=3 \
  :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 \
  :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo \
  :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 \
  :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 \
  --sout="#transcode{vcodec=theo,vb=2000,fps=12,scale=0.67,acodec=vorb,ab=90,channels=1,samplerate=44100}:standard{access=file,mux=ogg,dst=output.ogg}"

How would the command be modified to play video and audio?

Edit

Pulseaudio is running:

$ ps axu | grep pulse
bill 1553 0.0 0.5 176268 10456 ? S<l 15:15 0:02 /usr/bin/pulseaudio --start --log-target=syslog

List of audio devices:

$ arecord -l **** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC9200 Analog [STAC9200 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Q9000 [QuickCam Pro 9000], device 0:
  USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 
7
  • Do you want to stream audio and video (make it available for possibly multiple clients on your LAN), or record audio and video together from webcam and ALSA? These are very different things ... And to record audio: Do you run Pulseaudio? Have you tried recording the audio alone? Did it work?
    – dirkt
    Feb 23, 2018 at 11:56
  • My plan is to record audio and video together from webcam and ALSA. With ALSA I guess. Do not know about Pulseaudio. Will try recording audio alone later today or early tomorrow.
    – Otto Gvert
    Feb 24, 2018 at 11:19
  • Please run ps axu | grep pulse, look if there's a pulseaudio process running, and edit the question. You can use arecord to test recording with ALSA, and arecord -l to list your devices.
    – dirkt
    Feb 24, 2018 at 12:24
  • Tried using directions from ourpcsolutions.blogspot.com and stackoverflow,com without success on just audio and video with audio. Here is results ~ $ ps axu | grep pulse bill 1553 0.0 0.5 176268 10456 ? S<l 15:15 0:02 /usr/bin/pulseaudio --start --log-target=syslog bill 4096 0.0 0.0 5112 776 pts/0 S+ 16:03 0:00 grep --color=auto pulse Have no idea what this means. Using Logitech pro 9000 device.
    – Otto Gvert
    Feb 24, 2018 at 21:12
  • Did fresh install of Audio Recorder. Made a test recording and it played OK.
    – Otto Gvert
    Feb 24, 2018 at 21:52

1 Answer 1

2

Quick review of Linux audio: Today, basically all device drivers are part of ALSA. ALSA can be used on its own, but basically all distros run Pulseaudio on top, which offers a better experience in some respects. Pulseaudio includes a compatibility layer that allows old ALSA-only applications to use Pulseaudio by pretending it is an ALSA device (called pulse), while Pulseaudio in turn uses the device drivers of ALSA.

Your system is like this, and you have two audio devices (the internal device and the camera).

So what happens when you use --input-slave=alsa:// is that vlc uses the compatibility layer, which accesses Pulseaudio, which guesses what device you want and gives you the first device, which is the internal device and not the webcam. Thus, no sound.

You can use pavucontrol (or pacmd or pactl if you don't have a GUI) while recording to change where vlc records from. Depending on your Pulseaudio setup, this choice will usually be remembered next time, so you need to only do it once.

Or even better, tell vlc to use Pulseaudio in the first place. I couldn't quickly find proper documentation on --input-slave for vlc, but the google results suggest --input-slave=pulse does work, and very likely there's some --input-slave=pulse://pulseaudio_source_name syntax that actually allows you to specify the correct card (called "sound source" in Pulseaudio).

Edit

The source code says the format is pulse://SOURCE, without specifying details, so I guess you can do

pactl list short sources

and then specify something like pulse://alsa_input.usb-XXX-YYY with whatever your Pulseaudio source name is. Again, you can use pavucontrol to reassign the source, if necessary.

3
  • Tried these 2 with out success. input-slave=pulse://alsa_input.usb-046d:0990 --input-slave=pulse Will continue my quest and will keep you informed. Thank for all you did.
    – Otto Gvert
    Feb 25, 2018 at 17:39
  • So try first to change the source with pavucontrol, or pacmd move-source-output <index> <source> if you have to use the command line (use pamcd list etc. to figure out what is what).
    – dirkt
    Feb 25, 2018 at 18:25
  • Will have to wait until Saturday. Linux user group meeting. Will need some help with this. Will keep you posted. Thanks again.
    – Otto Gvert
    Feb 26, 2018 at 19:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .