#yum -y install yasm yasm-devel libvorbis libvorbis-devel libogg

2, if installation (mp3 decoder) # wget jaist.dl.sourceforge.net/project/lam… #tar ZXVF lame-3.100.tar.gz # CD lame-3.100 #./configure #make && make install

Nasm #wget www.nasm.us/pub/nasm/re #./configure #make && make install

Turn 4, X264 installation (mp4) # yum install git installed (git) # git clone git://git.videolan.org/x264.git # CD X264 #. / configure –enable-static –enable-shared –prefix=/server/x264 #make #make install

5, faac installation (mp4 format used) has been deprecated # wget downloads.sourceforge.net/faac/faac-1… /configure #make && make install make[3] *** [3gp.o] Error 1 Error #vi common/mp4v2/mpeg4ip.h, delete 126 lines char *strcasestr(const char *haystack, const char *needle); To make again. #make install

# 5, FDK – aac install wget jaist.dl.sourceforge.net/project/ope… #./configure #make #make install

Zlib install #wget www.zlib.net/zlib-1.2.11…

5, ffmPEG install #wget ffmpeg.org/releases/ff… Or git clone git.ffmpeg.org/ffmpeg.git # ffmpeg tar ZXVF ffmpeg – 3.4.1 track. Tar. Gz # # CD ffmpeg – 3.4.1 track export PKG_CONFIG_PATH = / usr/local/lib/pkgconfig: $PKG_CONFIG_PATH (set the environment variable) #. / configure — prefix = / server/ffmpeg – enable – Shared –enable-version3 –enable-nonfree –enable-gpl –enable-libvorbis –enable-shared #./configure –prefix=/server/ffmpeg –enable-libmp3lame –enable-libvorbis –enable-gpl –enable-version3 –enable-nonfree –enable-pthreads –enable-shared If you want to convert audio to MP3 please use this command to compile. /configure –prefix=/server/ffmpeg –enable-libmp3lame –enable-libvorbis –enable-gpl –enable-version3 –enable-nonfree –pkg-config=pkg-config –enable-pthreads –enable-shared –enable-libx264

// Remember to set the environment variables before each compilation. Using libx264 without pkg-config #./configure –prefix=/server/ffmpeg –enable-libmp3lame –enable-libfdk-aac –enable-libvorbis –enable-gpl –enable-version3 –enable-nonfree –enable-pthreads –enable-libx264 –pkg-config=pkg-config –enable-shared –extra-cflags=-I/server/x264/include –extra-ldflags= -l /server/x264/lib –extra-cflags = -l /server/x264/lib #make && make install

Make: * * * [57] libavcodec/libavcodec. So. The Error 1 see notepad professional record

/server/ffmpeg/lib/ /server/x264/lib/ #vi /etc/ld.so.conf add x264/ server/x264/lib/

#wq #ldconfig # ffmpeg-version If the version information is correct, the installation is successful

Start after installation is finished to the following error: / server/ffmpeg/bin/ffmpeg: error while loading Shared libraries: libfdk – aac. So. 1: cannot open shared object file: No such file or directory Add soft links # ln -s/usr/local/lib/libfdk – aac. So the 1.0.0 / usr/lib64 / libfdk – aac. So the # 1 until/server/ffmpeg/bin/ffmpeg – this version published information, Successful installation

6, ffmpeg – PHP extension installation # yum – y install bzip2 # wget jaist.dl.sourceforge.net/project/ffm… #tar -xvf ffmpeg-php-0.6.0.tbz2 –with-ffmpeg=/server/ PHP /bin/php-config –with-ffmpeg=/server/ffmpeg/ *** [ffmpeg-php.lo] Error 1 #mv ffmpeg-php.lo *** [ffmpeg_movie.lo] Error 1 #mv ffmpeg_movie.lot ffmpeg_movie.lo #make Tip: after the success of the installation/server/php7 / lib/PHP/extensions / / no – debug – ZTS – 20170718

1, ffmpeg: error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or directory #vi /etc/ld.so.conf add /server/ffmpeg/lib to /etc/ld.so.conf error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No to the file or directory: # mv/usr/local/lib/libmp3lame. So the 0.0.0 / usr/lib64 / libmp3lame. So. 0 all after the success of the installation, start the solution of the error are soft links

Phpinfo () If ffmPEG complete information is available, the extension is successfully installed

7, ffmpeg-php extension install (2) cp /server/ PHP /bin/ PHP /usr/sbin/ so that you can use “PHP” to execute. Perform under/home # PHP – r “copy (‘ getcomposer.org/installer ‘, ‘composer – setup. PHP);” #php -r “if (hash_file(‘SHA384’, ‘composer-setup.php’) === ‘544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;” #php composer-setup.php #php -r “unlink(‘composer-setup.php’);” #cp composer. Phar /usr/local/bin/composer #composer require php-ffmpeg/php-ffmpeg

Once installed, it will create a vendeo folder in the current directory and move that folder to the project directory so that the FFmpeg PHP extension is installed

8, PHP is used in the require $_SERVER [‘ DOCUMENT_ROOT ‘]. ‘/ plug-in/vendor/autoload. PHP;

//ffmpeg = \FFMpeg\FFMpeg::create([ ‘ffmpeg.binaries’ => ‘/server/ffmpeg/bin/ffmpeg’, ‘ffprobe.binaries’ => ‘/server/ffmpeg/bin/ffprobe’, ‘timeout’ => 3600, ]); ffmpeg->open(frame =frame ->save(‘1.jpg’); If any error is reported, the current project directory does not have write permission. Add apache owner write permission to the project.