
ffmpeg cliにオーディオを追加したいのですが
ffmpeg -framerate 25 -video_size 1920x1080 -f x11grab -i :0.0 -vf format=yuv420p http://localhost:8080/feed.ffm
編集
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC883 Analog [ALC883 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: ALC883 Alt Analog [ALC883 Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
そして、こちらは-L付きです
arecord -L
default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=Intel
HDA Intel, ALC883 Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, ALC883 Analog
Front speakers
dmix:CARD=Intel,DEV=0
HDA Intel, ALC883 Analog
Direct sample mixing device
dmix:CARD=Intel,DEV=2
HDA Intel, ALC883 Alt Analog
Direct sample mixing device
dsnoop:CARD=Intel,DEV=0
HDA Intel, ALC883 Analog
Direct sample snooping device
dsnoop:CARD=Intel,DEV=2
HDA Intel, ALC883 Alt Analog
Direct sample snooping device
hw:CARD=Intel,DEV=0
HDA Intel, ALC883 Analog
Direct hardware device without any conversions
hw:CARD=Intel,DEV=2
HDA Intel, ALC883 Alt Analog
Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
HDA Intel, ALC883 Analog
Hardware device with all software conversions
plughw:CARD=Intel,DEV=2
HDA Intel, ALC883 Alt Analog
Hardware device with all software conversions
答え1
オーディオ入力を用意する必要があります。デスクトップ/「聞こえる音」/「ステレオミックス」のサウンドが必要な場合、最も簡単な方法は、pavucontrolを使用して録音したいものを選択し、パルスオーディオ入力でffmpeg
。
パブコントロール
見るpavucontrol を使用するために ffmpeg でデスクトップ オーディオをキャプチャする。
またはpactl list sources
pavucontrol を使用しない場合は、次のようにオーディオ ソースをリストしますpactl list sources
。
$ pactl list sources | grep monitor
Name: alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1.monitor
device.class = "monitor"
Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
device.class = "monitor"
次に以下を実行しますffmpeg
:
ffmpeg -framerate 25 -video_size 1920x1080 -f x11grab -i :0.0 -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -c:v libx264 -c:a aac -vf format=yuv420p http://localhost:8080/feed.ffm