我正在嘗試使用 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
錄製應用程式的聲音。
答案1
第一個0
是卡,第二個0
是設備,如以下輸出所示arecord -l
:
card 0: PCH [HDA Intel PCH], device 0: CX20585 Analog [CX20585 Analog]