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.
proc_open command construction with a fluent API (Stream::input()->streamSelector()->output(), ->mediaPackaging()->DASH('out.mpd'))..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.DASHRoles() and defaultLanguage()/defaultTextLanguage() map directly to monetization and localization requirements (multi-audio, multi-subtitle catalogs) rather than being nice-to-haves.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.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.Adopt when most of these are true:
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.timeout (default example: 3600s), which means long-running workers and a queue that is not shared with latency-sensitive jobs.Look elsewhere when:
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):
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.streamSelector and output are required).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.
How can I help you explore Laravel packages today?