我正在尝试广播我的屏幕,但我无法捕获音频。然而,有一个并发症。我没有pulseaudio
,而且它根本无法在我的系统上运行,所以安装它是不可能的。以下是我正在尝试的命令:
ffmpeg -f alsa -i ??? -f x11grab -s 1920x1200 -r 15 -i :0.0 \
-acodec pcm_s16le -vcodec libx264 \
-preset fast -pix_fmt yuv420p -s 1280x800 -threads 0 -f flv "$URL"
这是我的音频设备列表:
$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=PCH
HDA Intel PCH, ALC269VB Analog
Default Audio Device
sysdefault:CARD=PCH
HDA Intel PCH, ALC269VB Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
Front speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VB Digital
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
HDMI Audio Output
我知道这???
应该是类似的东西hw:X,Y
,但也许它可以是别的东西。我在手册页中找不到相应的条目。
顺便说一句,如果您能推荐其他音频编解码器,那就太好了。我找不到选项,而且这个特定的选项与 FLV 不兼容,因为比特率太高。
PS。这是我得到的错误:
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input