php-ffmpeg | 纯php5基于命名空间写的调用ffmpeg处理视频,可以方便地实现对php处理视频操作

 by   bingcool PHP Version: Current License: No License

kandi X-RAY | php-ffmpeg Summary

kandi X-RAY | php-ffmpeg Summary

php-ffmpeg is a PHP library. php-ffmpeg has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

用法 ####第一种方式: 模块已经实现了命名空间与require的映射结合,利用php5的命名空间和自动加载可以很方便地使用。 在项目中要建立一个名为Phpffmpeg(名称不能改,因为要与文件定义的根命名空间对应相同)的空的文件夹,把文件下载后,将里面的文件复制至新建的Phpffmpeg文件夹下。. 首先要导入 FFmpegAutoloader.class.php ,在执行静态的register()注册方法 require_once "path/FFmpegAutoloader.class.php"; \Phpffmpeg\FFmpegAutoloader::register();. (1)$movie = new ffmpeg_movie(String path_to_media, boolean persistent);. 获取对应的帧,返回的对象将作为new ffmpeg_frame(Resource gd_image)的实例化对象。 Returns a frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found. 获取下一帧 Returns the next key frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found. (15)$movie->getImage($savePath,$second,$width,$height); 获取视频的某个时间的帧图片(关键帧) $savePath 图片保存的路径,包含图片的名称。例如path/my.jpg; $second 视频对应的秒数,int。 $width 图片的宽度,int。 $height 图片的高度,int。. (16)$movie->getGif($savePath,$startsecond,$lastsecond,$width,$height); 截取视频的某个时间开始至某个时间的gif动态图。 $savePath 图片保存的路径,包含图片的名称。例如path/my.gif; $startsecond 视频开始秒数,int。 $lastsecond 持续的秒数,即gif的时长。 $width gif的宽度,int。 $height gif的高度,int。. (1)$frame = new ffmpeg_frame(Resource gd_image);. 参数是一个图片资源对象(需要自己创建),如果执行$movie->getFrame([Integer framenumber]);择返回的就是一个相当于new ffmpeg_frame(Resource gd_image);的实例化对象;. (5)$frame->resize(Integer width, Integer height [, Integer crop_top [, Integer crop_bottom [, Integer crop_left [, Integer crop_right ]]]]);. (6)$frame->crop(Integer crop_top [, Integer crop_bottom [, Integer crop_left [, Integer crop_right ]]]);.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              php-ffmpeg has a low active ecosystem.
              It has 30 star(s) with 11 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              php-ffmpeg has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of php-ffmpeg is current.

            kandi-Quality Quality

              php-ffmpeg has 0 bugs and 0 code smells.

            kandi-Security Security

              php-ffmpeg has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              php-ffmpeg code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              php-ffmpeg does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              php-ffmpeg releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              php-ffmpeg saves you 404 person hours of effort in developing the same functionality from scratch.
              It has 959 lines of code, 119 functions and 13 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed php-ffmpeg and discovered the below as its top functions. This is intended to give you an instant insight into php-ffmpeg implemented functionality, and help decide if they suit your requirements.
            • Get frame at time
            • Finds the file with the specified extension .
            • Add frame data
            • Get the Composer autoloader .
            • Get movie output
            • Get gif image
            • Resize the image .
            • Autoload a class
            • Set the output
            • Get the initializer .
            Get all kandi verified functions for this library.

            php-ffmpeg Key Features

            No Key Features are available at this moment for php-ffmpeg.

            php-ffmpeg Examples and Code Snippets

            No Code Snippets are available at this moment for php-ffmpeg.

            Community Discussions

            QUESTION

            Laravel FFMpeg - Unable to load FFMpeg in file error
            Asked 2021-Jan-31 at 17:36

            I'm trying to integrate FFMpeg into a Laravel project but am getting the error when I call the end point:

            FFMpeg\Exception\ExecutableNotFoundException: Unable to load FFMpeg in file /Users/me/Desktop/video/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFMpegDriver.php on line 55

            What I've done:

            brew install ffmpeg - installed FFMEG locally, can confirm that this works when using terminal

            Fresh Laravel install composer create-project laravel/laravel example-app

            Install php ffmpeg composer require php-ffmpeg/php-ffmpeg

            install Laravel ffmpeg composer require pbmedia/laravel-ffmpeg

            added FFMPEG to providers and aliases in app.php:

            ...

            ANSWER

            Answered 2021-Jan-31 at 15:51

            It's not able to find your FFMpeg executable. Try adding the path to FFMPEG_BINARIES and FFPROBE_BINARIES in your .env file.

            Source https://stackoverflow.com/questions/65980097

            QUESTION

            Merge Multiple Inputs in One With PHP-FFmpeg
            Asked 2020-Dec-08 at 18:13

            I want to merge multiple videos side by side in one video with PHP-FFmpeg, is there anyone help me about that?

            ...

            ANSWER

            Answered 2020-Dec-08 at 18:13

            Use hstack filter instead of overlay filter if you want side-by-side.

            Change:

            Source https://stackoverflow.com/questions/65174792

            QUESTION

            How to set pad with PHP-FFMpeg?
            Asked 2020-Sep-15 at 12:55

            I use PHP-FFMpeg library (https://github.com/PHP-FFMpeg/PHP-FFMpeg) and try to do this:

            ...

            ANSWER

            Answered 2020-Sep-15 at 12:55

            QUESTION

            PHP ffmpeg convert GIF to MP4
            Asked 2020-Aug-17 at 03:39

            I use this code to convert GIFs to MP4:

            ...

            ANSWER

            Answered 2020-Aug-17 at 03:39

            QUESTION

            php-ffmpeg get video duration
            Asked 2020-Apr-04 at 10:00

            When I try to get the duration of a video using the php-ffmpeg wrapper and ffprobe, I get a huge object instead of just the duration.

            ...

            ANSWER

            Answered 2017-May-11 at 18:45
            $ffprobe
                ->streams($this->videoFile)
                ->videos()                   
                ->first()                  
                ->get('duration');
            

            Source https://stackoverflow.com/questions/43922925

            QUESTION

            php-ffmpeg installation on apache2
            Asked 2020-Feb-17 at 14:14

            Trying to run PHP-FFMPEG and after install via composer I'm currently getting this.

            PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutableNotFoundException: Executable not found, proposed : avprobe, ffprobe in /var/www/html/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:159\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48): Alchemy\BinaryDriver\AbstractBinary::load(Array, NULL, Object(Alchemy\BinaryDriver\Configuration))\n#1 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Object(Alchemy\BinaryDriver\Configuration), NULL)\n#2 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(117): FFMpeg\FFProbe::create(Array, NULL, Object(Doctrine\Common\Cache\ArrayCache))\n#3 /var/www/html/starapp/test.php(4): FFMpeg\FFMpeg::create()\n#4 {main}\n\nNext FFMpeg\Exception\ExecutableNotFoundException: Unable to load FFProbe in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php:50\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMp in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php on line 50

            Some people have suggested running the following:

            ...

            ANSWER

            Answered 2020-Feb-17 at 14:14

            QUESTION

            PHP-FFMPeg Converts Video Twice
            Asked 2020-Feb-12 at 10:34

            I'm using FFMpeg's library for PHP (see https://github.com/PHP-FFMpeg/PHP-FFMpeg). After starting the convert process, the converted video's file size gradually increases (I constantly refresh the folder) and after converting finishes, the file size becomes 0 again and converting starts again. So converting is done twice, I could not understand if it is normal or there is something wrong.

            My converting code is:

            ...

            ANSWER

            Answered 2020-Feb-12 at 10:34

            This is because ffmpeg uses 2 pass encoding. https://superuser.com/questions/1362800/ffmpeg-2-pass-encoding

            first it writes everything to a log and then from that log it makes the video

            Source https://stackoverflow.com/questions/58112159

            QUESTION

            Heroku : FFMpeg installed but php worker can't find it
            Asked 2019-Dec-04 at 18:22
            Context

            I've a RabbitMQ's queue that contains AMQPMessage, those messages are referencing a video that needs to be treated (cut essentially and encoded in x264 also)

            Here's the code that cause the issue (pretty straightforward)

            ...

            ANSWER

            Answered 2019-Dec-04 at 18:22

            QUESTION

            PHP FFMPEG How to calculate file size of video from bitrate and duration before conversion?
            Asked 2019-Apr-17 at 19:07

            I am using php-ffmpeg (a PHP api to ffmpeg) to probe video files before they are converted. I am getting all the information I need just fine, but I want to use it to calculate the estimated file size of the video once it has been converted so that I can convert videos more efficiently for quality vs space etc.

            The post-conversion file size only has to be an estimate. So far I have tried multiplying the duration by the anticipated video bitrate plus the anticipated audio bitrate. However, that gives me a size way larger than the original video file that has a higher video and audio bitrate. I'm assuming there is a compression factor that may have to be taken into account for each different video codec, but am just trying to get somewhere with .mp4/m4v for now.

            This is what I have tried;

            ...

            ANSWER

            Answered 2019-Apr-17 at 19:07

            29302kbps is kilobits per second

            87.86 MB is megabytes.

            There are 8 bits in a byte. 121.11Mb equals 15.13MB (121.11/8)

            Source https://stackoverflow.com/questions/55733829

            QUESTION

            php-ffmpeg video converting issue when Source video size is more than 25 MB.
            Asked 2019-Mar-28 at 07:05

            I am using php-ffmpeg for converting uploaded videos. With all videos it was working great before. But from last few days through now only small videos are getting convert and giving me proper response on success. But large videos which size are more than 25MB they are uploading well on server converting also well but on success response it giving me error. image is bellow.

            so here when I refresh my page manually or check on server then I can see that video uploaded on server and converted also well already just issue facing in sending me success response when video get converted.

            And code is same for small and large video convert so small is working well and with large facing issues from last few days through.

            Any possible suggestion guys ?

            ...

            ANSWER

            Answered 2017-Nov-09 at 08:17

            Maybe it's a problem of time limit or memory limit, so you can add these lines:

            Source https://stackoverflow.com/questions/47196882

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install php-ffmpeg

            You can download it from GitHub.
            PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/bingcool/php-ffmpeg.git

          • CLI

            gh repo clone bingcool/php-ffmpeg

          • sshUrl

            git@github.com:bingcool/php-ffmpeg.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link