Sulat.com / Writing on AIFriday, November 27, 2026
Developer Tools/27 November 2026

Laravel FFmpeg 9 drops PHP-FFMpeg for a full rewrite, and here’s how to run it

Pascal Baljet's Laravel FFmpeg 9 is a full rewrite that needs PHP 8.4, Laravel 13.44.1 and FFmpeg 9. I ran its encodes, HLS, DASH, queues and signed playback on a real FFmpeg 9 build and wrote the steps.

Red 3D Laravel logo and green 3D FFmpeg logo on a dark surface with a film strip unspooling into three parallel ribbons
Illustration: Sulat, featuring the Laravel and FFmpeg logos

At a glance

  • Pascal Baljet released Laravel FFmpeg 9.0.0 on 25 November, a full rewrite that drops the PHP-FFMpeg library for Laravel's own Process, Storage, queue and HTTP tools, and shipped seven patch releases in about 19 hours.
  • Version 9 needs PHP 8.4, Laravel 13.44.1 and matching FFmpeg and FFprobe binaries at 9.0 or later, and it refuses to run on older binaries unless you switch the version check off.
  • I ran the how-to on Laravel 13.44.1 with a development FFmpeg build that reports 9.0.2: MP4, WebM, MP3, storyboard, GIF, HLS, encrypted HLS, DASH, a parallel queued export and signed playback URLs all worked.
  • The defaults changed, because version 8 encoded H.264 in two passes at 1,000 kb/s while version 9 encodes one pass at CRF 23, so file sizes and quality will differ after an upgrade.
  • I did not test FFmpeg 9.1, GPU encoders, live HLS, watermarks or cloud disks, and I have not seen the package in production.

Laravel FFmpeg, the package that most Laravel apps use to convert video and audio, now has a version 9 that is a full rewrite. Pascal Baljet, who works at Laravel and wrote the package, released 9.0.0 on 25 November. It drops the PHP-FFMpeg library it was built on and uses Laravel’s own Process, Storage, queue and HTTP tools instead.

The release is a breaking upgrade. It needs PHP 8.4, Laravel 13.44.1 and FFmpeg 9.0 or later on the server. I ran the main steps myself on a Laravel 13.44.1 app and a real FFmpeg 9 build, so this piece is a deep dive and a follow-along in one. What I ran, and what I didn’t, is in its own section.

Pascal Baljet on X, 26 November 2026: the announcement.

9.0.0

released 25 November

7

patch releases in about 19 hours

PHP 8.4

and Laravel 13.44.1 or later

FFmpeg 9.0

the oldest build it accepts

The words, in plain terms

You don’t need to know video to follow this. Here are the terms, one at a time.

FFmpeg
A free command-line program that converts audio and video. Almost every video site uses it somewhere. It comes as two programs, ffmpeg to convert and ffprobe to inspect.
Laravel FFmpeg
A PHP package that lets a Laravel app tell FFmpeg what to do in readable code instead of long command strings. It doesn’t contain FFmpeg, so you install that yourself.
Encoder
The part of FFmpeg that squeezes video or audio into a format. libx264 makes H.264 video, which plays almost everywhere. aac makes the matching audio.
CRF
A quality dial for H.264. Lower numbers mean better quality and bigger files. 23 is the encoder’s default.
HLS and DASH
Two ways to stream video as many small pieces, with a playlist that tells the player which piece comes next. The player can switch between a sharp version and a lighter one as your connection changes.
Queue worker
A background process in a Laravel app that picks up slow jobs, such as encoding, so a web request doesn’t have to wait for them.
Signed URL
A web address with a tamper-proof signature. Change one character and the server refuses it.

Here’s a picture of the idea. It’s my own analogy, not from the sources. FFmpeg is a workshop full of machines. The package used to be a foreman who translated your wishes into the workshop’s language through an interpreter, PHP-FFMpeg. Version 9 sacks the interpreter and has the foreman speak the workshop’s language directly.

What changed and why

Until now the package wrapped PHP-FFMpeg, a general PHP library for FFmpeg. Version 9’s upgrade guide says it replaces PHP-FFMpeg with Laravel’s Process, Storage and Http components, and that the old builders, format objects, driver forwarding and filter factories are gone. Composer no longer installs php-ffmpeg/php-ffmpeg unless your app asks for it directly.

Two stacks: version 8 sits on PHP-FFMpeg and FFmpeg; version 9 sits on Laravel Process, Storage and queues and FFmpeg, with one layer gone
Version 9 removes PHP-FFMpeg from the stack and leans on Laravel’s own parts.

