centos6.0下ffmpeg的安装编译经历

本文记录了在CentOS 6.0系统中安装FFmpeg的过程,包括下载最新FFmpeg和YASM源码,通过su获取root权限,解压、配置、编译和安装步骤,以及最终验证FFmpeg安装成功的操作。
摘要由CSDN通过智能技术生成

    最近因为要在linux上用ffmpeg处理一些视频,所以在学习centos下要安装ffmpeg,但是能搜到的安装教程感觉都不是很好用,至少我用起来感觉特别不爽,而且在ffmpeg的指令使用上格式写错了,好吧,其实也与我完全没有linux的使用经验也有关系,不过写下这篇经历,希望能对以后要入门的同学有所助益!

    首先,下载最新版的ffmpeg:http://www.ffmpeg.org/download.html

    然后下载汇编优化器yasm:http://yasm.tortall.net/Download.html,因为是linux下使用,所以我们要下载的是source.tar.gz

    然后就可以开始在linux上安装了!

    用secureFX将资料传到centos中,然后输入一下指令:

    # su,获得linux的root权限(如果你不是root的权限的话需要这个貌似)

    用

    # cd /ffmpeg

    找到压缩包所在的文件夹

    先解压yasm(以1.2.0版本为例):

    # tar xvzf yasm-1.2.0.tar.gz

    (注:linux下,gz的压缩文件解压用 xvzf指令,bz2格式的压缩文件用 jxvf指令解压)

   解压之后输入:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
3. 安装FFmpeg 1) 指定第三方插件安装默认目录 [root@localhost ffmpeg]# vi /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/local/bin /usr/local/lib 2) 安装各插件 安装lame [root@localhost ffmpeg]# tar -zxvf lame-3.99.5.tar.gz [root@localhost lame-3.99.5]# cd lame-3.99.5 [root@localhost lame-3.99.5]# ./configure --enable-shared [root@localhost lame-3.99.5]# make && make install [root@localhost lame-3.99.5]# ldconfig 安装yasm [root@localhost ffmpeg]# tar -zxvf yasm-1.2.0.gz [root@localhost yasm-1.2.0]# cd yasm-1.2.0 [root@localhost yasm-1.2.0]# ./configure --enable-shared [root@localhost yasm-1.2.0]# make && make install [root@localhost yasm-1.2.0]# ldconfig 安装xvidcore (注意目录位置,不在直接的解压后的文件下) [root@localhost ffmpeg]# tar -zxvf xvidcore-1.1.3.tar.gz [root@localhost ffmpeg]# cd xvidcore-1.1.3/build/generic/ [root@localhost generic]# ./configure [root@localhost generic]# make && make install [root@localhost generic]# ldconfig 安装x264 (注意格式为.tar.bz2) [root@localhost ffmpeg]# bunzip2 last_x264.tar.bz2 [root@localhost ffmpeg]# tar -xvf last_x264.tar [root@localhost ffmpeg]# cd x264-snapshot-20121030-2245/ [root@localhost x264-snapshot-20121030-2245]# ./configure --enable-shared [root@localhost x264-snapshot-20121030-2245]# make && make install [root@localhost x264-snapshot-20121030-2245]# ldconfig 安装a52dec [root@localhost ffmpeg]# tar -zxvf a52dec-0.7.4.tar.gz [root@localhost ffmpeg]# cd a52dec-0.7.4 [root@localhost a52dec-0.7.4]# ./configure --enable-shared=PKGS && make && make install [root@localhost a52dec-0.7.4]# ldconfig 安装 faac [root@localhost ffmpeg]# yum install -y automake autoconf libtool [root@localhost ffmpeg]# tar -zxvf faac-1.28.tar.gz [root@localhost ffmpeg]# cd faac-1.28 [root@localhost faac-1.28]# vi ./common/mp4v2/mpeg4ip.h … :123 #ifdef __cplusplus extern "C" { #endif //char *strcasestr(const char *haystack, const char *needle); #ifdef __cplusplus } #endif [root@localhost faac-1.28]# ./bootstrap && ./configure && make && make install [root@localhost faac-1.28]# ldconfig 安装 faad2 [root@localhost ffmpeg]# tar -zxvf faad2-2.7.tar.gz [root@localhost ffmpeg]# cd faad2-2.7 [root@localhost faad2-2.7]# chmod 755 bootstrap [root@localhost faad2-2.7]# ./bootstrap && ./configure && make && make install [root@localhost faad2-2.7]# ldconfig 安装 vo-aacenc [root@localhost ffmpeg]# tar -zxvf vo-aacenc_0.1.3.orig.tar.gz [root@localhost ffmpeg]# cd vo-aacenc-0.1.3/ [root@localhost vo-aacenc-0.1.3]# ./configure [root@localhost vo-aacenc-0.1.3]# make && make install [root@localhost vo-aacenc-0.1.3]# ldconfig 3) 安装FFmpeg [root@localhost ffmpeg]# tar -zxvf ffmpeg-1.2.11.tar.gz [root@localhost ffmpeg]# cd ffmpeg-1.2.11 [root@localhost ffmpeg-1.2.11]# ./configure --enable-gpl --enable-version3 --enable-postproc --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-libvo-aacenc [root@localhost ffmpeg-1.2.11]# make && make install [root@localhost ffmpeg-1.2.11]# ldconfig [root@localhost ffmpeg-1.2.11]# cp /usr/local/bin/ffmpeg /usr/bin/ 4) 安装qt-faststart [root@localhost ffmpeg-1.2.11]# cd ffmpeg-1.2.11 [root@localhost ffmpeg-1.2.11]# make tools/qt-faststart [root@localhost ffmpeg-1.2.11]# cp -a tools/qt-faststart /usr/bin/ 5) 查看版本和转换测试 查看版本 [root@localhost software]# ffmpeg ffmpeg version 1.2.11 Copyright (c) 2000-2014 the FFmpeg developers built on Apr 21 2016 17:48:12 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16) configuration: --enable-gpl --enable-postproc --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac libavutil 52. 18.100 / 52. 18.100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... 测试 [root@localhost software]# ffmpeg -i ./09.mp4 -y -acodec libmp3lame -ab 128 -ar 22050 -vcodec h264 -b 96k -r 25 ./01.flv … [root@localhost software]# ll total 32232 -rw-r--r--. 1 root root 4378561 Apr 21 17:56 01.flv -rw-r--r--. 1 root root 28609569 Apr 21 17:52 09.mp4 成功!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值