首页 > 系统相关 >centos7环境下二进制编译安装ffmpeg

centos7环境下二进制编译安装ffmpeg

时间:2024-11-09 09:45:57浏览次数:4  
标签:enable ffmpeg 二进制 centos7 -- usr workspace local

yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
yum install -y automake libtool autoconf gcc gcc-c++ make automake cmake openssl openssl-devel


mkdir -p /usr/local/src/ffmpeg_sources
cd /usr/local/src/ffmpeg_sources

\# 安装 nasm
cd /usr/local/src/ffmpeg_sources
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2
tar xjvf nasm-2.15.05.tar.bz2
cd nasm-2.15.05
./autogen.sh
./configure --prefix="/workspace/ffmpeg" --bindir="/usr/local/bin"
make -j 4
make install


\# 安装 Yasm
cd /usr/local/src/ffmpeg_sources

curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix="/workspace/ffmpeg" --bindir="/usr/local/bin"
make -j 8
make install


\# 安装 freetype-2

yum install -y bzip2

wget http://download.savannah.gnu.org/releases/freetype/freetype-2.10.0.tar.bz2

tar -jxvf freetype-2.10.0.tar.bz2

cd freetype-2.10.0

./configure --prefix="/workspace/ffmpeg" --disable-shared

make -j 8
make install



\# 安装 libx264

cd /usr/local/src/ffmpeg_sources
git clone --branch stable --depth 1 https://code.videolan.org/videolan/x264.git
cd x264
PKG_CONFIG_PATH="/workspace/ffmpeg/lib/pkgconfig" ./configure --prefix="/workspace/ffmpeg" --bindir="/usr/local/bin" --enable-static
make -j 8
make install

\# 安装 libx265

cd /usr/local/src/ffmpeg_sources
git clone --branch stable --depth 2 https://bitbucket.org/multicoreware/x265_git
cd /usr/local/src/ffmpeg_sources/x265_git/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/workspace/ffmpeg" -DENABLE_SHARED:bool=off ../../source
make -j 8
make install

\# 安装 libfdk_aac

cd /usr/local/src/ffmpeg_sources
git clone --depth 1 https://github.com/mstorsjo/fdk-aac
cd fdk-aac
autoreconf -fiv
./configure --prefix="/workspace/ffmpeg" --disable-shared
make -j 8
make install


\# 安装 libmp3lame

cd /usr/local/src/ffmpeg_sources
curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
tar xzvf lame-3.100.tar.gz
cd lame-3.100
./configure --prefix="/workspace/ffmpeg" --bindir="/usr/local/bin" --disable-shared --enable-nasm
make -j 8
make install

\# 安装 libopus
cd /usr/local/src/ffmpeg_sources
curl -O -L https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
tar xzvf opus-1.3.1.tar.gz
cd opus-1.3.1
./configure --prefix="/workspace/ffmpeg" --disable-shared
make -j 8
make install


\# 安装 libvpx

cd /usr/local/src/ffmpeg_sources
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="/workspace/ffmpeg" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
make -j 8
make install

\# 安装 FFmpeg

cat /etc/profile.d/zz_jdk.sh

export JAVA_HOME=/opt/jdk
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export MAVEN_HOME=/opt/maven
export M2_HOME=$MAVEN_HOME
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/workspace/ffmpeg/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$MAVEN_HOME/bin:/workspace/ffmpeg/bin

ERROR: freetype2 not found using pkg-config
ln -s /workspace/ffmpeg/include/freetype2/ft2build.h /workspace/ffmpeg/include/ft2build.h
ln -s /workspace/ffmpeg/include/freetype2/freetype /workspace/ffmpeg/include/freetype

cd /usr/local/src/ffmpeg_sources
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="/usr/local/bin:$PATH" PKG_CONFIG_PATH="/workspace/ffmpeg/lib/pkgconfig" ./configure \
--prefix="/workspace/ffmpeg" \
--pkg-config-flags="--static" \
--extra-cflags="-I/workspace/ffmpeg/include" \
--extra-ldflags="-L/workspace/ffmpeg/lib" \
--extra-libs=-lpthread \
--extra-libs=-lm \
--bindir="/usr/local/bin" \
--enable-gpl \
--enable-libfdk_aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree
make -j 8
make install

[root@eus-video-collaboration-file01:~]# ffmpeg -version
ffmpeg version N-102519-gdcb285d2b7 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
configuration: --prefix=/usr/local/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/usr/local/ffmpeg_build/include --extra-ldflags=-L/usr/local/ffmpeg_build/lib --extra-libs=-lpthread --extra-libs=-lm --bindir=/usr/local/bin --enable-gpl --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 57. 0.100 / 57. 0.100
libavcodec 59. 1.100 / 59. 1.100
libavformat 59. 2.100 / 59. 2.100
libavdevice 59. 0.100 / 59. 0.100
libavfilter 8. 0.101 / 8. 0.101
libswscale 6. 0.100 / 6. 0.100
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100


