码迷,mamicode.com
首页 > 其他好文 > 详细

ffmpeg支持x264插件

时间:2018-03-09 15:33:19      阅读:451      评论:0      收藏:0      [点我收藏+]

标签:ffmpeg支持x264插件

1 ffmpeg安装x264插件

2 要安装x264模块首先要先装nasm

3 安装脚本如下【复制即可使用】

#!/bin/bash


yum -y install epel-release  && yum -y install git wget                                            #下载git,wget

echo $?                                                                                            

if [ $? == 0 ];then                                                                                #判断工具安装情况

wget  http://www.nasm.us/pub/nasm/releasebuilds/2.13/nasm-2.13.tar.gz                                #下载安装包nasm

git clone git://git.videolan.org/x264.git                                                            #下载x264模块

wget http://219.238.7.67/files/208800000B606D7E/ffmpeg.org/releases/ffmpeg-3.4.2.tar.bz2            #下载ffmpeg

else

exit                                                                                        #如果工具下载失败,直接退出

fi


tar xvf nasm-2.13.tar.gz                                                                            #安装nasm

cd nasm-2.13/ && mkdir /product/{ffmpeg,x264,nasm2-13} -p

./configure --prefix=/product/nasm2-13

echo $?

if [ $? == 0 ];then

make && make install

echo $?

if [ $? == 0 ];then

echo "nasm   success"  >/media/1.txt

else

exit

fi

fi

cd ../x264/                                                                                               #安装x264 

ln -s /product/nasm2-13/bin/nasm /usr/bin/nasm

./configure --enable-shared --enable-static --prefix=/product/x264

echo $?

if [ $? == 0 ];then

make && make install

echo $?

if [ $? == 0 ];then

echo "x264   success"  >> /media/1.txt

else

        exit

fi

fi


cd ..

tar xvf ffmpeg-3.4.2.tar.bz2                                                                                #安装ffmpeg

cd ffmpeg-3.4.2/

./configure --prefix=/product/ffmpeg/ --enable-shared --disable-ffserver --disable-ffplay --enable-postproc --enable-gpl  --enable-libx264 --disable-asm --extra-cflags=-I/product/x264/include --extra-ldflags=-L/product/x264/lib

echo $?

if [ $? == 0 ];then

make && make install

echo $?

if [ $? == 0 ];then

echo "ffmpeg   success"  >/media/1.txt

else

        exit

fi

fi



ln -s /product/ffmpeg/bin/ffmpeg /usr/bin/ffmpeg                                                #做链接,写入/etc/ld.so.conf

sed -i '$a/product/x264/bin/'  /etc/ld.so.conf

sed -i '$a/product/x264/lib'  /etc/ld.so.conf

sed -i '$a/product/x264/include/'  /etc/ld.so.conf

ln -s /product/x264/bin/x264  /usr/bin/x264


sed -i '$a/product/ffmpeg/lib/'  /etc/ld.so.conf

sed -i '$a/product/ffmpeg/include/' /etc/ld.so.conf

ldconfig



以上脚本,复制即可使用

ffmpeg支持x264插件

标签:ffmpeg支持x264插件

原文地址:http://blog.51cto.com/13272050/2084592

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!