问题
I want to add audio to my ffmpeg cli bellow
ffmpeg -framerate 25 -video_size 1920x1080 -f x11grab -i :0.0 -vf format=yuv420p http://localhost:8080/feed.ffm
I tried -acodec libmp3lame, -c:a libmp3lame
but it does not seam to work
回答1:
You have to provide an audio input. Assuming ALSA:
ffmpeg -framerate 25 -video_size 1920x1080 -f x11grab -i :0.0 -f alsa -sample_rate 48000 -channels 2 -i hw:0 -c:v libx264 -c:a aac -vf format=yuv420p http://localhost:8080/feed.ffm
See FFmpeg ALSA input documentation and FFmpeg Wiki: ALSA.
来源:https://stackoverflow.com/questions/65060454/how-i-can-i-add-audio-to-my-ffmpeg-stream