Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Shaka Laravel Package

aminyazdanpanah/php-shaka

PHP library that wraps Shaka Packager for DASH and HLS packaging and encryption, with Common Encryption support for Widevine, PlayReady, and raw key DRM. Includes live streaming and ad insertion examples.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for the video pipeline. The real decision here is not "should we adopt a PHP package" — it is "do we operate Shaka Packager (Google's open-source CLI) ourselves, or pay a managed video vendor?" This wrapper is the cheapest credible way to test the self-hosted path: MIT-licensed, Composer-installable, and it replaces hand-rolled proc_open command construction with a fluent API (Stream::input()->streamSelector()->output(), ->mediaPackaging()->DASH('out.mpd')).
  • DRM tier as a monetization gate. The package exposes Common Encryption (CENC) with Widevine, PlayReady, and raw-key options. That is the technical prerequisite for premium/paid tiers, studio-licensed catalog, offline downloads, and anything requiring anti-ripping. If a revenue model depends on protected content, this is the go/no-go capability.
  • Format coverage roadmap. One integration produces both DASH (.mpd) and HLS, plus low-latency DASH via generateStaticLiveMpd(), minimumUpdatePeriod(), suggestedPresentationDelay(), and utcTimings(). This de-risks the "do we need LL-DASH for sports/live betting/auction use cases?" question without a second vendor contract.
  • Ad-supported / FAST business models. Ad insertion support plus DASHRoles() and defaultLanguage()/defaultTextLanguage() map directly to monetization and localization requirements (multi-audio, multi-subtitle catalogs) rather than being nice-to-haves.
  • Engagement features. trickPlayFactor() enables seek-preview thumbnail tracks; bandwidth() lets you control manifest-declared bitrates for player ABR decisions; preservedSegmentsOutsideLiveWindow() and timeShiftBufferDepth() scope DVR/catch-up features for live events.
  • Ingest QA and content ops. mediaFileAnalysis() returns a StreamCollection you can inspect before accepting an upload — codec, stream inventory, and packaging viability checks inside the existing PHP app instead of a separate toolchain.
  • Scope clarity for planning (important): this package packages and encrypts; it does not transcode. Renditions must already exist (from FFmpeg, a transcoding vendor, or per-title encoding). Any roadmap item assuming "this gives us adaptive bitrate" needs a companion encoding decision.

When to Consider This Package

Adopt when most of these are true:

  • You are already a PHP/Laravel shop and want packaging to live in the same deployable, queue, and storage layer as the rest of the app — not a separate Python/Node/Go service.
  • You need both DASH and HLS, and/or CENC multi-DRM, from a single tool. If you only need HLS for simple VOD, FFmpeg alone is a smaller dependency.
  • You can operate a container with the Shaka Packager binary (Docker image or prebuilt binary on PATH), including pinning versions and health-checking the binary's presence. The library shells out; a missing binary is a runtime failure, not an install-time one.
  • Volume is modest-to-moderate and packaging can run as a dedicated queued job — note the configurable timeout (default example: 3600s), which means long-running workers and a queue that is not shared with latency-sensitive jobs.
  • You accept fork-and-own risk. With ~91 stars, zero dependents, and a Travis/AppVeyor-era CI badge, this is effectively a single-maintainer thin wrapper. Mitigate by vendoring/forking the command-builder, which is small and readable ("self-documented" per the README), and by treating the Shaka Packager version — not the PHP package — as the thing you track for CVEs and features.
  • You want to publish DRM-encrypted output but keep key management in-house (Widevine/PlayReady key server or raw key), rather than hand keys to a vendor.

Look elsewhere when:

  • You have no appetite for operating binaries or DRM key infrastructure. Widevine and PlayReady are licensed ecosystems with commercial/legal obligations; a managed DRM vendor (or a vendor with DRM included) removes that from your roadmap entirely.
  • You need encoding, per-title ladders, thumbnail sprites, or subtitle conversion — those are out of scope here and will need FFmpeg or a transcoding service anyway.
  • You need a support SLA, an actively maintained PHP 8.x-first dependency tree, or documented security response. PHP 7.2+ is the stated floor; the CI badges suggest the project's modernization posture is behind current frameworks.
  • Your packaging volume is high enough to need distributed/parallel packaging with retries and backpressure — a managed service or a purpose-built media microservice will be cheaper to operate than a PHP wrapper on a queue.
  • You are on a stack where a native media service already exists (Node/Go/Python) — introducing a PHP-only wrapper duplicates capability.
  • You require compliance artifacts (SOC 2, DPA, vendor security questionnaires) for the media path.

How to Pitch It (Stakeholders)

For executives (one paragraph): We can add DASH + HLS packaging with Widevine/PlayReady encryption for premium content without a managed video vendor contract, using a free, MIT-licensed library that plugs into our existing PHP codebase. It is a thin, easily replaceable layer over Google's open-source Shaka Packager, so lock-in is low and the option is reversible. The trade-off is operational: we must run and monitor a packager binary in our containers and own DRM key-server integration. Recommended next step is a two-week spike on one title — not a platform-wide commitment — to validate packaging quality, DRM playback on our target devices, and job runtime before it enters the roadmap.

For engineering (the ask):

  • Spike scope: one 3-rendition asset → DASH + HLS, then the same asset encrypted with a test key; verify playback on web (shaka-player/hls.js) and one mobile target.
  • Integration shape: a Laravel service class wrapping Shaka::initialize([...]) plus a queued job per packaging request; dedicated queue and worker with a generous timeout; output written to the storage disk, not local temp.
  • Infrastructure: pinned Shaka Packager version baked into the image; startup health check for the binary; explicit failure surfacing when the binary is absent or a stream is misconfigured (streamSelector and output are required).
  • Ownership: fork the package if upstream stalls; the command builder is small. Track Shaka Packager releases as the primary upgrade axis.
  • Known constraints to design around: no transcoding (renditions must pre-exist), PHP 7.2-era baseline to verify against our runtime, and DRM licensing handled as a separate workstream.

Open decisions this surfaces for the roadmap: (1) self-hosted packaging vs. managed vendor; (2) DRM as a paid-tier gate now vs. later; (3) live/LL-DASH investment given the ad-insertion and DVR options are already available; (4) whether a companion encoding strategy is funded alongside packaging.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log