Install Shaka Packager and prepare fragmented fMP4 inputs (or pass raw MP4; Shaka will fragment automatically)
Specify input streams with stream descriptors (e.g., 'in=input.mp4,stream=video,output=video.mp4') for each quality level and audio track
Enable CENC encryption with --enable_raw_key_encryption (or --enable_widevine_encryption for Widevine key server), supply --keys with label:key_id:key, and list protection systems (Widevine, PlayReady, FairPlay, CommonSystem)
Add --hls_master_playlist_output and --mpd_output flags to produce both manifests in a single pass; add --cmaf to emit CMAF-compatible output
Set --clear_lead to a small non-zero value (e.g., 1 second) if players need a brief unencrypted window to initialize before decryption keys are available
Known gotchas
Shaka Packager does not support partial encrypted segments — any segment overlapping the clear_lead window remains fully unencrypted, which can expose more content than intended
When targeting FairPlay, the key_id byte order must be swapped compared to Widevine/PlayReady due to FairPlay's little-endian key ID convention — use the --hls_key_uri flag to supply a matching EXT-X-KEY URI
Running multiple Shaka Packager instances against the same output directory without coordinating segment names causes MPD/playlist corruption; use unique output prefixes per job
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp