Home  >  Article  >  Backend Development  >  How to install php ffpemg extension

How to install php ffpemg extension

藏色散人
藏色散人Original
2023-03-09 11:11:162716browse

How to install the php ffpemg extension: 1. Download the "ffmpeg-php" extension through "git clone https://github.com/tony2001/ffmpeg-php.git"; 2. Through the corresponding version of phpize Generate the configure file; 3. Modify the "ffmpeg_frame.c" file; 4. Compile and install, and then add "extension=ffmpeg.so" to php.ini.

How to install php ffpemg extension

The operating environment of this tutorial: Red Hat 4.4.7 system, ffmpeg-php version 0.7.0, DELL G3 computer

How to install php ffpemg extension?

Perfect installation of ffmpeg-php extension

FFmpeg is a set of open source computer programs that can be used to record, convert digital audio and video, and convert them into streams. Use LGPL or GPL license. It provides a complete solution for recording, converting and streaming audio and video.

I won’t go into details about the installation of FFmpeg. There are tutorials on the Internet. It is recommended to install it with yum, compile and install the dependencies, and install it as much as you want. I have my heart...

If you install yum, here is a yum source. According to your own system selection, the one given here is el7, and el6 can be found by yourself according to the website address

sudo rpm –import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
How to install php ffpemg extension

PHP can use the ffmpeg-php extension to process images, audio, and video

I am tortured by this extension After two days, the tutorials on the Internet are really unreliable. I thought about it and sorted it out by myself. Without further ado, I went directly to the installation process:

1. Download the ffmpeg-php extension source code

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

2. Enter the directory and generate the configure file through the corresponding version of phpize

How to install php ffpemg extension
##3. Modify ffmpeg_frame .c file

Since PIX_FMT_RGB32 is not defined in the original file, it must be defined in this file

Look for the line:

How to install php ffpemg extension

Add the part outlined in red for definition

Save and exit

4. Modify the php_ffmpeg.h file and modify the avhe avcodec_alloc definition order

How to install php ffpemg extension
Just change the order of the original av_frame_alloc avcodec_alloc_frame, save and exit

5, start configure configuration

./configure --with=php-config=/path/php/bin/php-config

6. Start compiling and installing

make && make install

After completion, the ffmpeg.so file will be generated under /path_to_php/lib/php/extensions/no-debug……/

在php.ini中添加extension=ffmpeg.so

7 , check whether the loading is successful

How to install php ffpemg extension
##ok, perfect!

Recommended learning: "

PHP Video Tutorial

"

The above is the detailed content of How to install php ffpemg extension. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:What does php mail mean?Next article:What does php mail mean?