Under Windows PHP through FFmpeg to upload the video in detail, php_ffmpeg.dll installation download, find a long time php_ffmpeg.dll and application, found that there are few useful resources, now solve the problem, paste out to share with you: First to install PHP ffmpeg extensions, we need php_ffmpeg.dll files and some other auxiliary files,
Here to organize a bit to provide to you: Ffmpeg-php-win32-all.rar;
After decompression you will get 5 files, will Avcodec-51.dll, Avformat-51.dll, Avutil-49.dll, pthreadGC2.dll these four files copied to the Windows\System32 folder below, will Php_ Copy the Ffmpeg.dll file to the PHP extension directory (the extension directory is the configuration item in your php.ini Extension_dir = "D:\xampp\php\ext\") modify the Apache\bin file under the PHP.ini folder ( Note: If you modify the php.ini file under php/and do not load Php_ffmpeg.dll), add Extension=php_ffmpeg.dll and remove Extension=php_gd2.dll, extension=php _gettext.dll before the semicolon restart your Apache, use the Phpinfo () function to view the configuration information, find the following items, indicating that the configuration is successful
Let's create a video file, create a PHP file, and add the following code:
- <? PHP
- if (extension_loaded ('ffmpeg')) {//Determine if ffmpeg is loaded
- $mov = new ffmpeg_movie (' D:\robot.avi ');//path of the video
- $ff _frame = $mov->getframe (2);
- $GD _image = $ff _frame->togdimage ();
- $img =$_server[' Document_root ']. " /test.jpg ";//The absolute path of the image to be generated
- Imagejpeg ($gd _image, $img);//create JPG image
- Imagedestroy ($GD _image);//Destroy an image
- }else{
- echo "ffmpeg not Loaded";
- }
- ?>
Note: ffmpeg_movie (' D:\robot.avi ') is replaced with the path to your video, and you find that it is generated in the same directory as your PHP file.
indows php through ffmpeg to upload the video detailed