Mac或Linux下编译安装ffmpeg

Mac下安装ffmpeg的方式

  • brew方式(优点:省去源码下载编译;弊端:安装后无法改变;具体操作:brew search ffmpeg =》brew install ffmpeg)
  • 源码方式(下载源码编译安装,可定制化,支持相应工具功能去除或添加)

Mac/Linux编译ffmpeg

git clone git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg 或
在这里插入图片描述

  • 编译ffmpeg
    ./configure --prefix=/usr/local/ffmpeg --enable-debug=3 --disable-static --enable-shared
    make -j 4
    make install

  • 注意:./configure --help可查看参数含义及作用,./configure --help | grep static可查看static相关命令,./configure --help | grep share可查看share相关指令,grep可筛选出感兴趣的指令查看。

结果查看

  • cd /usr/local/ffmpeg/
    在这里插入图片描述
  • cd bin
    在这里插入图片描述
  • ffmpeg可以进行推流,音视频处理
  • ffmplay可以进行拉流,播放本地音视频文件
  • ffprobe用于检测多媒体文件的格式和类型
  • man ls,ffmpeg --help查看命令含义
  • 设置环境变量:vi ~/.bash_profile export PATH=/usr/local/ffmpeg/bin

猜你喜欢

转载自blog.csdn.net/oTianLe1234/article/details/115422285