Capture microphone input with ffmpeg on Mac and st

2020-07-18 04:07发布

问题:

I am trying to capture the microphone input on my MacBook (default mic) and streaming this via rtp:// but I'm unable to find anything on how to do this. I tried using VLC but no luck either. I want to do this command line. With the below command the streaming works but I don't know how to adjust this command to specify it needs to use the microphone as input. Anyone can help me?

./ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -ar 8000 -f mulaw -f rtp rtp://127.0.0.1:1234

回答1:

Here how to stream OSX microphone to RTP, using ffmpeg directly :

ffmpeg -f avfoundation -i ":1" -acodec libmp3lame -ab 32k -ac 1 -f rtp rtp://0.0.0.0:12345

Then open rtp://127.0.0.1:12345 from VLC or whatever

find the correct mic with this command : ffmpeg -f avfoundation -list_devices true -i ""