---
title: 安装
description: "鲲鹏图像库基于开源社区FFmpeg优化了libswscale的sws_scale函数的色彩空间转换功能的性能，合入优化的patch编译安装后即可使用。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/252RC1/accel/kunpengaccel_kpimage_06_0010.html
sourcePath: /source/zh/kunpengboostkithistory/252RC1/accel/kunpengaccel_kpimage_06_0010.html
indexId: 5b7d6e611d2103aa26525282f57cba397a6b324104a3e908db8aa5e0b3d5975880
---
# 安装

鲲鹏图像库基于开源社区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补丁由ffmpeg-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安装成功。
