Video · HLS/DASH · Shaka Packager
Laravel Shaka
Package already-encoded video into HLS and DASH with Shaka Packager, including DRM and live DASH. Read from any Laravel disk, and write to any disk.
- Latest release
- 3.0.1
- Requires
- PHP ^8.4
- Laravel
- 13.x
- Runtime
- Shaka Packager, foxws/laravel-media
- Licence
- MIT
- Downloads
- 788/mo
Introduction
This package runs Shaka Packager from Laravel. It turns video and audio files into HLS and DASH streams.
It's an add-on for foxws/laravel-media: it adds a shaka driver to laravel-media's packaging builder. You open media with laravel-media, and shaka() packages it:
use Foxws\Media\Facades\Media;
Media::fromDisk('media')
->open('videos/clip.mp4')
->shaka()
->addStreamsFrom()
->withHlsPlaylist()
->withDashManifest()
->toDisk('s3')
->save('streams/clip');
What it does, and what it doesn't
Shaka Packager packages. It cuts already-encoded video into segments and writes the playlists that players read. It does not re-encode, so it's fast, and the output is about the same size as the input.
To get several qualities, encode them first with laravel-media's rendition ladder, then add each file as a stream.
laravel-media's own native packager needs only FFmpeg. Use Shaka Packager when you need what the native packager doesn't do: cbcs encryption for Safari, key rotation, a clear lead, Widevine and PlayReady, live and low-latency DASH, or several audio streams.
Features
- Every packaging feature of laravel-media: any Laravel disk for input and output, DASH and HLS from the same segments, AES encryption with a generated key, signed playlists with
DynamicHLSPlaylistandDynamicDASHManifest, concurrent S3 uploads, events and temporary file cleanup. - Shaka Packager's own options as typed methods with
ShakaOptions: DRM systems, Widevine and PlayReady key servers, live DASH, base URLs and segment numbering. Media::fake()in tests, withFakeShakawriting placeholder outputs.
Requirements
- PHP 8.4 or higher
- Laravel 13
- foxws/laravel-media 0.3.4 or higher
- The Shaka Packager binary
Let your AI agent do the hard parts. This package ships a Laravel Boost skill, laravel-shaka-development, that teaches your agent how to install, configure and use Laravel Shaka. Install Boost and select the skill when prompted:
composer require laravel/boost --dev
php artisan boost:install
Already using Boost? Run php artisan boost:update --discover to pick up the skill. Then just ask, for example: "Package my encoded videos into HLS and DASH with cbcs encryption."
