How I can I add audio to my ffmpeg stream

你。 提交于 2021-02-05 09:46:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!