php5.3.3下安装ffmpeg

安装yasm,一般这个  yum  仓库会有这个包,可以直接安装

yum install yasm

安装ffmpeg

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg/
./configure --prefix=/usr/local/ffmpeg --enable-shared
make
make install

可以使用ffmpeg命令查看是否安装成功:

成功会返回如下信息

FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 16 2017 18:44:48 with gcc 4.4.7 20120313 (Red Hat 4.4.7-18)
  configuration: --enable-shared
  WARNING: library configuration mismatch
  avutil      configuration: --prefix=/usr/local/ffmpeg --enable-shared
  avcore      configuration: --prefix=/usr/local/ffmpeg --enable-shared
  avcodec     configuration: --prefix=/usr/local/ffmpeg --enable-shared
  avformat    configuration: --prefix=/usr/local/ffmpeg --enable-shared
  avdevice    configuration: --prefix=/usr/local/ffmpeg --enable-shared
  avfilter    configuration: --prefix=/usr/local/ffmpeg --enable-shared
  swscale     configuration: --prefix=/usr/local/ffmpeg --enable-shared
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run ‘man ffmpeg‘

我在安装的时候出现了报错:

ffmpeg: error while loading shared libraries: libavdevice.so.52 : cannot open shared object file: No such file or directory
解决方法:
在 /etc/ld.so.conf 中最后一行添加你的ffmpeg的安装目录,并确保安装目录下有此文件 lib/libavdevice.so.52
在运行  ldconfig  重新加载信息

下面安装php-ffmpeg

下载地址:http://ffmpeg-php.sourceforge.net/

版本为:ffmpeg-php-0.6.0.tbz2

支持的最低版本:

  • ffmpeg-0.4.9_pre1 or higher.
  • php-4.3.0 or higher
  • gd-2.0 or higher (the version of GD bundled with PHP works too)

如果没有 phpize ,则需要安装  php-devel

tar xjf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0/
phpize
./configure --with-ffmpeg=/usr/local/ffmpeg
可以先使用make test查看是否有报错
然后在使用make clean 重新编译
make
make install

在安装  php-ffmpeg  出现如下报错

/root/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_ffmpeg_frame’:
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Error 1
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_toGDImage’:

需要将  ffmpeg_frame.c 里面的 PIX_FMT_RGBA32 替换为 PIX_FMT_RGB32,总共有三处

所有编译服务安装完成之后,需要在  php.ini  中最后一行加入:extension=ffmpeg.so

重启  php  使生效

使用下面方式可以查看是否生效:

php -m|grep ffmpeg
php -r ‘phpinfo();‘ | grep ffmpeg
时间: 2024-08-11 03:20:58

php5.3.3下安装ffmpeg的相关文章

Ubuntu下安装ffmpeg

Ubuntu下安装ffmpeg可以通过以下命令安装: >sudo apt-get install libav-tools

使用yum在centos下安装ffmpeg

使用yum在centos下安装ffmpeg 说明:在写这篇文章时不知道查了多少资料不是资料不完整就是根本不能安装,网上许多资料都是转载.写这篇文章时我亲自做了测试,安装完全通过,如果有什么不对的地方欢迎拍砖  一.安装ffmpeg  操作系统:centos 5.6  (一)安装编译环境  #yum install -y automake autoconf libtool gcc gcc-c++   (二)安装所需程序库的RPM包到 centos(因为centos自带的库中没有ffmpeg包,这里

linux(centos)下安装ffmpeg

[备忘]windows环境下20行php代码搞定音频裁剪 上次我的这篇文章将了windows下web中如何操作ffmpeg的文章,这里则记录下linux(centos)下的安装 首先:我花了中午大概1个小时的时间安装它,失败了 然后下午找公司的运维帮忙安装,安装了2-3个小时,都没装完,我就回座位继续码代码了... 一会儿运维微信我,说让我再提供台机子给他,他找到了一个快捷的安装方式,就是下面转载的内容(测试可用) 看到一句话,会心的笑了一下:网上搜索源码编译ffmpeg,看来安装这么多的软件包

Linux下安装ffmpeg

ffmpeg是一个很强大的音视频处理工具,官网是:http://ffmpeg.org/ 官网介绍ffmpeg是:一个完整的.跨平台的解决方案,可以记录.转换和传输音频和视频.ffmpeg既可以播放视频,也提供命令行工具来处理视频,另外还有强大的视频处理库用于开发,下面是以Linux为例介绍ffmpeg的安装流程的简单的命令行对视频进行转码操作,是ffmpeg中最最简单的入门内容. 首先去官网下载源码包,这里下载的是最新的ffmpeg-3.3.1.tar.bz2,下载之后上传至Linux准备安装,

ubuntu 下安装ffmpeg

FFmpeg是一套可以用来记录.转换数字音频.视频,并能将其转化为流的开源计算机程序.采用LGPL或GPL许可证.它提供了录制.转换以及流化音视 频的完整解决方案.它包含了非常先进的音频/视频编解码库libavcodec,为了保证高可移植性和编解码质量,libavcodec里很多codec 都是从头开发的. 下面是安装教程首先创建一个install-ffmpeg.sh文件写以下内容 sudo apt-get install build-essential git-core checkinstal

win10下安装FFmpeg步骤

1.官方下载地址:https://ffmpeg.zeranoe.com/builds/ # 下载方式一,太慢 # 下载方式二,推荐 2.解压到D:\Program Files (x86),这个看个人喜欢 # 如果觉得文件名过长,可以重命名,我这改为ffmpeg 3.把bin文件添加到环境变量中 4.cmd中运行:ffmpeg -version 原文地址:https://www.cnblogs.com/dalyday/p/11380252.html

Windows下编译安装 FFmpeg

在Linux/Mac下编译 ffmpeg是非常方便的.但要在 Windows下编译 ffmpeg还真要花点时间.以下就是在 Windowns下编译ffmpeg的步骤: 一.安装Cygwin 在windows下安装 ffmpeg 的最好方式就是使用Cygwin. Cygwin是什么呢?简单的说,就是在 Windows上装了一个Linux模拟器.然后你可以在这个模拟器上按照Linux的方式操作 Windows系统.因此,Windows安装了Cygwin之后,你就把它当Linux用就可以了. 既然在W

ubuntu14.04 安装ffmpeg遇到的问题

本想在ubuntu14.04下安装ffmpeg,使用PPA安装,但是在加入ffmpeg的PPA源后使用apt-get安装失败,至今还未找到原因,网上有人安装成功了,所以没办法,只好编译安装,在编译时,需要开启x11grab的选项,这样才能使用屏幕抓图的功能,但在使用./configure时,提示没有Xext.看来是缺少Xext包,但直接apt-get是无法安装的,所以需要使用apt-cache search xext,找到要安装的包的名字,然后再安装该包,之后才能configure.make.m

编译安装FFmpeg 要支持xvid、x264、mp3、ogg、amr、faac

编译安装FFmpeg 要支持xvid.x264.mp3.ogg.amr.faac libfaac    faac格式的编解码包libmp3lame    mp3格式编解码包libopencore-amrwb libopencore-amrnb    amr格式编解码包libx264    x264格式编解码包libvorbis    ogg格式编解码包libxvid    xvid格式编解码包 开始安装(有些包下载可能需要FQ)faacwget http://softlayer-dal.dl.s