$stream_audio = DRMStream::input('video_360p.mp4')
->streamSelector('audio')
->initSegment('audio_1.m4s')
->segmentTemplate('audio_$Number$.m4s')
->drmLabel('AUDIO');
$stream_360 = DRMStream::input('video_360p.mp4')
->streamSelector('video')
->initSegment('sd_0_1.m4s')
->segmentTemplate('sd_0_$Number$.m4s')
->drmLabel('SD');
$stream_480 = DRMStream::input('video_480p.mp4')
->streamSelector('video')
->initSegment('sd_1_1.m4s')
->segmentTemplate('sd_1_$Number$.m4s')
->drmLabel('SD');
$stream_720 = DRMStream::input('video_720p.mp4')
->streamSelector('video')
->initSegment('hd_1.m4s')
->segmentTemplate('sd_$Number$.m4s')
->drmLabel('HD');
$export = Shaka::initialize()
->streams($stream_audio, $stream_360, $stream_480, $stream_720)
->mediaPackaging()
->DRM('raw', function ($options) {
return $options
->keys('label=AUDIO:key_id=f3c5e0361e6654b28f8049c778b23946:key=a4631a153a443df9eed0593043db7519,label=SD:key_id=abba271e8bcf552bbd2e86a434a9a5d9:key=69eaa802a6763af979e8d1940fb88392,label=HD:key_id=6d76f25cb17f5e16b8eaef6bbf582d8e:key=cb541084c99731aef4fff74500c12ead');
})
->DASH('dash_stream.mpd', function ($options) {
return $options
->baseUrls('http://localhost:3700')
// ->utcTimings() #help wanted here
->segmentDuration(10);
})
->export();