The day-to-day change is the code you write. In version 8 you built a format object and chained a filter. In version 9 you name the encoder and pass settings as plain arguments, so one chain does the same job.

Hand-drawn comparison: version 8 builds a format object, a filter and a save call; version 9 chains resize, video, audio and save in one call
The same 720p MP4 now takes one chained call, with no format object.
Illustration of a machine labelled Name the encoder, feeding one video into three outputs: MP4, WebM and MP3
In version 9 you name the encoder and pass FFmpeg’s settings as plain arguments.

The release also adds things the old stack didn’t have. The README lists a storyboard builder for scrubbing thumbnails, HLS and DASH exports, protected HLS playback with signed URLs, parallel queued exports, loudness and waveform tools, and a php artisan ffmpeg:doctor command that checks your FFmpeg build. Failures now throw a MediaException with a category such as version, encoder or input and FFmpeg’s own error output attached.

Baljet says he built it with AI help. In replies on X he said agents triaged every open issue and ran each scenario against specific FFmpeg builds in Amp’s Orbs, and that he was accepted into the Claude Open Source programme on 18 November for his Laravel packages. I haven’t audited that claim, but the patch run is consistent with fast iteration: 9.0.1 to 9.0.7 landed within about 19 hours, and the notes describe edge cases such as JPEG cover art and watermarks over 2 KB, external subtitle files in HLS renditions, odd-sized still images and very long filter graphs.

Starting from scratch with the ideal API in mind used to feel like a luxury.

Pascal Baljet on X, 26 November 2026

The package is widely used. Baljet says downloads run into the millions, and the trackers I checked list roughly 6.2 to 6.5 million, with about 1,800 GitHub stars. That is why a breaking rewrite matters: a lot of Laravel apps convert uploads with it.

How to use it, step by step

These steps assume a Laravel 13 app and a Linux or macOS machine where you can install FFmpeg. Every code block below is one I ran, except where I say otherwise.

1. Check four things first

Checklist of four checks: PHP 8.4 or later, Laravel 13.44.1 or later, ffmpeg and ffprobe 9.0 or later, then run the ffmpeg:doctor command
Check PHP, Laravel and FFmpeg versions first, then let ffmpeg:doctor confirm.
Code
php -v
composer show laravel/framework
ffmpeg -version
ffprobe -version

You need PHP 8.4 or later, Laravel 13.44.1 or later, and both FFmpeg programs at 9.0 or later, from the same release. Ubuntu’s own package won’t do: the one on my machine was 6.1.1, and the package refused it (see pitfalls).

2. Install the package

Code
composer require pbmedia/laravel-ffmpeg

Run it with PHP 8.4. On my default PHP 8.3, Composer quietly installed 8.10.0, the last 8.x release, with no error. Check the installed version with composer show pbmedia/laravel-ffmpeg. On PHP 8.4 I got 9.0.7.

3. Point it at FFmpeg 9 and run the doctor

Code
# .env
FFMPEG_BINARIES=/usr/local/bin/ffmpeg
FFPROBE_BINARIES=/usr/local/bin/ffprobe
Code
php artisan ffmpeg:doctor --encoder=libx264 --muxer=dash --filter=scale

The command prints the versions it found and how many encoders, muxers and filters your build has, and exits with an error if something you asked for is missing. On my build it reported 9.0.2 for both programs, 229 encoders, 185 muxers and 564 filters, and one warning about my queue settings (see pitfalls). Add --json for machine-readable output.

4. Make your first encode

Code
use ProtoneMedia\LaravelFFMpeg\Support\FFMpeg;

$result = FFMpeg::open('uploads/lesson.mp4')
    ->export()
    ->resize(width: 1280)
    ->video('libx264', crf: 23)
    ->audio('aac', bitrate: '128k')
    ->save('out/720p.mp4');

$result->files(); // what was written

open() reads from your default Laravel disk. Use FFMpeg::disk('uploads')->open(...) for another one, and ->toDisk('videos') before save() to write somewhere else. To see the FFmpeg command without running it, call inspect() instead of save(). Mine printed, among other flags, -c:v libx264 -crf:v 23 -pix_fmt:v yuv420p -filter:v scale=w=1280:h=-2:reset_sar=1 -c:a aac -b:a 128k -fps_mode:v passthrough. That last flag is FFmpeg 9’s replacement for the removed -vsync.

5. Other formats, progress and copying

