我的代码是:
ffmpeg -y -f x11grab -f alsa -i hw:0 -framerate 30 -video_size 1600x900 -i :0.0+0,0 -c:v libx264 -pix_fmt yuv420p -qp 0 -preset ultrafast moetoVideo.avi
但我收到此错误:
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'hw:0':
Duration: N/A, start: 1489387873.960220, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
:0.0+0,0: Protocol not found
我使用 ubuntu 15.10
答案1
选项放置的顺序很重要。您需要-f x11grab
在相应的选项之前移动-i
:
ffmpeg -y -f alsa -i hw:0 -f x11grab -framerate 30 -video_size 1600x900 -i :0.0+0,0 -c:v libx264 -pix_fmt yuv420p -qp 0 -preset ultrafast moetoVideo.avi