Home > Backend Development > PHP Tutorial > ffmpeg for php - CSDN Blog

ffmpeg for php - CSDN Blog

不言
Release: 2023-03-22 21:00:01
Original
5013 people have browsed it

This article shares with you php's ffmpeg. Friends who are interested can take a look


##ffmpeg-php extension




##php video thumbnail, the more commonly used one is ffmpeg-php

1: Install ffmpeg

ffmpeg download link http://ffmpeg.org/download.html

Unzip the installation package

tar -jxvf ffmpeg-x.x.tar.bz2

Enter the directory

cd ffmpeg-x.x

Compile and install

./configure --enable-shared && make && make install

After the installation is complete, execute ffmpeg -version

If information similar to the following appears, ffmpeg is installed successfully.



##1
2

3

4

5

6

7

8

9

10


ffmpeg version 2.5.11 Copyright (c) 2000-2016 the FFmpeg developers

built on Apr 17 2017 16:47:15 with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)

configuration: --enable-shared

libavutil      54. 15.100 / 54. 15.100

libavcodec     56. 13.100 / 56. 13.100

libavformat    56. 15.102 / 56. 15.102

libavdevice    56.  3.100 / 56.  3.100

libavfilter     5.  2.103 /  5.  2.103

libswscale      3.  1.101 /  3.  1.101

libswresample   1.  1.100 /  1.  1.100


 2 Install ffmpeg-php

Official download link

https://sourceforge.net/projects/ffmpeg-php/files/ffmpeg -php/

The official version has not been updated for a long time. I tried it on centos 7 + php5.6&php7.1 centos6.5+php5 but it didn’t work. An error will be reported when configuring make.

Later I found a version on github. Compiled and installed successfully on centos7.2+php5.5.6 (centos7 + php7.1 still doesn’t work)

Address: git clone https://github.com/tony2001/ffmpeg-php.git

You can also visit my Baidu cloud disk to download

https://pan.baidu.com/s/1skQTVlj

Enter the ffmpeg-php directory to compile and expand

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

Note (if an error occurs after make, it is a problem with the ffmpeg-php version. Stop fussing and change the version (or try lowering the php version)).

Add



##


Restart php. Check whether there is ffmpeg information in phpinfo().

If yes, OK

or execute



in the php configuration file php.ini ##1


##extension=ffmpeg.so

##1


##/usr/local/php/bin/php -i |grep ffmpeg


If there is output, OK


Reprinted from:

https://www.cnblogs.com/jkklearn/p/6737467.html

Related recommendations:

Detailed explanation of ffmpeg in php

detailed explanation of node.js based on FFMPEG video push test

PHP calls ffmpeg to take video screenshots and splice script examples to share

The above is the detailed content of ffmpeg for php - CSDN Blog. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template