本帖最后由 堡塔运维香菜卷 于 2023-3-21 09:57 编辑
客户需要压缩mp4视频,所以需要ffmpeg,原来的版本太低,试了很多方法,最后总结如下
- #! /bin/bash
- echo "Install yasm ..."
- yum install yasm SDL* gtk+* -y
- echo "Install libx264 ..."
- wget ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20191217-2245-stable.tar.bz2
- tar jxvf x264-snapshot-20191217-2245-stable.tar.bz2
- cd x264-snapshot-20191217-2245-stable
- ./configure --enable-shared --disable-asm && make && make install
- ldconfig
- echo "Install ffmpeg ..."
- cd ..
- wget http://ffmpeg.org/releases/ffmpeg-5.1.2.tar.gz
- tar zxvf ffmpeg-5.1.2.tar.gz
- cd ffmpeg-5.1.2
- ./configure --enable-shared --enable-libx264 --enable-gpl --enable-pthreads && make && make install
复制代码 问题:ERROR: x264 not found using pkg-config
解决办法:
vim /etc/profile 或者手动编辑/etc/profile文件
末尾加入内容export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig,具体看各位自己x264的安装路径
source /etc/profile
然后再./configure ...就没问题了
|
|