在Mac和流媒体上使用ffmpeg捕获麦克风输入 [英] Capture microphone input with ffmpeg on Mac and streaming

查看:264
本文介绍了在Mac和流媒体上使用ffmpeg捕获麦克风输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在MacBook(默认麦克风)上捕获麦克风输入,并通过rtp://对此进行流式传输,但是我找不到有关如何执行此操作的任何信息.我尝试使用VLC,但也没有运气.我要执行此命令行.使用以下命令,流式传输有效,但我不知道如何调整此命令以指定它需要使用麦克风作为输入.有人可以帮助我吗?

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

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

推荐答案

此处介绍如何直接使用ffmpeg将OSX麦克风流式传输到RTP:

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

然后从VLC或其他任何方式打开rtp://127.0.0.1:12345

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

使用以下命令找到正确的麦克风:ffmpeg -f avfoundation -list_devices true -i ""

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

这篇关于在Mac和流媒体上使用ffmpeg捕获麦克风输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