Home > Article > Backend Development > How to install php ffpemg extension
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.
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
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
##3. Modify ffmpeg_frame .c fileSince PIX_FMT_RGB32 is not defined in the original file, it must be defined in this fileLook for the line: Add the part outlined in red for definitionSave and exit4. Modify the php_ffmpeg.h file and modify the avhe avcodec_alloc definition order Just change the order of the original av_frame_alloc avcodec_alloc_frame, save and exit5, start configure configuration./configure --with=php-config=/path/php/bin/php-config6. Start compiling and installing
make && make installAfter completion, the ffmpeg.so file will be generated under /path_to_php/lib/php/extensions/no-debug……/
在php.ini中添加extension=ffmpeg.so7 , check whether the loading is successful
Recommended learning: "
PHP Video TutorialThe 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!