Rate This Document
Findability
Accuracy
Completeness
Readability

Installation

The Kunpeng Image Library optimizes the color space conversion performance of the sws_scale function of libswscale in FFmpeg. You can use this library after applying the optimization patch and compiling and installing the library.

Downloading and Installing x264

  1. Save the x264-master.tar.bz2 package obtained in Software Packages to /home/software and decompress it.
  2. Perform compilation and installation.
    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. Configure the environment variable.
    1
    export PKG_CONFIG_PATH=/home/x264install/lib/pkgconfig
    

Downloading and Installing FFmpeg

  1. Save the ffmpeg-7.1.1.tar.xz package obtained in Software Packages to /home/software and decompress it.
  2. Apply huawei_ffmpeg-7.1.1_opt.patch. huawei_ffmpeg-7.1.1_opt.patch is extracted from ffmpe-master.zip. The patch contains code for optimizing 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. Check whether the installation is successful.
    1
    2
    export  LD_LIBRARY_PATH=/home/ffmpeg/lib/:/home/x264install/lib/:$LD_LIBRARY_PATH
    /home/ffmpeg/bin/ffmpeg -version
    

    If the FFmpeg version is displayed, FFmpeg has been installed.