Code
$media = FFMpeg::open('uploads/lesson.mp4');

$media->export()
    ->video('libvpx-vp9', crf: 31)
    ->audio('libopus', bitrate: '128k')
    ->videoOptions(['-row-mt', '1'])
    ->save('out/lesson.webm');

$media->export()
    ->audio('libmp3lame', bitrate: '192k')
    ->save('out/lesson.mp3');

$media->export()
    ->resize(width: 640)
    ->video('libx264', crf: 28)
    ->audio('aac')
    ->onProgress(function ($progress) {
        // $progress->percentage can be null
    })
    ->save('out/640.mp4');

To change only the container, pass copy to both video() and audio(). I didn’t run that one. The progress callback fired eight times on my 12-second clip, and the last call’s percentage was null, so don’t assume a number.

6. Thumbnails, a storyboard and a GIF

Code
$media->storyboard(every: 3, columns: 2, rows: 2)
    ->resize(width: 160)
    ->vtt('out/cues/lesson.vtt')
    ->save('out/sheets/lesson-%03d.jpg');

$media->gif(width: 480, frameRate: 12)
    ->clip(4, duration: 3)
    ->save('out/clip.gif');

A storyboard is a sheet of small frames plus a text file that tells a video player which frame to show as you drag along the timeline. Mine produced one 2 by 2 sheet and a four-cue file, three seconds apart.

7. Stream with HLS, or DASH

Code
use ProtoneMedia\LaravelFFMpeg\HlsVariant;

$result = FFMpeg::open('uploads/lesson.mp4')
    ->hls(segmentDuration: 4)
    ->variant('360p', fn (HlsVariant $v) => $v
        ->resize(height: 360)
        ->video('libx264', bitrate: '800k'))
    ->variant('720p', fn (HlsVariant $v) => $v
        ->resize(height: 720)
        ->video('libx264', bitrate: '2500k'))
    ->save('streams/lesson/master.m3u8');

Note that hls() hangs off the opened media, not off export(). I got that wrong the first time. The run wrote nine files: a master playlist, a playlist and three segments for each size. The master listed both sizes with RESOLUTION and CODECS attributes, which is what players read to choose a version.

Code
$result = FFMpeg::open('uploads/lesson.mp4')
    ->dash(segmentDuration: 2)
    ->adaptationSet('picture', 'video')
    ->adaptationSet('sound', 'audio')
    ->representation('low', 'picture', fn ($v) => $v
        ->map('0:v:0')->resize(width: 640)->video(bitrate: '800k'))
    ->representation('high', 'picture', fn ($v) => $v
        ->map('0:v:0')->video(bitrate: '2500k'))
    ->representation('audio', 'sound', fn ($a) => $a
        ->map('0:a:0')->audio(bitrate: '128k'))
    ->sharedHls()
    ->toDisk('streams')
    ->save('dash/manifest.mpd');

That wrote 26 files: the manifest, an HLS master that shares the same segments, and init and segment files for each representation. The README says DASH supports finite, clear H.264 or VP9 video with AAC audio, and not live streams, two-pass, encryption or DRM.

8. Encrypt the stream and protect playback

Code
// config/filesystems.php: define 'streams' and 'secrets' disks first
$result = FFMpeg::open('uploads/lesson.mp4')
    ->hls(segmentDuration: 4)
    ->variant('360p', fn (HlsVariant $v) => $v
        ->resize(height: 360)
        ->video('libx264', bitrate: '800k'))
    ->encrypt('secrets',
        fn (string $keyPath) => 'https://example.test/keys/'.basename($keyPath),
        rotateEvery: 3, directory: 'lessons/42/keys')
    ->toDisk('streams')
    ->save('lessons/42/master.m3u8');

$lesson->hls_playback = $result->playback()->toArray();
$lesson->save();

The segment playlist then carried #EXT-X-KEY:METHOD=AES-128 lines pointing at my key URL. My key URL was a placeholder. In a real app the callback should return a route that serves the key only to people allowed to watch.

Code
// AppServiceProvider::boot()
Route::model('lesson', Lesson::class);

Hls::define('lesson',
    resolve: fn (Lesson $lesson) => HlsPresentation::fromArray($lesson->hls_playback),
    authorize: fn (Lesson $lesson) => Gate::authorize('view', $lesson),
);

// routes/web.php
Hls::routes('/lessons/{lesson}/hls', name: 'lessons.hls', playback: 'lesson');

