zoukankan      html  css  js  c++  java
  • ffmpeg安装教程

    1 下载所需要的软件
    
    mkdir /usr/local/soft
    
    cd /usr/local/soft
    
    wget https://www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
    
    wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
    
    freetype  下载地址  http://www.linuxfromscratch.org/blfs/view/svn/general/freetype2.html
    
    fribidi  下载地址
    http://www.linuxfromscratch.org/blfs/view/svn/general/fribidi.html
    
    fontconfig  下载地址
    http://www.linuxfromscratch.org/blfs/view/svn/general/fontconfig.html
    
    harfbuzz 下载地址
    https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.2.7.tar.bz2
    2 软件安装
    yasm 安装
            tar -zxvf yasm-1.3.0.tar.gz
            cd yasm-1.3.0
            ./configure  --prefix=/usr/local/yasm
            make
            make install
    配置环境变量
    vim /etc/profile
    export YASM=/usr/local/yasm
    export PATH=${YASM}/bin:${PATH}
        
    source /etc/profile
        
    #查看版本 测试是否安装成功
    yasm --version 
    
    
    nasm 安装
       wget http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
    
    tar -jxvf nasm-2.14.02.tar.bz2
    cd nasm-2.14.02
    ./configure --prefix=/usr/local/nasm
    make
    make install
    
    #配置环境变量
    export NASM=/usr/local/nasm
    export PATH=${NASM}/bin:${PATH}
        
    source /etc/profile
    
    
    x264 安装
    下载地址 https://code.videolan.org/videolan/x264
    wget  https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.gz
    
    tar -zxvf x264-master.tar.gz
    cd x264-master
    ./configure  --prefix=/usr/local/x264  --enable-shared
    make
    # 配置环境变量
    
    export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig
    export PATH=${PKG_CONFIG_PATH}/bin:${PATH}
        
    source /etc/profile
    
    harfbuzz 安装
         tar -jxvf harfbuzz-1.2.7.tar.bz2
         cd harfbuzz-1.2.7
         ./configure --prefix=/usr/local/harfbuzz
         make
         make install 
    
    freetype 安装
        tar -xvf freetype-2.10.4.tar.xz
        cd freetype-2.10.4
        ./configure --prefix=/usr/local/freetype --disable-static
        make
        make install 
    
    fribidi 安装
        tar -xvf fribidi-1.0.9.tar.xz
        cd fribidi-1.0.9
        ./configure --prefix=/usr/local/fribidi
        make
        make install 
    
    
    fontconfig 安装
        tar -jxvf fontconfig-2.13.1.tar.bz2
        cd fontconfig-2.13.1
        ./configure --prefix=/usr/local/fontconfig
        make
        make install
    
    
    libass 安装
         https://www.linuxfromscratch.org/blfs/view/svn/multimedia/libass.html
    
    tar -xvf libass-0.15.1.tar.xz
    
    cd libass-0.15.1
    ./configure --prefix=/usr/local/libass --disable-static
    make
    make install 
    
    配置环境变量
    vim /etc/profile
        
    export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig:/usr/local/freetype/lib/pkgconfig:/usr/local/harfbuzz/lib/pkgconfig:/usr/local/fribidi/lib/pkgconfig:/usr/local/libass/lib/pkgconfig
    
    export PATH=${PKG_CONFIG_PATH}/bin:${PATH}
        
    #生效
    source /etc/profile
    
    
    ld.so.conf 配置
    
     vim /etc/ld.so.conf
        
        #添加一下内容
        /usr/local/ffmpeg/lib
        /usr/local/x264/lib
        /usr/local/freetype/lib
        /usr/local/firbidi/lib
        /usr/local/harfbuzz/lib
        /usr/local/libass/lib
        
        #生效
        ldconfig
    3 ffmpeg 安装
       tar -jxvf ffmpeg-snapshot.tar.bz2
       cd ffmpeg
       ./configure --prefix=/usr/local/ffmpeg --enable-libx264 --enable-gpl --enable-libass --enable-fontconfig --enable-openssl --enable-nonfree 
       make
       make install
    
      #配置环境变量
        export FFMPEG=/usr/local/ffmpeg
        export PATH=${FFMPEG}/bin:${PATH}
        
        source /etc/profile
        
        ffmpeg --version

     安装好 x264
        vim /etc/ld.so.conf
        在该文件夹中添加
        /usr/local/ffmpeg/lib
        /usr/local/x264/lib
        
        #配置生效
        ldconfig
    字体文件添加
          商用免费下载
          下载地址:https://izihun.com/shangyongziti/r2/
     linux 添加字体
       以宋体为例,新建 songti 文件夹,将字体文件放入该文件夹中
        
        cd /usr/share/fonts/songti
        mkfontscale
        mkfontdir
        fc-cache-fv
  • 相关阅读:
    Linux面试题汇总答案
    VMWARE ESXI 虚拟硬盘的格式:精简置备、厚置备延迟置零、厚置备置零
    [Python基础知识]正则
    [代码评审1]代码评审
    [EF2]Sneak Preview: Persistence Ignorance and POCO in Entity Framework 4.0
    [EF1]POCOs(Plain Old C# Object)Entity Framework 4.x: POCOs入门
    [网站性能3]SqlServer中Profiler的使用
    [网站性能2]Asp.net平台下网站性能调优的实战方案
    [网站性能1]对.net系统架构改造的一点经验和教训
    2.1 python使用MongoDB 示例代码
  • 原文地址:https://www.cnblogs.com/jackspider/p/15031212.html
Copyright © 2011-2022 走看看