{"id":23111746,"url":"https://github.com/sharapov-outsource/php-ffmpeg-extensions","last_synced_at":"2025-08-16T19:30:50.867Z","repository":{"id":57048951,"uuid":"61961337","full_name":"sharapov-outsource/php-ffmpeg-extensions","owner":"sharapov-outsource","description":"Extensions library for the PHP FFMpeg (https://github.com/PHP-FFMpeg/PHP-FFMpeg)","archived":false,"fork":false,"pushed_at":"2021-06-02T15:29:17.000Z","size":13831,"stargazers_count":15,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-15T20:38:04.208Z","etag":null,"topics":["boilerplate-application","docker","ffmpeg","ffmpeg-script","ffmpeg-wrapper","php","php-ffmpeg","video-processing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sharapov-outsource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"https://paypal.me/alexandersharapov"}},"created_at":"2016-06-25T20:57:56.000Z","updated_at":"2023-07-23T10:39:42.000Z","dependencies_parsed_at":"2022-08-23T17:50:28.628Z","dependency_job_id":null,"html_url":"https://github.com/sharapov-outsource/php-ffmpeg-extensions","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharapov-outsource%2Fphp-ffmpeg-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharapov-outsource%2Fphp-ffmpeg-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharapov-outsource%2Fphp-ffmpeg-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharapov-outsource%2Fphp-ffmpeg-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharapov-outsource","download_url":"https://codeload.github.com/sharapov-outsource/php-ffmpeg-extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230051322,"owners_count":18165199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate-application","docker","ffmpeg","ffmpeg-script","ffmpeg-wrapper","php","php-ffmpeg","video-processing"],"created_at":"2024-12-17T02:10:13.118Z","updated_at":"2024-12-17T02:10:13.793Z","avatar_url":"https://github.com/sharapov-outsource.png","language":"PHP","readme":"# php-ffmpeg-extensions\nAn extensions library for the PHP FFMpeg (https://github.com/PHP-FFMpeg/PHP-FFMpeg)\n\nInstallation (via Composer):\n============================\n\nFor composer installation, add:\n\n```json\n\"require\": {\n    \"sharapov/php-ffmpeg-extensions\": \"^0.2\"\n},\n```\n\nto your composer.json file and update your dependencies. Or you can run:\n\n```sh\n$ composer require sharapov/php-ffmpeg-extensions\n```\n\nNotes:\n======\n\nTested with ffmpeg 3+, not tested with ffmpeg 4+\n\n\nUsage:\n======\n\nNow you can autoload or use the class via its namespace. Below are examples of how to use the library.\n\nDraw texts and boxes\n--------------------------\n\n```php\n\n// Init FFMpeg library\n$ffmpeg = \\Sharapov\\FFMpegExtensions\\FFMpeg::create(array(\n    'ffmpeg.binaries'  =\u003e '/path/to/ffmpeg', // Path to FFMpeg\n    'ffprobe.binaries' =\u003e '/path/to/ffprobe', // Path to FFProbe\n    'timeout'          =\u003e 3600, // The timeout for the underlying process\n    'ffmpeg.threads'   =\u003e 12,   // The number of threads that FFMpeg should use\n));\n\n// Open source video\n$video = $ffmpeg-\u003eopen( new InputFile( 'source/Coast - 1270.mp4' ) );\n\n// Apply filter options to video\n$video\n  -\u003efilters()\n  -\u003ecomplex( new OptionsCollection( [\n                                      ( ( new FilterComplexOptions\\OptionDrawText() )\n                                        // Set z-index property. Greater value is always in front\n                                        -\u003esetZIndex( 160 )\n                                        // You can use fade-in and fade-out effects. Set time in seconds\n                                        -\u003esetFadeIn( 1 )\n                                        -\u003esetFadeOut( 2 )\n                                        // Set font path\n                                        -\u003esetFontFile( new InputFile( 'source/arial.ttf' ) )\n                                        // Set font color. Accepts transparency value as the second argument. Float value between 0 and 1.\n                                        -\u003esetFontColor( '#ffffff' )\n                                        // Set font size in pixels\n                                        -\u003esetFontSize( 33 )\n                                        // Set text string\n                                        -\u003esetText( 'php-ffmpeg-extensions library' )\n                                        // Coordinates where the text should be rendered. Accepts positive integer or\n                                        // constants \"(w-tw)/2\", \"(h-th)/2\" to handle auto-horizontal, auto-vertical values\n                                        -\u003esetCoordinates( new Coordinate\\Point( Coordinate\\Point::AUTO_HORIZONTAL, 50 ) )\n                                        // Set timings (start, stop) in seconds. Accepts float values as well\n                                        -\u003esetTimeLine( new Coordinate\\TimeLine( 1, 20 ) ) ),\n\n                                      ( ( new FilterComplexOptions\\OptionDrawText() )\n                                        -\u003esetZIndex( 160 )\n                                        -\u003esetFadeIn( 1 )\n                                        -\u003esetFadeOut( 2 )\n                                        -\u003esetFontFile( new InputFile( 'source/arial.ttf' ) )\n                                        -\u003esetFontColor( '#ffffff' )\n                                        -\u003esetFontSize( 28 )\n                                        -\u003esetText( 'Sharapov A. (www.sharapov.biz)' )\n                                        -\u003esetCoordinates( new Coordinate\\Point( 15, 600 ) )\n                                        -\u003esetTimeLine( new Coordinate\\TimeLine( 2, 20 ) ) ),\n\n                                      ( ( new FilterComplexOptions\\OptionDrawBox() )\n                                        -\u003esetZIndex( 130 )\n                                        -\u003esetColor( '000000', 0.6 )\n                                        -\u003esetDimensions( new Coordinate\\Dimension( Coordinate\\Dimension::WIDTH_MAX, 60 ) )\n                                        -\u003esetCoordinates( new Coordinate\\Point( 0, 580 ) ) ),\n\n                                      ( ( new FilterComplexOptions\\OptionDrawText() )\n                                        -\u003esetZIndex( 160 )\n                                        -\u003esetFadeIn( 1 )\n                                        -\u003esetFadeOut( 2 )\n                                        -\u003esetFontFile( new InputFile( 'source/arial.ttf' ) )\n                                        -\u003esetFontColor( '#ffffff' )\n                                        -\u003esetFontSize( 28 )\n                                        -\u003esetText( 'v2.0' )\n                                        -\u003esetCoordinates( new Coordinate\\Point( 1200, 600 ) )\n                                        -\u003esetTimeLine( new Coordinate\\TimeLine( 3, 20 ) ) )\n                                    ] ) );\n\n// Run render\n$format = new \\FFMpeg\\Format\\Video\\X264( 'libmp3lame' );\n$format-\u003eon( 'progress', function ( $video, $format, $percentage ) {\n  echo \"$percentage% transcoded\\n\";\n} );\n\ntry {\n  $video\n    -\u003esave( $format, 'output/output.mp4' );\n  print 'Done!';\n} catch ( ExecutionFailureException $e ) {\n  print $e-\u003egetMessage();\n}\n```\n\nYou will find other examples in \"/examples\" folder.\n\nChangelog\n=========\n\n\nLinks\n=====\n[PHP FFMpeg Homepage](https://github.com/PHP-FFMpeg/PHP-FFMpeg)\n\n[Composer](https://getcomposer.org/)\n\n[GitHub](https://github.com/sharapov-outsource/php-ffmpeg-extensions)\n\n[Packagist](https://packagist.org/packages/sharapov/php-ffmpeg-extensions)\n","funding_links":["https://paypal.me/alexandersharapov"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharapov-outsource%2Fphp-ffmpeg-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharapov-outsource%2Fphp-ffmpeg-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharapov-outsource%2Fphp-ffmpeg-extensions/lists"}