{"id":1722,"date":"2016-09-28T12:34:15","date_gmt":"2016-09-28T10:34:15","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1722"},"modified":"2020-12-02T22:54:03","modified_gmt":"2020-12-02T20:54:03","slug":"applicability-of-virtual-directshow-sources","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1722","title":{"rendered":"Applicability of Virtual DirectShow Sources"},"content":{"rendered":"<p>Virtual DirectShow\u00c2\u00a0 sources have been a long time synonym of software-only camera implementation exposed to applications along with physical cameras in a way that applications consume the sources without making a difference whether the camera is real or virtual. <a href=\"http:\/\/tmhare.mvps.org\/downloads.htm\">Vivek&#8217;s template<\/a> was a starting point for many:<\/p>\n<blockquote><p><a href=\"http:\/\/tmhare.mvps.org\/downloads\/vcam.zip\">Capture Source Filter<\/a> filter (version 0.1) 86 KB zipped, includes binaries.\u00c2\u00a0 A sample source filter that emulates a video capture device contributed by Vivek (rep movsd from the public newsgroups).\u00c2\u00a0 Thanks Vivek!\u00c2\u00a0 TMH has not tested this filter yet.\u00c2\u00a0 Ask questions about this on microsoft.public.win32.programmer.directx.video.<\/p><\/blockquote>\n<p>(02-Dec-2020 update: the sample is no longer hosted at its original location, I put <a href=\"https:\/\/github.com\/roman380\/tmhare.mvps.org-vcam\">a copy into GitHub repository<\/a>)<\/p>\n<p>With API changes over years, the sample and the concept is still understood as the method of adding a virtual camera, however new scenarios exist where the concept no longer works. Typical problems:<\/p>\n<ol>\n<li>64-bit applications cannot consume virtual 32-bit virtual sources<\/li>\n<li>Virtual sources are no visible and accessible to applications consuming video using Media Foundation API<\/li>\n<\/ol>\n<p>The diagram below explains the applicability of virtual cameras:<\/p>\n<p><a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2016\/09\/Applicability-of-Virtual-DirectShow-Sources-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1724\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2016\/09\/Applicability-of-Virtual-DirectShow-Sources-1-800x548.png\" alt=\"Applicability of Virtual DirectShow Sources\" width=\"648\" height=\"444\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2016\/09\/Applicability-of-Virtual-DirectShow-Sources-1-800x548.png 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2016\/09\/Applicability-of-Virtual-DirectShow-Sources-1-320x219.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2016\/09\/Applicability-of-Virtual-DirectShow-Sources-1-768x526.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2016\/09\/Applicability-of-Virtual-DirectShow-Sources-1.png 1128w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>Important is that virtual sources can only be consumed by the DirectShow-based applications of the same bitness.<\/p>\n<p>If source developer needs to synchronize virtual source throughout multiple applications (e.g. video is synthesized by another application and needs to be deliverable to multiple clients), he needs to add interprocess synchronization on the backyard of virtual source.<\/p>\n<p>If developer needs to support both 32- and 64-bit apps, he needs both variants of virtual sources registered, and possibly synchronization of the kind of the paragraph above.<\/p>\n<p>The only virtual device which is visible to all video capture applications if implemented by kernel level driver (implementations are rare but exist).<\/p>\n<p>See also:<\/p>\n<ul>\n<li><a href=\"https:\/\/social.msdn.microsoft.com\/Forums\/en-US\/f5a05677-b2d1-4909-8c53-abb10426f82e\/how-to-register-a-live-media-source-media-foundation?forum=mediafoundationdevelopment\">How to register a live media source &#8211; media foundation<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/42922475\/virtual-driver-cam-not-recognized-by-browser\">Virtual Driver Cam not recognized by browser<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Virtual DirectShow\u00c2\u00a0 sources have been a long time synonym of software-only camera implementation exposed to applications along with physical cameras in a way that applications consume the sources without making a difference whether the camera is real or virtual. Vivek&#8217;s template was a starting point for many: Capture Source Filter filter (version 0.1) 86 KB&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1722\">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":[82,78,486,193,70],"class_list":["post-1722","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-camera","tag-directshow","tag-video","tag-virtual","tag-winapi"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1722","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=1722"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1722\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}