Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulseaudio device name #7

Open
elig0n opened this issue Apr 24, 2020 · 3 comments
Open

pulseaudio device name #7

elig0n opened this issue Apr 24, 2020 · 3 comments

Comments

@elig0n
Copy link

elig0n commented Apr 24, 2020

I have both arecord and pactl installed. I'm using pulseaudio.
pactl list sources gives a lot of data that I'm not sure what the name for -i should be like. Long name like alsa_output.pci-000_00_00.1.hdmi- stereo.monitor do not work, neither 0, 1, pulse-0 or pulse:0.
pulse alone is accepted but then no audio is recorded.
ffmpeg -f x11grab and -f pulse -i 1 records audio almost alright (last second or so is cut).
How to specify pulseaudio device then ?

arecord -l output:

**** List of CAPTURE Hardware Devices ****
card 1: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 2: ALC887-VD Alt Analog [ALC887-VD Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

@dbermond
Copy link
Owner

How to specify pulseaudio device then ?

In short:

Does your ffmpeg has support for alsa demuxer (for example, does your ffmpeg is compiled with --enable-alsa?). If yes, specifying a pulseaudio input source with the -i option is currently not supported. If no, you can specify the long name for the pulseaudio input source.

The long story:

The goal of the -i option is to specify an alsa input device name, and not a pulseaudio one, as stated on the Readme:

-i, --audio-input=NAME
ALSA audio input device name.

The -i option is only used to specify a pulseaudio input source if your ffmpeg has no support for alsa demuxer (for example, if your ffmpeg is compiled without --enable-alsa). If your ffmpeg has no alsa demuxer support, screencast will detect this and will automatically try to use pulseaudio as a fallback interface if it's available on your ffmpeg.

If your ffmpeg has support for alsa demuxer, the best you can currently do in this case is to configure/set the default pulseaudio input source elsewhere and use the special value pulse with -i to try to record from the default pulseaudio input source.

In my experience, alsa in ffmpeg seems to work much better and to cause less problems than pulseaudio (as yourself described when using -f pulse in ffmpeg).

@elig0n
Copy link
Author

elig0n commented Apr 27, 2020

If no, you can specify the long name for the pulseaudio input source.

$ ffmpeg |& grep alsa
$ pactl list sources
Source #0
[...]
Name: alsa_output.pci-0000_08_00.1.hdmi-stereo.monitor
[...]
$ screencast -i alsa_output.pci-0000_08_00.1.hdmi-stereo.monitor  -v vp9 -d :1.0 test.mp4
[...]
[ screencast ] error: 'alsa_output.pci-0000_08_00.1.hdmi-stereo.monitor' is not a valid ALSA input device name on this system

@dbermond
Copy link
Owner

dbermond commented May 1, 2020

screencast is detecting that your ffmpeg has alsa support, since it's not using the pulseaudio fallback interface.

Can you please post the output of ffmpeg -formats -v quiet | grep -E 'alsa|ALSA'? This will tell if your ffmpeg has support for alsa, as the alsa option at ffmpeg build time is autodetected.

Also, the log shows that your using an output source as input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants