{"id":2117,"date":"2020-10-31T21:04:53","date_gmt":"2020-10-31T19:04:53","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=2117"},"modified":"2020-10-31T21:04:53","modified_gmt":"2020-10-31T19:04:53","slug":"drm-enabled-streaming-media-playback-bug-with-uwp-mediaelement","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/2117","title":{"rendered":"DRM-enabled streaming media playback bug with UWP MediaElement"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Addition of another crazy thing into internal tooling uncovered new interesting bug. An application is creating audiovisual HLS (<a href=\"https:\/\/en.wikipedia.org\/wiki\/HTTP_Live_Streaming\">HTTP Live Streaming<\/a> &#8211; adaptive streaming developed by Apple) stream on the fly now with <a href=\"https:\/\/www.microsoft.com\/playready\/\">Microsoft PlayReady<\/a> DRM encryption attached.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">UWP samples offer a sample application for playback: <a href=\"https:\/\/github.com\/microsoft\/Windows-universal-samples\/tree\/master\/Samples\/PlayReady\">PlayReady sample<\/a>. The playback looks this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"600\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/Clipbrd1-746x600.png\" alt=\"\" class=\"wp-image-2118\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/Clipbrd1-746x600.png 746w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/Clipbrd1-320x257.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/Clipbrd1-768x618.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/Clipbrd1-1536x1235.png 1536w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/Clipbrd1-2048x1647.png 2048w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/Clipbrd1-600x482.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/Clipbrd1-1040x836.png 1040w\" sizes=\"auto, (max-width: 746px) 100vw, 746px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Oops, no video! However, this is behavior by design: DRM-enabled video is protected on multiple layers and eventually the image cannot be captured back as a screenshot: the video is automatically removed from the view.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Physical picture of application on monitor is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/IMG_1586-800x600.jpg\" alt=\"\" class=\"wp-image-2119\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/IMG_1586-800x600.jpg 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/IMG_1586-320x240.jpg 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/IMG_1586-768x576.jpg 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/IMG_1586-1536x1152.jpg 1536w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/IMG_1586-2048x1536.jpg 2048w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/IMG_1586-600x450.jpg 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2020\/10\/IMG_1586-1040x780.jpg 1040w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on protection level, there might be HDCP enforcement as well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now the bug is that protected video running in UWP <code>MediaElement<\/code> is that video cannot be taken to another monitor (even though it belong to the same video adapter):<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"IMG 1587\" width=\"1040\" height=\"585\" src=\"https:\/\/www.youtube.com\/embed\/XOlTLQia9S0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It cannot be even restarted on another monitor! Generally speaking, it is not necessarily an <code>MediaPlayer<\/code> element bug, it can as well be DXGI, for example, and it can be even NVIDIA driver bug. Even though NVIDIA software reports that both monitors can have HDCP-enabled signal, there is something missing. One interesting thing is that it is not even possible to query for HDCP status via standard API for one of the monitors, but not for the other.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PlayReady DRM itself is not a technology coming with detailed information, and its support in Windows is seriously limited in information, integration support. There is just one sample mentioned above and pretty much of related information is simply classified. There is not so much for debugging either because Microsoft intentionally limited PlayReady support to stock implementation hard to use partially, and which is running in an isolated protected process: Media Foundation Media Pipeline EXE (related keyword: <code>PsProtectedSignerAuthenticode<\/code>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Addition of another crazy thing into internal tooling uncovered new interesting bug. An application is creating audiovisual HLS (HTTP Live Streaming &#8211; adaptive streaming developed by Apple) stream on the fly now with Microsoft PlayReady DRM encryption attached. UWP samples offer a sample application for playback: PlayReady sample. The playback looks this: Oops, no video!&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/2117\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[63,612,578,611,549,486],"class_list":["post-2117","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bug","tag-drm","tag-hls","tag-playready","tag-uwp","tag-video"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=2117"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2117\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=2117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=2117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=2117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}