gauravgpil / php-video-automator
A standalone PHP library to automatically generate videos from text scripts using FFMPEG, AI images, and stock footage.
v1.3.95
2026-08-09 15:21 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.8
- php-ffmpeg/php-ffmpeg: ^1.2
- symfony/process: ^6.0|^7.0
Requires (Dev)
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.3.95
- v1.3.94
- v1.3.93
- v1.3.92
- v1.3.91
- v1.3.90
- v1.3.89
- v1.3.88
- v1.3.87
- v1.3.86
- v1.3.85
- v1.3.84
- v1.3.83
- v1.3.82
- v1.3.81
- v1.3.80
- v1.3.79
- v1.3.78
- v1.3.77
- v1.3.76
- v1.3.75
- v1.3.74
- v1.3.73
- v1.3.72
- v1.3.71
- v1.3.70
- v1.3.69
- v1.3.68
- v1.3.67
- v1.3.66
- v1.3.65
- v1.3.64
- v1.3.63
- v1.3.62
- v1.3.61
- v1.3.60
- v1.3.59
- v1.3.58
- v1.3.57
- v1.3.56
- v1.3.55
- v1.3.54
- v1.3.53
- v1.3.52
- v1.3.51
- v1.3.50
- v1.3.49
- v1.3.48
- v1.3.47
- v1.3.46
- v1.3.45
- v1.3.44
- v1.3.43
- v1.3.42
- v1.3.41
- v1.3.40
- v1.3.39
- v1.3.38
- v1.3.37
- v1.3.36
- v1.3.35
- v1.3.34
- v1.3.33
- v1.3.32
- v1.3.31
- v1.3.30
- v1.3.29
- v1.3.28
- v1.3.27
- v1.3.26
- v1.3.25
- v1.3.24
- v1.3.23
- v1.3.22
- v1.3.21
- v1.3.20
- v1.3.19
- v1.3.18
- v1.3.17
- v1.3.16
- v1.3.15
- v1.3.14
- v1.3.13
- v1.3.12
- v1.3.11
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
This package is auto-updated.
Last update: 2026-10-18 10:46:27 UTC
README
A standalone PHP library to automatically generate videos from text scripts using FFMPEG, AI images, and stock footage. Built exactly to avoid per-generation costs of 3rd party AI video services.
Features
- AI Image-Based Videos (Idea 1): Splits a script into chunks, generates AI images for each chunk, adds Ken-Burns/zoompan animations, overlays captions, and stitches them into a full MP4.
- Stock Footage Videos (Idea 2): Parses a script to fetch relevant stock videos from Pixabay, randomly selects varied clips to avoid repetition, standardizes formats, and stitches them together seamlessly.
Installation
composer require gauravgpil/php-video-automator
Note: You must have ffmpeg installed on your server system.
Usage
Setup
Note: wikimedia and archive providers are 100% free and do not require API keys!
use PhpVideoAutomator\VideoAutomator; $config = [ 'ffmpeg_path' => '/usr/bin/ffmpeg', // Optional, defaults to 'ffmpeg' 'ai_image_api_key' => 'sk-your-openai-key', 'pixabay_api_key' => 'your-pixabay-key', 'pexels_api_key' => 'your-pexels-key', 'coverr_api_key' => 'your-coverr-key', ]; $automator = new VideoAutomator($config);
Idea 1: Text to AI Images to Video
$automator->fromImages() ->setScript("Welcome to our AI channel. Today we learn about the future.") ->generateImages() // Uses OpenAI by default ->addAnimation('ken-burns') ->withCaptions(true) ->export('/var/www/output_ai_video.mp4');
Idea 2: Script to Stock Video (Pixabay, Pexels, Coverr, Wikimedia, Archive)
$automator->fromStockVideos() ->setScript("Beautiful waterfalls and lush green nature forests.") ->fetchStockVideos('wikimedia', '', ['randomize' => true, 'count' => 3]) ->addTransitions('fade') ->export('/var/www/output_stock_video.mp4');
Testing
Run tests via PHPUnit:
vendor/bin/phpunit