centos 下编译安装 ffmpeg 的 x264编码

26点 林涛 10346℃ 0评论

1、安装汇编编译器(一般系统自带吧),如果没有按照下面的命令安装吧

  1. yum install yasm

2、使用最新x264源码编译(只支持编码)
在x264官网下载最新的代码http://www.videolan.org/developers/x264.html

  1. git clone git://git.videolan.org/x264.git
  2.     cd x264
  3.         ./configure –enable-static –enable-shared
  4.         make
  5.         make install

注意–enable-static –enable-shared 后面要加上,否则在编译ffmpeg的时候会报错。
make install 应该出现下面的画面说明安装成功了。

会在当前目录下生成静态库libx264.a,动态库在/usr/local/lib,头文件/usr/local/include目录下。
3、使用最新的ffmpeg源码编译
在ffmpeg官网下载最新的代码https://www.ffmpeg.org/download.html

  1. git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
  2. cd ffmpeg
  3.     #编译成动态库 
  4.     ./configure  –enable-shared –disable-static –enable-memalign-hack –enable-libx264 –enable-gpl –extra-cflags=-I/usr/local/include –extra-ldflags=-L/usr/local/lib  –enable-pthreads
  5.     #编译成静态库
  6.     ./configure  –enable-static –disable-shared –enable-memalign-hack –enable-libx264 –enable-gpl –extra-cflags=-I/usr/local/include –extra-ldflags=-L/usr/local/lib  –enable-pthreads

如需转载请注明: 转载自26点的博客

本文链接地址: centos 下编译安装 ffmpeg 的 x264编码

转载请注明:26点的博客 » centos 下编译安装 ffmpeg 的 x264编码

喜欢 (0)
发表我的评论
取消评论

表情