如何使用FFMPEG在Mac上启动实时流媒体?

Ale*_*his 6 macos streaming ffmpeg live

我正在研究MAC OS X Lion 10.7.5.

如何正确安装FFMPEG?

我做了什么:

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
Run Code Online (Sandbox Code Playgroud)

甚至(我认为这应该有效,但事实并非如此)

brew install ffmpeg
Run Code Online (Sandbox Code Playgroud)

什么都行不通......我无法列出输入,我无法从USB摄像头开始流式传输,我无能为力.

ffmpeg -f video4linux2 -s 320x240 -i video="USB cam":audio="USB mic" -f oss -acodec libvorbis -vcodec libvpx -f webm http://localhost:1234/streaming
Run Code Online (Sandbox Code Playgroud)

我得到的错误看起来像这样:

unknown input format 'video4linux'
Run Code Online (Sandbox Code Playgroud)

alsa,openal,vfwcap等也是如此.

所以,有没有人尝试用直播流FFMPEGMAC?如何安装FFMPEG以便支持video4linux2v4l2或任何输入格式?如何列出设备(USB网络摄像头或集成网络摄像头)?

Ric*_*ski 11

您可以通过avfoundation访问Mac OS中的网络摄像头.

要列出可用的输入设备,请使用:

ffmpeg -f avfoundation -list_devices true -i ""
Run Code Online (Sandbox Code Playgroud)

将列表中的第一个设备记录到文件的示例:

ffmpeg -f avfoundation -i "0" out.mpg
Run Code Online (Sandbox Code Playgroud)

  • Jared:这可能取决于您如何安装ffmpeg。有大量的可选库。我一直在使用以下Homebrew安装:brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with -libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools (2认同)