Ubuntu下编译ffmpeg+openh264+x264
[笔记] Ubuntu下编译ffmpeg+openh264+x264
原文:https://www.cnblogs.com/journeyonmyway/p/4648820.html
- ffmpeg: git clone git://source.ffmpeg.org/ffmpeg.git
- openh264: git clone https://github.com/cisco/openh264.git
- x264: git clone http://git.videolan.org/git/x264.git
[编译 openh264]
make
sudo make install
[编译 x264]
./configure --enable-shared
make
sudo make install
[编译 ffmpeg]
./configure \
--enable-shared \
--enable-libopenh264 \
--enable-libx264 \
--enable-gpl \
--prefix=/usr/local/ffmpeg
make
sudo make install
[配置环境]
cd /etc/ld.so.conf.d/
创建 ffmpeg.conf,写入 "/usr/local/ffmpeg/lib"
sudo ldconfig
sudo ln -s /usr/local/ffmpeg/bin/ffmpeg /usr/local/bin/
sudo ln -s /usr/local/ffmpeg/bin/ffprobe /usr/local/bin/
sudo ln -s /usr/local/ffmpeg/bin/ffserver /usr/local/bin/
[验证 ffmpeg]
ffmpeg --help
[使用 ffmpeg]
使用 openh264 将 avi 视频转为 mp4 视频:
ffmpeg -y -i in.avi -vcodec libopenh264 out.mp4
[更新于2016-07-15]
如果希望编译出静态ffmpeg,且包含libx264,假设x264和ffmpeg是同级相邻目录,需要如下操作:
[静态编译libx264]
./configure --prefix=. --enable-static
make
make install
[静态编译ffmpeg]
./configure \
--enable-static \
--disable-shared \
--enable-libx264 \
--enable-gpl \
--enable-ffprobe \
--extra-cflags=-I../x264/include \
--extra-ldflags=-L../x264/lib \
--extra-libs=-ldl
make
make install
最终得到ffmpeg和ffprobe。
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/95533888
- 点赞
- 收藏
- 关注作者
评论(0)