我也在尝试使用 ffmpeg 进行截屏和录制应用程序声音。但是,我无法录制应用程序声音。我认为我的命令有问题。我正在做的是这样的:
ffmpeg -f alsa -i hw:0,0 -f x11grab -i :0.0 out.mpg
所以,我需要了解什么是 0 和 0 的hw:0,0
意思。当我这样做时arecord -l
,输出是:
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CX20585 Analog [CX20585 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
输出aplay -l
是:
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CX20585 Analog [CX20585 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
输出给出了许多0
值。hw:#,#
我不知道该放哪一个ffmpeg
可以录制应用程序的声音。
第一个
0
是卡,第二个0
是设备,如输出中所列arecord -l
:card 0: PCH [HDA Intel PCH], device 0: CX20585 Analog [CX20585 Analog]