PDA

View Full Version : ffmpeg cannot use alsa



bobzxr
5th December 2017, 07:47 PM
Hi

Fedora 26

The problem:

bob@bob ~ % ffmpeg -f alsa -i hw:0 out.wav :(
ffmpeg version 3.3.5 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7 (GCC)
...
Unknown input format: 'alsa'

Apparently I cannot make ffmpeg to record any sound.

I have all the alsa lib packages installed. I can record sound for example with audacity without any problem.

leigh123linux
6th December 2017, 12:04 PM
Hi

Fedora 26

The problem:

bob@bob ~ % ffmpeg -f alsa -i hw:0 out.wav :(
ffmpeg version 3.3.5 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7 (GCC)
...
Unknown input format: 'alsa'

Apparently I cannot make ffmpeg to record any sound.

I have all the alsa lib packages installed. I can record sound for example with audacity without any problem.

Use pulse as ffmpeg hasn't been compiled with alsa support


$ ffmpeg -sources

Auto-detected sources for jack:
Cannot list sources. Not implemented.
Auto-detected sources for openal:
Cannot list sources. Not implemented.
Auto-detected sources for oss:
Cannot list sources. Not implemented.
Auto-detected sources for pulse:
alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2.monitor [Monitor of GK106 HDMI Audio Controller Digital Stereo (HDMI 3)]
alsa_output.pci-0000_00_14.2.analog-stereo.monitor [Monitor of Built-in Audio Analog Stereo]
* alsa_input.pci-0000_00_14.2.analog-stereo [Built-in Audio Analog Stereo]
Auto-detected sources for libcdio:
Cannot list sources. Not implemented.
Auto-detected sources for fbdev:
Auto-detected sources for lavfi:
Cannot list sources. Not implemented.
Auto-detected sources for video4linux2,v4l2:
Auto-detected sources for x11grab:
Cannot list sources. Not implemented.


$ ffmpeg -sinks

Auto-detected sinks for oss:
Cannot list sinks. Not implemented.
Auto-detected sinks for pulse:
* alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2 [GK106 HDMI Audio Controller Digital Stereo (HDMI 3)]
alsa_output.pci-0000_00_14.2.analog-stereo [Built-in Audio Analog Stereo]
Auto-detected sinks for fbdev:
Auto-detected sinks for opengl:
Cannot list sinks. Not implemented.
Auto-detected sinks for sdl,sdl2:
Cannot list sinks. Not implemented.
Auto-detected sinks for v4l2:
Cannot list sinks. Not implemented.
Auto-detected sinks for xv:
Cannot list sinks. Not implemented.

bobzxr
7th December 2017, 10:14 PM
Okay so I didn't know that you can invoke pulse directly, skipping alsa.

So instead of

-f alsa -i pulse

You can use:

-f pulse -i default

This way it works.

nsnbm
7th December 2017, 11:42 PM
Yes, the command: ffmpeg -formats, shows pulse (and others) available, but not alsa.