Description
This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files
Convert an audio or video file:
FFMpeg::fromDisk('songs') ->open('yesterday.mp3') ->export() ->toDisk('converted_songs') ->inFormat(new \FFMpeg\Format\Audio\Aac) ->save('yesterday.aac');
Instead of the fromDisk() method you can also use the fromFilesystem() method, where $filesystem is an instance of Illuminate\Contracts\Filesystem\Filesystem.
$media = FFMpeg::fromFilesystem($filesystem)->open('yesterday.mp3');
Progress monitoring
You can monitor the transcoding progress. Use the onProgress method to provide a callback, which gives you the completed percentage. In previous versions of this package you had to pass the callback to the format object.
FFMpeg::open('steve_howe.mp4') ->export() ->onProgress(function ($percentage) { echo "{$percentage}% transcoded"; });
The callback may also expose $remaining (in seconds) and $rate:
FFMpeg::open('steve_howe.mp4') ->export() ->onProgress(function ($percentage, $remaining, $rate) { echo "{$remaining} seconds left at rate: {$rate}"; });
Recent Courses on Laravel Daily
AI Agents/IDEs for Laravel: May 2026 (Claude Code, Codex, OpenCode, etc)
7 lessons
52 min
Laravel 13 Eloquent: Expert Level
41 lessons
1 h 34 min
How to Structure Laravel 13 Projects
16 lessons
1 h 32 min read