// in a controller that has already authorised the user
$url = Hls::url('lessons.hls', ['lesson' => $lesson], expires: now()->addMinutes(10));
Illustration of a signed link opening a gate, with a second checkpoint labelled your rules behind it, for protected video playback
Every playlist, segment and key gets a signed URL, and your authorize callback runs on each request.

I tested this with the route’s middleware set to ['web'], so the signed link alone was the credential, and my own gate and model binding. The entry URL returned 200 with the HLS content type, the child playlist it pointed to returned 200, and the same URL with its signature altered returned 403. The README’s default is the web and auth middleware, and it warns that a guest hitting that default gets a 500 unless your app defines a login route. I didn’t reproduce that. This is access control around video, not DRM: anyone allowed to watch can still save the stream.

9. Move encoding to the queue, in parallel

Code
FFMpeg::open('uploads/lesson.mp4')
    ->hls(segmentDuration: 4)
    ->variant('360p', fn (HlsVariant $v) => $v
        ->resize(height: 360)->video('libx264', bitrate: '800k'))
    ->variant('720p', fn (HlsVariant $v) => $v
        ->resize(height: 720)->video('libx264', bitrate: '2500k'))
    ->toDisk('streams')
    ->queued(queue: 'conversions', parallel: true)
    ->save('queued/master.m3u8');
One video fans out to 360p, 720p and more variant jobs on separate queue workers, then a final job writes the master playlist
Each HLS variant gets its own job, and the last job writes the master playlist.

With parallel: true, each variant is a job in a Laravel batch, so your queue needs the batch tables and every worker needs the same disks, binaries and app key. On the database queue, one worker ran four jobs with none failed: a batch job, one job per variant and a finalizer. The finished master was not at the path I asked for. It was queued/master.<version>.m3u8, and the README says to read the real path from the QueuedExportCompleted event. My listener ran in the dispatching process, not the worker, so I didn’t capture that event.

Illustration of several idle workers all picking up pieces of one video job, captioned Idle workers all help
With parallel: true, each HLS variant encodes on its own queue worker.

10. Optional: let your AI coding tool learn the package

The package ships guidelines and a developing-laravel-ffmpeg skill for Laravel Boost. Install Boost, run php artisan boost:install in a terminal, and later php artisan boost:update --discover. I didn’t run Boost.

I ran it

I ran everything on Laravel 13.44.1 and PHP 8.4 with Laravel FFmpeg 9.0.7. For FFmpeg I used a public static build from the BtbN project, a development snapshot built on 26 November whose version string is n9.0.2-982-g836df4e858-20261126. The package’s check read that as 9.0.2 and accepted it. The input was a 12-second, 1080p test-pattern clip with a sine tone, 9.3 MB. A test pattern isn’t real footage, so treat the sizes and times as a sanity check, not a benchmark.

StepWhat happened
ffmpeg:doctorPassed, 9.0.2 for both programs, one queue warning
720p MP41280 by 720 H.264, 2.5 MB, 3.3 s
WebM, VP9 and OpusWorked, 10.5 MB, 45 s, by far the slowest step
MP3Worked, 290 KB, 0.2 s
Progress and inspect()Eight callbacks, last percentage null; command printed
Storyboard and GIFOne sheet and four cues; a 480 px, 3-second GIF of 481 KB
HLS, two sizesNine files, master with resolution and codecs
Encrypted HLSWorked once the disks existed, AES-128 key lines in the playlist
DASH with shared HLS26 files
Parallel queued HLSFour jobs, none failed, versioned master name
Signed playbackEntry 200, child playlist 200, altered signature 403
My runs on 27 November 2026 NZ time, one run each.

What I did not run: FFmpeg 9.1 or any tagged FFmpeg release, GPU encoders, live HLS, watermarks (they need intervention/image 4.2), concatenation, loudness and audio mixing, S3 or other cloud disks, playback in a real video player, and the Boost skill. I also didn’t time version 8, so I can’t say whether version 9 is faster.

