{"id":2314,"date":"2024-04-20T18:00:00","date_gmt":"2024-04-20T17:00:00","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=2314"},"modified":"2024-04-21T12:48:57","modified_gmt":"2024-04-21T11:48:57","slug":"direct3d-11-gpu-windows-11-virtual-camera","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/2314","title":{"rendered":"Demo: Direct3D 11 GPU Windows 11 Virtual Camera"},"content":{"rendered":"\n<p>Moving on with Widows Camera experiments.<\/p>\n\n\n\n<p>This time it is a Windows 11 Virtual Camera, a true one like <a href=\"https:\/\/alax.info\/blog\/2245\">this<\/a> and <a href=\"https:\/\/alax.info\/blog\/2296\">this<\/a>, and not <a href=\"https:\/\/alax.info\/blog\/2295\">this<\/a> which should be totally archived despite people still <a href=\"https:\/\/stackoverflow.com\/q\/78326998\/868014\">keep on trying<\/a>.<\/p>\n\n\n\n<p>So what we got this time? The application derived from old&nbsp;<code><a href=\"https:\/\/github.com\/microsoft\/Windows-classic-samples\/tree\/a47da3d4551b74bb8cc1f4c7447445ac594afb44\/Samples\/CaptureEngineVideoCapture\">CaptureEngineVideoCapture<\/a><\/code>&nbsp;sample&nbsp;still features <code>IMFCaptureEngine<\/code> API. However, it also intallls temporary a virtual camera based on <a href=\"https:\/\/www.shadertoy.com\/view\/Xcc3Wn\">beautiful Shadertoy shader &#8220;Entangled Illumination&#8221;<\/a> (you can still find the HLSL variant in the resources of the executable downloadable from the bottom of the post).<\/p>\n\n\n\n<p>The image is synthesized on GPU (hardcoded as 1920&#215;1080, announced as 30 fps but runs at the pace of frame requester) and is then delivered to Frame Server service for distribution. <\/p>\n\n\n\n<p>Oh my, how poorly this Microsof Windows Media Foundation stuff is documented! In fact, this demo is the proof that despite the quality of the documentation of this technology, an experienced stranger can still take advantage of it.<\/p>\n\n\n\n<p>From the very beginning this video travels through Windows subsystems and processes as GPU (video memory, D3D11 texture) data, from the synthesis to display composition, not a single video\/system memory crossing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"595\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-1-800x595.png\" alt=\"\" class=\"wp-image-2315\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-1-800x595.png 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-1-320x238.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-1-768x571.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-1-600x446.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-1-1040x773.png 1040w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-1.png 1441w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>You can stop preview in the test application (F4 or menu), and while the application is running the virtual video camera is visible to other applications, e.g. Windows Camera app or Skype:<\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"495\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-2-800x495.png\" alt=\"\" class=\"wp-image-2316\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-2-800x495.png 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-2-320x198.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-2-768x475.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-2-1536x951.png 1536w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-2-2048x1267.png 2048w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-2-600x371.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-2-1040x644.png 1040w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"555\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-3-800x555.png\" alt=\"\" class=\"wp-image-2317\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-3-800x555.png 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-3-320x222.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-3-768x533.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-3-1536x1066.png 1536w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-3-600x416.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-3-1040x722.png 1040w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-3.png 1702w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>You wanted Microsoft Teams? You got it covered.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"492\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-4-800x492.png\" alt=\"\" class=\"wp-image-2318\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-4-800x492.png 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-4-320x197.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-4-768x472.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-4-1536x944.png 1536w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-4-2048x1259.png 2048w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-4-600x369.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-4-1040x639.png 1040w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Let&#8217;s go straight to the download. The demo is packaged as a single binary to run and since the initialization step requires access to register virtual camera you would have to run it &#8220;as administrator&#8221;.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-d8b8958b-fcc0-4055-94cd-748d508ca124\" href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/Capture-20240420-f786387e2993cf5b7f5ccfe5925dc06c0839e6d4.zip\">Capture-20240420-f786387e2993cf5b7f5ccfe5925dc06c0839e6d4<\/a><a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/Capture-20240420-f786387e2993cf5b7f5ccfe5925dc06c0839e6d4.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-d8b8958b-fcc0-4055-94cd-748d508ca124\">Download<\/a><\/div>\n\n\n\n<p>PS. Are you thinking about DriectShow? This is now the most up to date method to develop virtual camera software for DirectShow too. Here you go, good old <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/directshow\/amcap-sample\">AmCap<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"543\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-5-800x543.png\" alt=\"\" class=\"wp-image-2321\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-5-800x543.png 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-5-320x217.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-5-768x521.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-5-1536x1042.png 1536w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-5-600x407.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-5-1040x705.png 1040w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2024\/04\/image-5.png 1687w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Moving on with Widows Camera experiments. This time it is a Windows 11 Virtual Camera, a true one like this and this, and not this which should be totally archived despite people still keep on trying. So what we got this time? The application derived from old&nbsp;CaptureEngineVideoCapture&nbsp;sample&nbsp;still features IMFCaptureEngine API. However, it also intallls temporary&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/2314\">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":[544,424,486,581],"class_list":["post-2314","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-direct3d-11","tag-media-foundation","tag-video","tag-winapi-2"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2314","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=2314"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2314\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=2314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=2314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=2314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}