indows php through ffmpeg to upload the video screenshot of the detailed

Source: Internet
Author: User

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:
    1. <? PHP
    2. if (extension_loaded ('ffmpeg')) {//Determine if ffmpeg is loaded
    3. $mov = new ffmpeg_movie (' D:\robot.avi ');//path of the video
    4. $ff _frame = $mov->getframe (2);
    5. $GD _image = $ff _frame->togdimage ();
    6. $img =$_server[' Document_root ']. " /test.jpg ";//The absolute path of the image to be generated
    7. Imagejpeg ($gd _image, $img);//create JPG image
    8. Imagedestroy ($GD _image);//Destroy an image
    9. }else{
    10. echo "ffmpeg not Loaded";
    11. }
    12. ?>
      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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.