Pitfalls

  • Old FFmpeg is refused. With Ubuntu’s packaged build, ffmpeg:doctor exited 1 with “FFmpeg 9.0 or later is required, but the configured binary reports version [6.1.1-3ubuntu5].” Setting FFMPEG_VERIFY_VERSION=false skips the check, but the README says only releases the check accepts are supported.
  • Composer can hand you version 8. On PHP 8.3 it installed 8.10.0 without complaint.
  • Quality and size change on upgrade. Per the upgrade guide, version 8’s X264 format encoded in two passes at 1,000 kb/s video and 128 kb/s audio. Version 9’s video('libx264') is one pass at CRF 23. To match the old behaviour, pass both bitrates and call twoPass().
  • A vague error for a missing disk. My first encrypted run failed with “Cannot publish the media output.” I hadn’t defined the secrets disk. After I added that and a streams disk it passed. I changed both at once, so the secrets disk is the likelier cause, not a proven one.
  • Method placement. hls() and dash() come from the opened media, and adaptationSet() takes a name and a type, not a closure. Both of those were my mistakes, and one run showed a clear TypeError for the second.
  • Queue timing. The doctor warned that my database queue’s retry_after of 90 seconds must exceed the job timeout of 3,630. If it doesn’t, a long encode can be picked up twice.
  • No command log. Version 9 logs no FFmpeg commands. Record inspect() output before save(), or read $result->processes() afterwards.
  • Treat uploads as hostile. This one is my advice, not the package’s. A security news site, BeyondMachines, reported on 25 November that FFmpeg 9.1 fixed 12 memory-corruption flaws present in every earlier version, which includes the 9.0.2 that the package’s tests use. Keep FFmpeg patched and run encodes on workers with few privileges.

Upgrading from version 8

My view: new projects on PHP 8.4 and Laravel 13.44.1 should start on version 9. If you’re on version 8 and it works, there’s no rush. 8.10.0 arrived on 21 November, and the version 8 docs stay on the 8.x branch. The upgrade guide rates the work as breaking, with high impact on opening media, format objects, filters and clipping, and HLS.

Version 8Version 9
fromDisk('uploads')disk('uploads')
inFormat(new X264)video('libx264', bitrate: '1000k')->audio('aac', bitrate: '128k')->twoPass()
new Mp3audio('libmp3lame', bitrate: '128k')
new CopyFormatvideo('copy')->audio('copy')
each([1, 4, 7], ...)A plain foreach over one opened media
log_channel configRemoved; no commands are logged
Watermark images via spatie/imageintervention/image 4.2 or later
Selected mappings from the version 9 upgrade guide.

The wider picture

FFmpeg itself moved quickly. FFmpeg 9.0 “Lei” arrived in August, and FFmpeg 9.1 “Gauss” was released on 20 November as source code. A transcoding vendor’s blog says FFmpeg 9 hard-removed options such as -vsync, -top, -qphist and -filter_complex_script, which is the sort of change that breaks hand-written command strings. The package’s inspect() output already uses the newer -fps_mode.

OptionWhat it isSource
Laravel FFmpeg 9Laravel-native, Process-based, FFmpeg 9 or later onlyREADME, upgrade guide
Laravel FFmpeg 8.xWraps PHP-FFMpeg; latest 8.10.0GitHub releases
PHP-FFMpegFramework-neutral library; v1.4.0 in January added PHP 8.5, released by Baljet; about 5,000 starsGitHub
Calling ffmpeg yourselfFull control, and you own every flag across FFmpeg upgradesVendor blog, 11 November
Hosted transcoding APISomeone else runs FFmpeg; one vendor says a token buys 10 seconds of input videoThat vendor’s blog, 1 November
The hosted-API figures come from a vendor that sells one, so read them as its pitch.

Baljet is busy elsewhere too. On 24 November he released Inertia Notifications, a free MIT package from his Inertia UI line, and he says he is rethinking pricing for his other packages.

What isn’t known

  • Whether FFmpeg 9.1 works. The version check says 9.0 or later, the package’s tests use 9.0.2, and I haven’t run 9.1.
  • How version 9 compares with version 8 on speed or file size on real footage. I measured neither.
  • Whether anyone runs version 9 in production yet. The download counts I found belong to version 8.
  • How much the AI-assisted triage shaped the release. That account is Baljet’s, and I haven’t checked it.
  • The exact release date. His blog post is dated 25 November, GitHub shows 19:55 UTC that day, and his X post is dated 26 November.

Sources: Pascal Baljet’s blog post and X posts (25 and 26 November 2026); the Laravel FFmpeg 9.x README, UPGRADE.md, composer.json and release notes; Packagist and GitHub release pages; ffmpeg.org download and security pages; 9to5Linux and Phoronix on FFmpeg 9.1; BeyondMachines (25 November 2026); FFmpeg Micro’s blog (1 and 11 November 2026); the PHP-FFMpeg GitHub releases. Tests were run on 27 November 2026 NZ time.


Discover more from Sulat AI & Tech News

Subscribe to get the latest posts sent to your email.