Laravel FFMpeg

FFmpeg integration for Laravel with a fluent API and Filesystem-aware media handling.

Library
Composer
v8.9.0
1,812stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
56/100Fair
Development Activity4
Maintenance44
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture85
Code Quality84
Innovation70
Learning Curve72

Laravel FFMpeg is a friendly wrapper around the PHP-FFMpeg library that integrates FFmpeg-based audio and video processing into Laravel applications. It ties directly into Laravel’s Filesystem, so input and output files can live on any configured disk, local or cloud, without manual path juggling.

It exposes a fluent, expressive API for opening media, applying filters, converting between formats, adding watermarks, concatenating clips, and exporting adaptive HLS streams with encryption. Advanced features like progress monitoring, multiple inputs, and frame extraction are all available through the same chainable interface.

What You Get

  • A fluent MediaOpener/FFMpeg facade API for opening, filtering, and exporting media
  • Deep integration with Laravel’s Filesystem so files can live on local or cloud disks
  • Format conversion, filters, watermarking, concatenation, and frame extraction
  • Adaptive HLS export with multiple bitrates and optional encryption
  • Progress monitoring callbacks and support for multiple inputs and complex filters

Common Use Cases

  • Transcoding uploaded videos into web-friendly formats
  • Generating adaptive HLS streams for video delivery
  • Extracting thumbnails or frames from video files
  • Adding watermarks or applying filters to media before storage

Under The Hood

Architecture - The entry point is src/MediaOpener.php, exposed via a service provider and facade. It resolves files through src/Filesystem/ (bridging Laravel disks to temporary local copies FFmpeg can operate on), wraps the underlying php-ffmpeg/php-ffmpeg driver in src/Drivers/ and src/FFMpeg/, and routes output through src/Exporters/ for standard media and HLS. Filters live in src/Filters/, and src/Http/ adds streaming response helpers. Disk-to-temp-to-disk orchestration is the core value the package adds over raw PHP-FFMpeg.

Tech Stack - PHP 8.2–8.5, built on php-ffmpeg/php-ffmpeg ^1.2 and ramsey/collection, integrating with illuminate/contracts (Laravel 11–13) and League Flysystem for storage. Requires an FFmpeg binary on the host.

Code Quality - A mature codebase (420+ commits, 78 releases since 2016) with an extensive PHPUnit/Testbench suite using snapshot assertions and an in-memory filesystem, plus Mockery. The layered directory structure keeps drivers, exporters, filters, and filesystem concerns well separated.

API Design - The fluent API reads cleanly: FFMpeg::fromDisk('videos')->open('in.mp4')->export()->toDisk('public')->inFormat($format)->save('out.mp4'). HLS, filters, and progress callbacks all chain from the same opener, making common tasks concise while advanced filtergraphs remain reachable.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search