ffprobe -i mov.mp4 -show_streams -print_format json
ffmpeg -i mov.mp4 -c:v libx264 -profile:v baseline -level 3.0 -y movbaseline.mp4

标签:enable,ffmpeg,二进制,centos7,--,usr,workspace,local
From: https://www.cnblogs.com/sathcal/p/18536354

相关文章

  • ffmpeg处理音视频
    FFmpeg怎么念FFmpeg念作efefempeg,其全称为FastForwardMovingPictureExpertGroupFFmpeg是什么FFmpeg是一套领先的多媒体框架,是一套开源且跨平台的多媒体解决方案,提供了音视频的编码、解码、转码、封装、解封装、流媒体、滤镜、播放等功能,官网地址为ffmpeg.orgFFmpeg可......
  • ffmpeg实现图片转视频以及视频转图片
    简介:因为计网作业需要,今天就是讲一讲如何使用ffmpeg把图片转视频以及视频转图片。一、下载ffmpeg你可以在ffmpeg的bin文件下看见以下三个.exe文件二、建个快速打开命令行的bat文件可以新建文件夹.txt->在.txt文件中输入cmd并保存->将.txt后缀名改成.bat可以看一下打开.bat文......
  • ffmpeg安装教程
    1下载所需要的软件mkdir/usr/local/softcd/usr/local/softwgethttps://www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2wgethttp://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gzfreetype下载地址http://www.linuxfromscratch.org/blfs/view/svn/gen......
  • FFmpeg原理介绍
    本书《FFmpeg原理》主要讲解FFmpeg原理性的知识,前面几章主要讲解一些音视频开发的基础知识,例如原始数据YUV跟RGB,封装格式FLV跟MP4,压缩编码的基本概念,还有封装格式分析。前面几章是音视频开发,流媒体技术的基础,后面的章节主要讲解如何搭建FFmpeg各种调试环境,同时提供FF......
  • ffmpeg特效处理
    今天继续学习ffmpeg工具,上篇博客主要讲的是ffmpeg对音频和视频的处理,今天这篇是对图像的处理,没想到也能操作。它的命令和处理音视频的一样,都是命令行。能够处理图像的尺寸、裁剪、旋转、模糊、去噪、加水印和生成缩略图等。1、图像处理命令1.1、调整图像大小ffmpeg-iinput.jpg......
  • FFmpeg常用命令
    视频转MP4ffmpeg-iD:\ffmpeg\video\2\2.mp4-vcodeccopy-anD:\v\s\2.mp4视频获取音频ffmpeg-iD:\ffmpeg\video\3\2.mp4-acodeccopy-vnD:\v\m\2.aac视频音频合并ffmpeg-iD:\v\s\2.mp4-iD:\v\m\2.aac-c:vcopy-c:aaac-strictexperimentalD:\v\r\2......
  • byte数组转16进制,二进制字符串
    1)16进制字符串a)c#内置apibyte[]bytes=BitConverter.GetBytes(123);varhexStr=BitConverter.ToString(bytes); b)实现1///返回低字节顺序十六进制字符串(低字节在左侧)publicstaticstringToHexString(byte[]bytes){char[]hexChars="012345678......
  • Ubuntu 24.04 二进制安装 MySQL 8.0.20
    相关资料操作系统:Ubuntu24.04数据库下载地址:https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz部署#安装必要的依赖apt-yinstallnumactllibaio1t64-yln-sv/usr/lib/x86_64-linux-gnu/libtinfo.so.6.4/usr/lib/x86_64-li......
  • 基于Centos7.X部署mysql8.4集群(主备)
    1、目标    将在主库的数据变更同步到从库,从而保证主库和从库的数据一致。2、原理    2.1主库会把数据变更记录在二进制日志文件Binlog中    2.2从库连接主库,读取binlog日志,并写入自身中继日志relaylog    2.3slave重做中继日志,将改变......
  • Centos7.8静默安装企业版Oracle11g和创建实例
    1、安装环境准备:A、系统版本和oracle11g企业版安装软件压缩包:[root@dbprimary07~]#cat/etc/redhat-releaseCentOSLinuxrelease7.8.2003(Core)[root@dbprimary07~]#uname-aLinuxdbprimary073.10.0-1127.el7.x86_64#1SMPTueMar3123:36:51UTC2020x86_64x......