{"action":"created","issue":{"url":"https://api.github.com/repos/gpac/gpac/issues/454","repository_url":"https://api.github.com/repos/gpac/gpac","labels_url":"https://api.github.com/repos/gpac/gpac/issues/454/labels{/name}","comments_url":"https://api.github.com/repos/gpac/gpac/issues/454/comments","events_url":"https://api.github.com/repos/gpac/gpac/issues/454/events","html_url":"https://github.com/gpac/gpac/issues/454","id":140903558,"number":454,"title":"mp4box generates incorrect element order in DASH manifest for encrypted adaptation set","user":{"login":"sandersaares","id":9914262,"avatar_url":"https://avatars.githubusercontent.com/u/9914262?v=3","gravatar_id":"","url":"https://api.github.com/users/sandersaares","html_url":"https://github.com/sandersaares","followers_url":"https://api.github.com/users/sandersaares/followers","following_url":"https://api.github.com/users/sandersaares/following{/other_user}","gists_url":"https://api.github.com/users/sandersaares/gists{/gist_id}","starred_url":"https://api.github.com/users/sandersaares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandersaares/subscriptions","organizations_url":"https://api.github.com/users/sandersaares/orgs","repos_url":"https://api.github.com/users/sandersaares/repos","events_url":"https://api.github.com/users/sandersaares/events{/privacy}","received_events_url":"https://api.github.com/users/sandersaares/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gpac/gpac/labels/dash","name":"dash","color":"5319e7"},{"url":"https://api.github.com/repos/gpac/gpac/labels/mp4box","name":"mp4box","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-15T08:14:47Z","updated_at":"2016-03-15T20:17:03Z","closed_at":null,"body":"When I use latest mp4box (0.6.2-DEV-rev56-g30c5f14-master) to package CENC encrypted mp4 files, the generated presentation manifest contains the following:\r\n\r\n```\r\n<AdaptationSet segmentAlignment=\"true\" maxWidth=\"1920\" maxHeight=\"1080\" maxFrameRate=\"30\" par=\"16:9\" lang=\"und\">\r\n\t\t\t<SegmentTemplate timescale=\"30\" media=\"$RepresentationID$/$Number%04d$.m4s\" startNumber=\"1\" duration=\"120\" initialization=\"$RepresentationID$/init.mp4\" />\r\n\t\t\t<ContentProtection schemeIdUri=\"urn:mpeg:dash:mp4protection:2011\" value=\"cenc\" cenc:default_KID=\"7a4a1d66-0a65-4172-9267-38840795e42d\" />\r\n```\r\n\r\nHowever, according to DASH specification the correct order is the opposite - `ContentProtection` must be before `SegmentTemplate`. This causes [validation of the manifest](http://dashif.org/conformance) to fail.\r\n\r\nHere is the mp4box command line used:\r\n\r\n```\r\nmp4box.exe -noprog -dash-strict 4000 -out \"ooo2\\Encrypted\\Manifest.mpd\" -profile \"dashavc264:live\" -sample-groups-traf -bs-switching no \"temp2\\EncryptStreams\\v-288-400k.mp4\" \"temp2\\EncryptStreams\\v-360-800k.mp4\" \"temp2\\EncryptStreams\\v-480-1200k.mp4\" \"temp2\\EncryptStreams\\v-720-2100k.mp4\" \"temp2\\EncryptStreams\\v-1080-3000k.mp4\" \"temp2\\EncryptStreams\\a.mp4\" \"temp2\\EncodeTextStreams\\TOS-zh.mp4\" -segment-name $RepresentationID$\\$Number%04d$$Init=init$\r\n```"},"comment":{"url":"https://api.github.com/repos/gpac/gpac/issues/comments/197003889","html_url":"https://github.com/gpac/gpac/issues/454#issuecomment-197003889","issue_url":"https://api.github.com/repos/gpac/gpac/issues/454","id":197003889,"user":{"login":"cconcolato","id":1830314,"avatar_url":"https://avatars.githubusercontent.com/u/1830314?v=3","gravatar_id":"","url":"https://api.github.com/users/cconcolato","html_url":"https://github.com/cconcolato","followers_url":"https://api.github.com/users/cconcolato/followers","following_url":"https://api.github.com/users/cconcolato/following{/other_user}","gists_url":"https://api.github.com/users/cconcolato/gists{/gist_id}","starred_url":"https://api.github.com/users/cconcolato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cconcolato/subscriptions","organizations_url":"https://api.github.com/users/cconcolato/orgs","repos_url":"https://api.github.com/users/cconcolato/repos","events_url":"https://api.github.com/users/cconcolato/events{/privacy}","received_events_url":"https://api.github.com/users/cconcolato/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T20:17:03Z","updated_at":"2016-03-15T20:17:03Z","body":"I've just fixed it for those 2 descriptors (https://github.com/gpac/gpac/commit/b03ae9ae4719e00656790be09cde2002fa131514), but it still has descriptor order problems in general. We'll have to fix it more globally. HTH."}}