You are not logged in.

#1 2020-05-03 10:42:48

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

[SOLVED] Can't record audio system with FFMPEG/Pulseaudio

hi,
i can't record audio system with ffmpeg and pulseaudio, i have tried these commands but the output is always mute:

$ ffmpeg -f alsa -i hw:0,0 cazzo.mp3
$ ffmpeg -f alsa -i hw:0,2 cazzo.mp3
$ ffmpeg -f alsa -i pulse cazzo.mp3
$ ffmpeg -f pulse -i default cazzo.mp3
$ arecord -Ll
surround21
    2.1 Surround output to Front and Subwoofer speakers
surround40
    4.0 Surround output to Front and Rear speakers
surround41
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50
    5.0 Surround output to Front, Center and Rear speakers
surround51
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
null
    Discard all samples (playback) or generate zero samples (capture)
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pulse
    PulseAudio Sound Server
speex
    Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
sysdefault:CARD=PCH
    HDA Intel PCH, ALC662 rev1 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC662 rev1 Analog
    Front speakers
usbstream:CARD=PCH
    HDA Intel PCH
    USB Stream Output
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC662 rev1 Alt Analog [ALC662 rev1 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

with audio-recorder it works but i want to use ffmpeg.

Last edited by quellen (2020-05-03 13:18:37)


sorry for my bad english

Offline

#2 2020-05-03 12:36:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: [SOLVED] Can't record audio system with FFMPEG/Pulseaudio

That last one works fine here. Did you ensure the "default" mic is indeed the one you want to record from? Either switch that while running in pavucontrol or so, or state the correct input device directly, see

ffmpeg --sources pulse

for a list and maybe post

pacmd list-sources
pacmd list-source-outputs

during an active recording attempt.

Last edited by V1del (2020-05-03 12:37:00)

Offline

#3 2020-05-03 13:15:14

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

Re: [SOLVED] Can't record audio system with FFMPEG/Pulseaudio

thx for reply,
i don't want to record audio microphone but audio system.

$ ffmpeg -sources pulse
ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.3.0 (Arch Linux 9.3.0-1)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Auto-detected sources for pulse:
  alsa_output.pci-0000_00_1b.0.analog-stereo.monitor [Monitor of Audio interno Stereo analogico]
* alsa_input.pci-0000_00_1b.0.analog-stereo [Audio interno Stereo analogico]
$ pacmd list-sources
2 source(s) available.
    index: 0
	name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor>
	driver: <module-alsa-card.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: IDLE
	suspend cause: (none)
	priority: 1030
	volume: front-left: 66191 / 101% / 0,26 dB,   front-right: 66191 / 101% / 0,26 dB
	        balance 0,00
	base volume: 65536 / 100% / 0,00 dB
	volume steps: 65537
	muted: no
	current latency: 0,00 ms
	max rewind: 11 KiB
	sample spec: s16le ch 2 48000 Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 1837,50 ms; range is 0,50 .. 1837,50 ms
	monitor_of: 0
	card: 0 <alsa_card.pci-0000_00_1b.0>
	module: 6
	properties:
		device.description = "Monitor of Audio interno Stereo analogico"
		device.class = "monitor"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xd0710000 irq 96"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1b.0"
		sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "0f04"
		device.product.name = "Atom Processor Z36xxx/Z37xxx Series High Definition Audio Controller"
		device.form_factor = "internal"
		device.string = "0"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
  * index: 1
	name: <alsa_input.pci-0000_00_1b.0.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9039
	volume: front-left: 11002 /  17% / -46,50 dB,   front-right: 11002 /  17% / -46,50 dB
	        balance 0,00
	base volume: 5841 /   9% / -63,00 dB
	volume steps: 65537
	muted: no
	current latency: 0,00 ms
	max rewind: 0 KiB
	sample spec: s16le ch 2 48000 Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0,00 ms; range is 0,50 .. 1837,50 ms
	card: 0 <alsa_card.pci-0000_00_1b.0>
	module: 6
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC662 rev1 Analog"
		alsa.id = "ALC662 rev1 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xd0710000 irq 96"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1b.0"
		sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "0f04"
		device.product.name = "Atom Processor Z36xxx/Z37xxx Series High Definition Audio Controller"
		device.form_factor = "internal"
		device.string = "front:0"
		device.buffering.buffer_size = "352800"
		device.buffering.fragment_size = "176400"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Stereo analogico"
		device.description = "Audio interno Stereo analogico"
		alsa.mixer_name = "Realtek ALC662 rev1"
		alsa.components = "HDA:10ec0662,1849a662,00100101 HDA:80862882,80860101,00100000"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-input-front-mic: Microfono anteriore (priority 8500, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-rear-mic: Microfono posteriore (priority 8200, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-linein: Line-In (priority 8100, latency offset 0 usec, available: no)
			properties:
				
	active port: <analog-input-front-mic>
$ pacmd list-source-outputs
0 source output(s) available.

Last edited by quellen (2020-05-03 13:16:52)


sorry for my bad english

Offline

#4 2020-05-03 13:18:25

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

Re: [SOLVED] Can't record audio system with FFMPEG/Pulseaudio

SOLVED:

$ ffmpeg -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor cazzo.mp3

Thank you V1del!


sorry for my bad english

Offline

Board footer

Powered by FluxBB