{"id":1216,"date":"2011-05-23T00:07:03","date_gmt":"2011-05-22T22:07:03","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1216"},"modified":"2017-03-09T21:33:48","modified_gmt":"2017-03-09T19:33:48","slug":"directshow-video-source-filter-for-jpeg-and-m-jpeg-ip-cameras","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1216","title":{"rendered":"DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras"},"content":{"rendered":"<p>This implements a <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd375454%28VS.85%29.aspx\">DirectShow<\/a> driver\/wrapper over a HTTP based JPEG\/<a href=\"http:\/\/en.wikipedia.org\/wiki\/Motion_JPEG#IP_Cameras\">M-JPEG<\/a> streamed video, widely available with IP cameras. Once installed, it provides a Start Menu shortcut to manage video capture devices, where a user can add\/remove devices. The devices are automatically registered with DriectShow and are available to applications.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1217\" title=\"Start Menu Shortcut\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0011.png\" alt=\"\" width=\"451\" height=\"482\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0011.png 451w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0011-299x320.png 299w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1218\" title=\"Manage Video Devices\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0021.png\" alt=\"\" width=\"377\" height=\"432\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0021.png 377w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0021-279x320.png 279w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><\/p>\n<p>The compatibility list includes:<\/p>\n<ul>\n<li>Windows SDK <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd373424%28VS.85%29.aspx\">AmCap<\/a> Sample (reference)<\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd390950%28VS.85%29.aspx\">VideoLan VLC<\/a><\/li>\n<li><a href=\"http:\/\/www.skype.com\/\">Skype<\/a> (see below)<\/li>\n<li><a href=\"http:\/\/www.google.com\/talk\/\">Google Talk Video Chat<\/a><\/li>\n<li><a href=\"http:\/\/luxriot.com\">Luxriot<\/a> (as rather an example as Luxriot has its own generic JPEG\/M-JPEG device driver, however this still demonstrates compatibility and interoperability of applications)<\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd390950%28VS.85%29.aspx\">GraphEdit<\/a>, GraphStudio and similar tools<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p>For a created device it is required to configure:<\/p>\n<ol>\n<li>JPEG or M-JPEG resource URL on the device, where the driver will access video feed or sequential snapshots<\/li>\n<li>Image\/video size on the device<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1219\" title=\"Device Property Sheet - General Property Page\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0032.png\" alt=\"\" width=\"377\" height=\"432\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0032.png 377w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0032-279x320.png 279w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><\/p>\n<p>Resource URLs vary from device to device and there is no standard identifier. This has to be looked up for specific model in device API reference or SDK. For JPEG snapshots it is possible to copy image shortcut from web browser and paste address into device settings.<\/p>\n<p>Note that some devices, especially low end IP cameras deliver non-compliant feed which can be decoded either by manufacturer&#8217;s ActiveX control or model-specific implementation which this driver does not convert and is unlikely to ever cover. The driver will only work with hardware which honors industry standards.<\/p>\n<p>For example, <a href=\"http:\/\/www.stardot.com\/products\/cameras\">Stardot NetCam SC<\/a> cameras make the video feed accessible using \/nph-mjpeg.cgi resource, so the full URL will consist of protocol prefix &#8220;http:\/\/&#8221;, optional username and password (see screenshot above), IP address or host name e.g. &#8220;demo2.stardotcams.com&#8221;, resource identifier on the device &#8220;\/nph-mjpeg.cgi&#8221;.<\/p>\n<p>Hence, http:\/\/demo2.stardotcams.com\/nph-mjpeg.cgi<\/p>\n<p>It is necessary to provide video size of the footage in advance so that the driver could negotiate content media types without accessing the device. Future versions of the driver might implement auto-detection.<\/p>\n<h4>Skype Compatibility<\/h4>\n<p>To make the device work with Skype, it is necessary to:<\/p>\n<ol>\n<li>Configure the device (using its web interface) to work at resolution 640&#215;480<\/li>\n<li>Add\/configure device with Alax.Info IP video Source as described above, including setting of 640 by 480 pixel resolution in device configuration<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1220\" title=\"Skype Video Device\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0042.png\" alt=\"\" width=\"716\" height=\"612\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0042.png 716w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0042-320x273.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0042-701x600.png 701w\" sizes=\"auto, (max-width: 716px) 100vw, 716px\" \/><\/p>\n<h4>Internals<\/h4>\n<p>Software implements and registers video input\/capture devices, listed under <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347%28VS.85%29.aspx\">DirectShow CLSID_VideoInputDeviceCategory<\/a> category. The applications access devices from the list and treat as a regular device such as web camera.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd373424%28VS.85%29.aspx\">Windows SDK AmCap sample<\/a> will create the following DirectShow graph where the source filter implemented by this software:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1221\" title=\"Outer DirectShow Fitler Graph\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image006.png\" alt=\"\" width=\"615\" height=\"295\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image006.png 615w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image006-320x153.png 320w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/p>\n<p>Internally, software creates a worker filter graph in order to stream data from the device:<\/p>\n<p><a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0051.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1222\" title=\"Inner DirectShow Fitler Graph\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0051-800x294.png\" alt=\"\" width=\"620\" height=\"227\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0051-800x294.png 800w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0051-320x117.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/05\/Image0051.png 999w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>To decode video, software uses stock <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd390691%28VS.85%29.aspx\">MJPEG Decompressor Filter<\/a> provided with operating system.<\/p>\n<h3>Download links<\/h3>\n<ul>\n<li>Version: 1.0.0<\/li>\n<li>Binaries: Win32 \u00e2\u20ac\u201c <a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/IpVideoSource\/IpVideoSourceSetup-Win32.msi\">IpVideoSourceSetup-Win32.msi<\/a>, x64 &#8211; <a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/IpVideoSource\/IpVideoSourceSetup-x64.msi\">IpVideoSourceSetup-x64.msi<\/a><\/li>\n<li>License: This software is free to use<\/li>\n<\/ul>\n<h3>Bonus content<\/h3>\n<ul>\n<li><a href=https:\/\/www.youtube.com\/watch?v=xGfPhIK3wRM&#038;feature=youtu.be&#038;t=6m12s>Android Webcam Tutorial for Windows. (For Xsplit\/OBS Streaming)<\/a> on YouTube<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This implements a DirectShow driver\/wrapper over a HTTP based JPEG\/M-JPEG streamed video, widely available with IP cameras. Once installed, it provides a Start Menu shortcut to manage video capture devices, where a user can add\/remove devices. The devices are automatically registered with DriectShow and are available to applications. The compatibility list includes: Windows SDK AmCap&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1216\">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":[2],"tags":[82,162,191,78,348,300,349,119,53,344,445,75,158,155,488,486],"class_list":["post-1216","post","type-post","status-publish","format-standard","hentry","category-utilities","tag-camera","tag-capture","tag-device","tag-directshow","tag-driver","tag-dshow","tag-ecnoder","tag-filter","tag-google-talk","tag-ip","tag-ipvideosource","tag-jpeg","tag-m-jpeg","tag-skype","tag-source","tag-video"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1216","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=1216"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1216\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}