下载
1.在mac下,优先安装brew
/ usr / bin / ruby -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
2.安装ffmpeg
brew install ffmpeg
3.安装编译FFmpeg所需依赖
brew install automake fdk-aac git lame libass libtool libvorbis libvpx \
opus sdl shtool texi2html theora wget x264 x265 xvid nasm
编译
git clone http://source.ffmpeg.org/git/ffmpeg.git ffmpeg
cd ffmpeg
ffmpeg //会列出configuration然后copy执行
./configure --prefix=/usr/local/Cellar/ffmpeg/4.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gpl --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-opencl --enable-videotoolbox
//如果报ERROR: opus not found using pkg-config
brew install pkg-config然后重新编译
sudo make install
详见官网ffmepg:
编译命令
//录屏
➜ ~ ffmpeg -f avfoundation -i 1 -r 30 out.yuv
//播放
➜ ~ ffplay -s 3360x2100 -pix_fmt uyvy422 out.yuv
//录音
➜ ~ ffmpeg -f avfoundation -i :0 out.wav
➜ ~ ffplay out.wav
下载ffmpeg命令大全
链接:https://pan.baidu.com/s/1o208MO9kvtBksLN6eC3A-w 密码:h8xq