A Laravel integration for Google's Shaka Streamer, enabling you to create adaptive streaming content (HLS, DASH) with Laravel.
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Runs Shaka Streamer from Laravel. It encodes video into several qualities with FFmpeg, then packages them into HLS and DASH streams. Read the source from any Laravel disk, and write the result to any disk.
If your video is already encoded the way you want it, Laravel Shaka packages it without re-encoding, which is much faster.
See the full documentation: Installation, Usage, URL Resolvers, Queues, Encryption, Configuration, Quick Reference, Troubleshooting.
• PHP 8.3 or higher
• Laravel 12 or 13
• Shaka Streamer, with FFmpeg and Shaka Packager檢視完整 README ↗Encode video into several qualities and package it into HLS and DASH with Shaka Streamer, on top of foxws/laravel-media. Read the source from any Laravel disk, and write the result to any disk.
See the full documentation: Installation, Usage, Testing, Configuration, Upgrading from 2.x.
composer require foxws/laravel-streamer
Install Shaka Streamer with its bundled FFmpeg and Shaka Packager, then check the setup:
pip install shaka-streamer shaka-streamer-binaries
php artisan media:info
See Installation to use your own FFmpeg and Shaka Packager instead.
[!TIP] Let your AI agent do the hard parts. This package ships a Laravel Boost skill,
laravel-streamer-development, that teaches your agent how to install, configure and use Laravel Streamer. Install Boost and select the skill when prompted:composer require laravel/boost --dev php artisan boost:installAlready using Boost? Run
php artisan boost:update --discoverto pick up the skill. Then just ask, for example: "Turn uploaded videos into 1080p, 720p and 480p HLS and DASH streams."
use Foxws\Media\Facades\Media;
$result = Media::fromDisk('media')
->open('videos/clip.mp4')
->streamer()
->addStreamsFrom()
->withResolutions('1080p', '720p', '480p')
->withHlsPlaylist()
->withDashManifest()
->toDisk('s3')
->save('streams/clip');
This encodes three qualities, writes one set of segments with both an HLS playlist and a DASH manifest, and uploads them to streams/clip on the s3 disk. Run it in a queued job: encoding takes a while.
Serve private streams with laravel-media's signed playlists:
return Media::fromDisk('s3')->open('streams/clip/master.m3u8')
->hlsPlaylist()
->resolveMediaUrlsUsing(fn (string $path) => Storage::disk('s3')->temporaryUrl($path, now()->addHour()))
->toResponse($request);
composer test
Used by Stry, a self-hosted video streaming app.
AI, specifically Claude, was used to help build this package. All AI-assisted output is reviewed by me, and I retain final say over everything that is implemented and released.
MIT. See License File.