鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

安装

鲲鹏图像库基于开源社区FFmpeg优化了libswscale的sws_scale函数的色彩空间转换功能的性能,合入优化的patch编译安装后即可使用。

下载安装x264

  1. 获取软件包获取到的x264-master.tar.bz2保存到“/home/software”下并解压。
  2. 编译安装。
    1
    2
    3
    4
    cd /home/software/x264-master/
    mkdir build && cd build
    ../configure   --enable-static --enable-shared  --prefix=/home/x264install --disable-asm
    make -j && make install
    
  3. 配置环境变量。
    1
    export PKG_CONFIG_PATH=/home/x264install/lib/pkgconfig
    

下载安装FFmpeg

  1. 获取软件包获取到的ffmpeg-7.1.1.tar.xz保存到“/home/software”下并解压。
  2. 合入huawei_ffmpeg-7.1.1_opt.patch补丁。huawei_ffmpeg-7.1.1_opt.patch补丁由ffmpe-master.zip解压得到,该patch包含了FFmpeg的优化代码。
    1
    2
    3
    4
    5
    6
    7
    8
    cd /home/software/ffmpeg-7.1.1
    git config --global --add safe.directory /home/software/ffmpeg-7.1.1
    git init && git add . && git commit -m "init"
    cp /home/software/ffmpeg-master/huawei_ffmpeg-7.1.1_opt.patch ./
    git apply huawei_ffmpeg-7.1.1_opt.patch
    mkdir build && cd build
    ../configure --prefix=/home/ffmpeg/ --enable-shared --enable-pthreads --enable-gpl --enable-libx264 --disable-stripping --extra-cflags="-fopenmp" --extra-ldflags="-fopenmp"
    make -j && make install
    
  3. 验证是否安装成功。
    1
    2
    export  LD_LIBRARY_PATH=/home/ffmpeg/lib/:/home/x264install/lib/:$LD_LIBRARY_PATH
    /home/ffmpeg/bin/ffmpeg -version
    

    如果输出了FFmpeg的版本号,说明FFmpeg安装成功。