源码编译安装FFmpeg

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zp_00000/article/details/80859434

源码编译安装FFmpeg

安装编译时所需的依赖工具
yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
创建源码管理目录
mkdir ~/ffmpeg_sources
安装NASM
cd ~/ffmpeg_sources
curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2
tar xjvf nasm-2.13.02.tar.bz2
cd nasm-2.13.02
./autogen.sh
./configure
make
make install
安装YASM
cd ~/ffmpeg_sources
curl -O -L http://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
make
make install
安装FFmpeg
cd ~/ffmpeg_sources
tar -zxvf ffmpeg-3.4.tar.gz
cd ffmpeg-3.4
./confifure
make
make install
测试是否安装成功

终端输入命令

ffprobe /data/wwwroot/micro_service/fb_cod_creative_mgr_service/public/uploads/5629cf2c2fd0076fd6c2833b835d6f95.mp4

结果

ffprobe version 3.4 Copyright (c) 2007-2017 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
  configuration: 
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/wwwroot/uploads/5629cf2c2fd0076fd6c2833b835d6f95.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : 237962383603232
    encoder         : Lavf56.40.101
  Duration: 00:00:06.11, start: -0.021814, bitrate: 1319 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x1080 [SAR 1:1 DAR 1:1], 1322 kb/s, 23.98 fps, 23.98 tbr, 23977 tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 48 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

没有更多推荐了,返回首页