<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fooling Around &#187; DirectShow</title>
	<atom:link href="http://alax.info/blog/tag/directshow/feed" rel="self" type="application/rss+xml" />
	<link>http://alax.info/blog</link>
	<description>// Software Production Line</description>
	<lastBuildDate>Fri, 03 Feb 2012 22:49:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>DirectShow SDK at Crime Scene Investigation Service</title>
		<link>http://alax.info/blog/1322</link>
		<comments>http://alax.info/blog/1322#comments</comments>
		<pubDate>Sun, 27 Nov 2011 11:03:46 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[amusing]]></category>
		<category><![CDATA[DirectShow]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1322</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1322" title="DirectShow SDK at Crime Scene Investigation Service"></a>According to CSI: Crime Scene Investigation, Season 06 Episode 13 (17:04), investigators are using snake scope camera with DirectShow AMCAP tool to present the captured image:]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1322" title="DirectShow SDK at Crime Scene Investigation Service"></a><p>According to <em>CSI: Crime Scene Investigation</em>, Season 06 Episode 13 (17:04), investigators are using snake scope camera with <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd373424%28v=vs.85%29.aspx">DirectShow AMCAP</a> tool to present the captured image:</p>
<p><img class="alignnone size-full wp-image-1323" title="AmCap and CSI" src="http://alax.info/blog/wp-content/uploads/2011/11/csi.s06e13.rus_.eng_.dvdrip.novafilm.tv_.avi_snapshot_17.04_2011.11.27_12.57.05-2.jpg" alt="" width="624" height="352" /></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1322/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft DTV-DVD Video Decoder at High Resolutions</title>
		<link>http://alax.info/blog/1283</link>
		<comments>http://alax.info/blog/1283#comments</comments>
		<pubDate>Wed, 21 Sep 2011 20:51:23 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[H.264]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1283</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1283" title="Microsoft DTV-DVD Video Decoder at High Resolutions"></a>It is really great news that Windows 7 offers quite some goodies for MPEG-4 support right out of the box, but some things appear to be made not so accurate. The component responsible for video decoding is Microsoft DTV-DVD Video &#8230;<p class="read-more"><a href="http://alax.info/blog/1283">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1283" title="Microsoft DTV-DVD Video Decoder at High Resolutions"></a><p>It is really great news that Windows 7 offers quite some goodies for MPEG-4 support right out of the box, but some things appear to be made not so accurate.</p>
<p>The component responsible for video decoding is <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd390679%28v=vs.85%29.aspx">Microsoft DTV-DVD Video Decoder</a> (also known as Microsoft MPEG-2 Video Decoder), available with DirectShow interface. It offers video decoding capabilities for video resolutions up to 1920&#215;1088 (Full HD), including DXVA version 2 mode. The decoder is a &#8220;preferred decoder&#8221; and is given a first chance to be taken when it comes for <a href="http://msdn.microsoft.com/en-us/library/dd390342%28v=VS.85%29.aspx">Intelligent Connect</a> to render a video stream.</p>
<p>Technology went ahead though, stepped behind 1920&#215;1088 in particular. Microsoft DTV-DVD Video Decoder DirectShow filter still remains the first take in H.264 video decoding, and what however is taking place &#8211; the decoder accepts the format (media type) which is clearly cannot decode, neither according to specification, nor in real life. As soon as pin connection succeeds, DirectShow is not trying to look for another decoder, which can truly decode the feed. Result: failure to decode video.</p>
<p><img class="alignnone size-full wp-image-1284" title="Incorrect Media Type on Microsoft DTV-DVD Decoder Output" src="http://alax.info/blog/wp-content/uploads/2011/09/Image001.png" alt="" width="1034" height="624" /></p>
<p>The problem takes place in a quite surprising way. Given 5 megapixel video (2560&#215;1592, H.264, Baseline profile, from <a href="http://en.wikipedia.org/wiki/RTSP">RTSP</a>-enabled IP camera), the decoder advertises 720&#215;480 NV12 output media type. While consuming input data, the decoder outputs nothing and keeps video window black.</p>
<p>It does not issue any filter graph events, no. The filter is persistent and works hard in assumption that a new piece of knowledge will come from Mars and provide new capabilities to start decoding video, or filter&#8217;s input will give up and provide a new <a href="http://en.wikipedia.org/wiki/Network_Abstraction_Layer#Parameter_Sets">SPS</a> to lower resolution down to something less complex.</p>
<p>Well then, so is this advanced technology yet to be discovered by science? It appears that no. CoreAVC Video Decoder, applied to the same H.264 video decodes it well and nice:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/09/Image002.png"><img class="alignnone size-large wp-image-1287" title="CoreAVC H.264 Video Decoder with 5 MP Video from StarDot SDH500BN IP Camera" src="http://alax.info/blog/wp-content/uploads/2011/09/Image002-505x600.png" alt="" width="505" height="600" /></a></p>
<p><span style="text-decoration: underline;">Update 2011-09-26</span>: According to Microsoft classification, this is <a href="http://connect.microsoft.com/VisualStudio/feedback/details/689926/dtv-dvd-video-decoder-directshow-filter-negotiates-decoding-at-high-resolutions-but-fails-to-actually-decode">a bug on a released product</a>. That is, if anyone is experiencing severe issues as a result of this behavior, one might need to contact Microsoft Support directly in search of a solution.</p>
<p>Actually, as resolutions over Full HD (1920&#215;1080) are not so much common at the moment, the issue side effects are not yet likely. Still moving on with time, I think the issues are likely to come up, without being severe though.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1283/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DirectShow Spy: Intelligent Connect Trace, Selective Process Black Listing</title>
		<link>http://alax.info/blog/1253</link>
		<comments>http://alax.info/blog/1253#comments</comments>
		<pubDate>Sun, 24 Jul 2011 18:55:47 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[intelligent connect]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[spy]]></category>
		<category><![CDATA[trace]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1253</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1253" title="DirectShow Spy: Intelligent Connect Trace, Selective Process Black Listing"></a>DirectShow Spy is updated with a few new features: retroactive Intelligent Connect trace log output for IAMGraphBuilderCallback-related activity process name based black list to selectively exclude processes from spying Intelligent Connect Trace The utility received a capability to read back &#8230;<p class="read-more"><a href="http://alax.info/blog/1253">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1253" title="DirectShow Spy: Intelligent Connect Trace, Selective Process Black Listing"></a><p>DirectShow Spy is updated with a few new features:</p>
<ul>
<li>retroactive Intelligent Connect trace</li>
<li>log output for IAMGraphBuilderCallback-related activity</li>
<li>process name based black list to selectively exclude processes from spying</li>
</ul>
<h4>Intelligent Connect Trace</h4>
<p>The utility received a capability to read back from its own log file (DirectShowSpy.log, located typically in C:\ProgramData directory) and reconstruct graph building sequence, including steps taken by DirectShow <a href="http://msdn.microsoft.com/en-us/library/dd390342%28VS.85%29.aspx">Intelligent Connect</a>.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image0012.png"><img class="alignnone size-large wp-image-1254" title="Intelligent Connect Trace" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0012-582x600.png" alt="" width="582" height="600" /></a></p>
<p>In order to activate the Intelligent Connect Trace property sheet, one needs to call exported function &#8220;<em>DoGraphBuilderCallbackPropertySheetModal</em>&#8220;, such as using <em>runndll32</em> tool:</p>
<p style="text-align: left; padding-left: 30px;">C:\DirectShowSpy&gt;rundll32 DirectShowSpy.dll,DoGraphBuilderCallbackPropertySheetModal</p>
<p style="text-align: left;">The upper part of the property page displays recently created DirectShow fitler graphs, newest to older. For a selected graph, the lower part displays events in chronological order. The events include:</p>
<ul>
<li>Adding a filter, at <a href="http://msdn.microsoft.com/en-us/library/dd390016%28VS.85%29.aspx">IFilterGraph2::AddFilter</a> method</li>
<li>Removing a filter, at <a href="http://msdn.microsoft.com/en-us/library/dd390022%28VS.85%29.aspx">IFilterGraph2::RemoveFilter</a> method</li>
<li>Selecting a filter, at Intelligent Connect&#8217;s callback at <a href="http://msdn.microsoft.com/en-us/library/dd389378%28VS.85%29.aspx">IAMGraphBuilderCallback::SelectedFilter</a></li>
<li>Creating a filter, at <a href="http://msdn.microsoft.com/en-us/library/dd389377%28VS.85%29.aspx">IAMGraphBuilderCallback::CreatedFilter</a></li>
</ul>
<p>The latter two methods also show &#8220;Application Result&#8221; column and values, which are HRESULT values returned by IAMGraphBuilderCallback callback provided by the application. Typically, a failure HRESULT code indicates that the application rejected the filter.</p>
<p>The trace log is good to expose all DirectShow junk installed in the system. For example,</p>
<p><span id="more-1253"></span><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image0022.png"><img class="alignnone size-large wp-image-1255" title="Junk: ffdshowBC.ax" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0022-800x496.png" alt="" width="620" height="384" /></a></p>
<p>In an attempt to build graph to decode FourCC &#8216;LXH4&#8242; video (which is a private alias for H.264 media type), Filter Graph Manager tried to apply &#8216;ffdshow Video Decoder&#8217; filter, which is unable to process the feed, but is registered at an extremely high merit and violating the guidelines.</p>
<p>The tool shows that the file hosting the filter is &#8220;<em>ffdshowBC.ax</em>&#8221; and shows its location. The application however appears to be aware of this piece of trash, and returned E_FAIL (0&#215;80004005) rejecting the filter.</p>
<p>How comes the garbage is hooking into place where it is not supposed to be, yet is sophisticated enough to reach such internals of operating system? This module is a clone/branch of well-known <a href="http://www.google.com/search?q=ffdshow">ffdshow</a> software, which by default registers itself with abnormally high merit &#8220;with good intentions in mind&#8221;. A short-sighted manufacturer of cheap stuff IP camera duplicated the project, changed the GUIDs, packaged the pathetic crap into ActiveX control cabinet and started distributing it over clean and virgin workstations around the globe.</p>
<p>Going further with the the trace being checked, there are more things to enjoy:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image0033.png"><img class="alignnone size-large wp-image-1256" title="Junk: MainConcept Showcase" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0033-800x553.png" alt="" width="620" height="428" /></a></p>
<p>Trying to decode the same H.264 video feed, the Filter Graph Manager mounting three demultiplexers made  by MainConcept in a row, for MP4, MPEG and MXF containers. The utility immediately indicates that this trash contribution was brought by <a href="http://www.mainconcept.com/products/sdks/others/showcase.html">MainConcept Showcase</a> 8.7.0.28412. One might wanted to install it for a purpose, and it started killing other DirectShow software it shares workstation with.</p>
<p>The good news is that the method is friendly for production environment and only requires to register spy and collect log file. You don&#8217;t eve need to check the UI at the same computer, it is possible to transfer the log file into development environment and have spy read the log there.</p>
<p>The &#8220;Copy to Clipboard&#8221; link is a convenient option to transfer the findings into tab-separated values format, such as to paste into Microsoft Excel:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image0042.png"><img class="alignnone size-large wp-image-1257" title="Data Transfered to Microsoft Excel" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0042-800x394.png" alt="" width="620" height="305" /></a></p>
<h4>Process Black Listing</h4>
<p>The utility received a capability to selectively not load into specific processes. DirectShowSpy is a developer tool and is not intended for production environment, nor it is guaranteed to be issue-free. So in case of specific conflict it is possible to exclude specific process from applying a spy using registry:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image0051.png"><img class="alignnone size-large wp-image-1258" title="Black List Registry" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0051-800x424.png" alt="" width="620" height="328" /></a></p>
<p>The values are under <em>HKLM, SOFTWARE\[Wow6432Node\]Alax.Info\Utilities\DirectShowSpy</em> key, and there are three values defined:</p>
<ul>
<li>CFilterMapperSpy Black List &#8211; defines exclusion for filter mapper spying</li>
<li>CSpy Black List &#8211; defines exclusion for filter graph spy (effective for most applications)</li>
<li>CNoThreadSpy Black List &#8211; defines exclusion for filter graphs created with <a href="http://msdn.microsoft.com/en-us/library/dd375786%28VS.85%29.aspx">CLSID_FilterGraphNoThread</a></li>
</ul>
<p>The exclusion value is a comma-separated list of process names, exact case-insensitive match for executable file names without directory and extension.</p>
<p>It is recommended that filter mapper spy has at least as rich exclusion list as the filter graph spy entires (otherwise, it is possible that spy might raise unexpected exceptions).</p>
<p>Partial Visual C++ .NET 2008 source code is <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy">available from SVN</a>, release binary included (<a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/Win32/DirectShowSpy.dll?format=raw">Win32</a>, <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/x64/DirectShowSpy.dll?format=raw">x64</a>); installation instructions are in <a href="../777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1253/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another VFW/DirectShow Pain in the Ass: picapmk4.dll</title>
		<link>http://alax.info/blog/1250</link>
		<comments>http://alax.info/blog/1250#comments</comments>
		<pubDate>Thu, 21 Jul 2011 13:05:33 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Seriously]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[crapware]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[picapmk4]]></category>
		<category><![CDATA[vfw]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1250</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1250" title="Another VFW/DirectShow Pain in the Ass: picapmk4.dll"></a>A customer complained on video playback problems which had symptoms of software compatibility issue. At certain operation modes software froze leaving the only option to kill process and restart. I appeared that the system has a third party DLL installed, &#8230;<p class="read-more"><a href="http://alax.info/blog/1250">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1250" title="Another VFW/DirectShow Pain in the Ass: picapmk4.dll"></a><p>A customer complained on video playback problems which had symptoms of software compatibility issue. At certain operation modes software froze leaving the only option to kill process and restart.</p>
<p>I appeared that the system has a third party DLL installed, a new hero name&#8217;s &#8211; <strong>picapmk4.dll</strong>. The DLL registers itself as Video for Windows codec and is clearly indicating capabilities it does not really support.</p>
<p>The DLL itself has no indication of its source, no valid version info. Instead it has GPL v2 embedded, XviD logo and about box resource template showing up as &#8220;PMK4 Video Codec&#8221;.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image0011.png"><img class="alignnone size-full wp-image-1251" title="XviD logo" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0011.png" alt="" width="468" height="211" /></a></p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image0021.png"><img class="alignnone size-full wp-image-1252" title="PMK4 Video Codec" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0021.png" alt="" width="467" height="371" /></a></p>
<p>Looks like crapware, which is hostile to DirectShow environment, with possibly GPL compliance issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1250/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectShow App Mess: Google Video Chat vs. Skype</title>
		<link>http://alax.info/blog/1233</link>
		<comments>http://alax.info/blog/1233#comments</comments>
		<pubDate>Fri, 08 Jul 2011 15:26:06 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[crapware]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[skype]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1233</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1233" title="DirectShow App Mess: Google Video Chat vs. Skype"></a>Two widely popular applications, which use DirectShow API appeared to be locked in a combat: Google video chat is installing a plugin which registers artificial video capture sources &#8220;Google Camera Adapter 0&#8243; and &#8220;Google Camera Adapter 1&#8243;. As the application &#8230;<p class="read-more"><a href="http://alax.info/blog/1233">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1233" title="DirectShow App Mess: Google Video Chat vs. Skype"></a><p>Two widely popular applications, which use DirectShow API appeared to be locked in a combat: Google video chat is installing a plugin which registers artificial video capture sources &#8220;Google Camera Adapter 0&#8243; and &#8220;Google Camera Adapter 1&#8243;.</p>
<p>As the application does not announce any integration capabilities and is only using video for internal purposes for in-browser video, the approach with system-wide device registration is, well, questionable.</p>
<p><img class="alignnone size-full wp-image-1234" title="Google Chat DirectShow Video Sources" src="http://alax.info/blog/wp-content/uploads/2011/07/Image004.png" alt="" width="593" height="399" /></p>
<p><img class="alignnone size-full wp-image-1236" title="Video Capture Devices on AMCAP" src="http://alax.info/blog/wp-content/uploads/2011/07/Image001.png" alt="" width="655" height="557" /></p>
<p>No need to mention, that devices are not operational: they are giving ERROR_DLL_INIT_FAILED (Error 0x8007045A) as soon as you try to instantiate a filter in a DirectShow video capture enabled application.</p>
<p>In-browser Google Video Chat itself does work and shows video from &#8220;real&#8221; DirectShow devices, including such artificial as created by <a href="http://alax.info/blog/1216">IP Video Source</a> tool. Google developers prefer still to take data off the device and as soon as possible leave DirectShow domain, as their graph looks like:</p>
<p style="padding-left: 30px;">Video Capture Source -&gt; <a href="http://msdn.microsoft.com/en-us/library/dd377612%28VS.85%29.aspx">Smart Tee Filter</a> -&gt; <a href="http://msdn.microsoft.com/en-us/library/dd377544%28VS.85%29.aspx">Sample Grabber Filter</a> -&gt; <a href="http://msdn.microsoft.com/en-us/library/dd390934%28VS.85%29.aspx">Null Renderer Filter</a></p>
<p>While Google plugin developers might need some interprocess synchronization, as the plugin runs in a child &#8220;plugin container&#8221; process (plugin-container.exe), introduction of virtual video capture devices is not necessary, but is a plain garbage for the operating system and DirectShow environment.</p>
<p>For some reason, Google developers decided to introduce a special thing: they mirror captured video left-to right when it comes to showing picture capture locally. Well, quite possibly it starts a new era in video conferencing: one will not see a direct copy of video sent remotely, but instead he will be given a mirrored thing.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image005.png"><img class="alignnone size-large wp-image-1235" title="Mirrored Video on Google Video Chat" src="http://alax.info/blog/wp-content/uploads/2011/07/Image005-800x253.png" alt="" width="620" height="196" /></a></p>
<p>The curious part is, however, the effect the broken devices introduce to another popular software &#8211; Skype.</p>
<p><span id="more-1233"></span>As Skype is capable of video capturing from a DirectShow device, for video-enabled conferencing, it enumerates the available devices and definitely gets in touch with the aliens from Google planet, which are already known to be broken junk.</p>
<p>The outcome appears to be subject to chances, there are two possible outcomes and only one is such that is more or less good for a user:</p>
<ul>
<li>either, Skype shows other available devices and ignores Google adapters (while basically any reasonable DirectShow video capture device would still list those devices &#8211; after all they are registered as existing!)</li>
<li>or, Skype stumbles upon a broken thing, stops enumeration and show no video capture devices available at all! Since Skype does enumeration only once on startup, if it fails to discover devices a user needs to close Skype completely and start it again for another try with video hardware.</li>
</ul>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image002.png"><img class="alignnone size-medium wp-image-1237" title="Skype with No Cameras" src="http://alax.info/blog/wp-content/uploads/2011/07/Image002-320x273.png" alt="" width="320" height="273" /></a> <a href="http://alax.info/blog/wp-content/uploads/2011/07/Image003.png"><img class="alignnone size-medium wp-image-1238" title="Skype with non-Google Cameras" src="http://alax.info/blog/wp-content/uploads/2011/07/Image003-320x273.png" alt="" width="320" height="273" /></a></p>
<p>It appears that both applications have severe issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1233/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP Video Source: Pure JPEG URLs and Software Version</title>
		<link>http://alax.info/blog/1227</link>
		<comments>http://alax.info/blog/1227#comments</comments>
		<pubDate>Tue, 07 Jun 2011 19:02:47 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[M-JPEG]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1227</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1227" title="IP Video Source: Pure JPEG URLs and Software Version"></a>This does not update the software with new features, but there are a few simple things worth mentioning explicitly. The first is that virtual DirectShow camera device can be set up with both M-JPEG and JPEG URLs. That is, IP &#8230;<p class="read-more"><a href="http://alax.info/blog/1227">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1227" title="IP Video Source: Pure JPEG URLs and Software Version"></a><p>This does not update the software with new features, but there are a few simple things worth mentioning explicitly.</p>
<p>The first is that virtual DirectShow camera device can be set up with both M-JPEG and JPEG URLs. That is, IP cameras which do not implement M-JPEG, or implement it in a buggy way (there is a *huge* deal of such out there) can still be set up to send video as individual video frames/images as long as they implement JPEG snapshots. This is taking place often at a lower frame rate, but still works.</p>
<p>The driver will automatically detect type of URL (by response from the device) and will choose best access method for the given URL.</p>
<p>Second is that if you are looking for IP Video Source software version, such as to check against available updates, it is here on the UI (right click the caption):</p>
<p><img class="alignnone size-full wp-image-1228" title="About on System Menu" src="http://alax.info/blog/wp-content/uploads/2011/06/Image004.png" alt="" width="563" height="430" /></p>
<p><img class="alignnone size-full wp-image-1229" title="About and Version" src="http://alax.info/blog/wp-content/uploads/2011/06/Image005.png" alt="" width="436" height="294" /></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1227/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>IP Video Source: 64-bit version, resolution flexibility, Adobe FMLE</title>
		<link>http://alax.info/blog/1223</link>
		<comments>http://alax.info/blog/1223#comments</comments>
		<pubDate>Sun, 05 Jun 2011 17:42:10 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[ecnoder]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[FMLE]]></category>
		<category><![CDATA[google talk]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[M-JPEG]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1223</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1223" title="IP Video Source: 64-bit version, resolution flexibility, Adobe FMLE"></a>The IP Video Source update provides several improvements to the driver: copy/paste feature to backup, restore, or synchronize installed devices between 32-bit and 64-bit versions 64-bit version and .MSI dynamic video resizing (via Video Resizer DSP) Adobe FMLE compatibility Updates &#8230;<p class="read-more"><a href="http://alax.info/blog/1223">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1223" title="IP Video Source: 64-bit version, resolution flexibility, Adobe FMLE"></a><p>The <a href="http://alax.info/blog/1216">IP Video Source</a> update provides several improvements to the driver:</p>
<ul>
<li>copy/paste feature to backup, restore, or synchronize installed devices between 32-bit and 64-bit versions</li>
<li>64-bit version and .MSI</li>
<li>dynamic video resizing (via <a href="http://msdn.microsoft.com/en-us/library/ff819491%28VS.85%29.aspx">Video Resizer DSP</a>)</li>
<li>Adobe FMLE compatibility</li>
</ul>
<p>Updates in greater detail follow.</p>
<h4>Device Copy/Paste Feature</h4>
<p>The video device management window is providing Copy and Paste buttons, which let user transfer device information, including name and settings, through clipboard for various purposes:</p>
<ul>
<li>save data in order to be able to restore devices later</li>
<li>restore devices from saved list, or re-create from a list saved on another machine</li>
<li>duplicate a device</li>
<li>synchronize devices between 32-bit and 64-bit versions</li>
</ul>
<p>The device data is a text, one line per device, lines in comma-separated values (<a href="http://en.wikipedia.org/wiki/Comma-separated_values">CSV</a>) format.</p>
<p><img class="alignnone size-full wp-image-1224" title="Manage Video Devices" src="http://alax.info/blog/wp-content/uploads/2011/06/Image001.png" alt="" width="565" height="432" /></p>
<p><span id="more-1223"></span></p>
<h4>64-Bit Version</h4>
<p>Software is available in both 32-bit and 64-bit versions. While most of multimedia software is still 32-bit, sometimes 64-bit version is really helpful to, for example:</p>
<ul>
<li> interface to &#8220;Any CPU&#8221; .NET code which executes in 64-bit on a 64-bit operating system</li>
<li>go beyond 32-bit code boundaries, especially in part of multiple devices and virtual address space limit</li>
</ul>
<p>64-bit version duplicates functionality available in 32-bit version, though 32- and 64-bit modules run in completely separated environments.</p>
<p><img class="alignnone size-full wp-image-1225" title="Start Menu - Video Type-In" src="http://alax.info/blog/wp-content/uploads/2011/06/Image002.png" alt="" width="420" height="451" /></p>
<h4>Dynamic Video Resizing</h4>
<p>The source DirectShow filter is capable of connecting with media types different from original/camera media type in resolution part for decompressed video. The filter is internally taking advantage of <a href="http://msdn.microsoft.com/en-us/library/ff819491%28VS.85%29.aspx">Video Resizer DSP</a>, and resizes decompressed video to format of interest.</p>
<p>As Video Resizer DSP is available starting with Windows Vista, the functionality availability is subject to the same conditions.</p>
<p>The feature is absolutely required for Adobe Flash Media Live Encoder software, as it make certain assumptions as for supported resolutions, and completely ignores the information the filter makes available in standard way.</p>
<h4>Adobe Flash Media Live Encoder Friendliness</h4>
<p>The update make the device much closer to interoperation with Adobe product. The software works around a handful of bugs, including as ridiculous as neglecting to provide correct BI_RGB value in BITMAPINFOHEADER::biCompression structure, yet researchers are still to resolve the remained ones.</p>
<p>FMLE would start perfect and stream video being run under debugger, otherwise in a regular run chances are that Adobe application would internally respond with E_UNEXPECTED failure for unknown reason, stop any encoding without giving a single little notice on the GUI.</p>
<p>After all, the encoding runs perfectly through web based encoder, and the driver is providing a good way to stream to video distribution sites such as <a href="http://ustream.tv">http://ustream.tv</a>, <a href="http://livestream.com">http://livestream.com</a> from an IP camera or video encoder.</p>
<p><img class="alignnone size-large wp-image-1226" title="Adobe FMLE 3.2" src="http://alax.info/blog/wp-content/uploads/2011/06/Image003-800x600.png" alt="" width="620" height="465" /></p>
<h4>Download Information</h4>
<ul>
<li>Download (32-bit): <a href="../../blog-dist/AlaxInfoIpVideoSourceSetup.msi">AlaxInfoIpVideoSourceSetup.msi</a></li>
<li>Download (64-bit): <a href="http://alax.info/blog-dist/AlaxInfoIpVideoSourceSetup-x64.msi">AlaxInfoIpVideoSourceSetup-x64.msi</a></li>
<li>License: This software is free to use</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1223/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras</title>
		<link>http://alax.info/blog/1216</link>
		<comments>http://alax.info/blog/1216#comments</comments>
		<pubDate>Sun, 22 May 2011 22:07:03 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[ecnoder]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[google talk]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[M-JPEG]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1216</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1216" title="DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras"></a>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 &#8230;<p class="read-more"><a href="http://alax.info/blog/1216">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1216" title="DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras"></a><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>
<p><img class="alignnone size-full wp-image-1217" title="Start Menu Shortcut" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0011.png" alt="" width="451" height="482" /> <img class="alignnone size-full wp-image-1218" title="Manage Video Devices" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0021.png" alt="" width="377" height="432" /></p>
<p>The compatibility list includes:</p>
<ul>
<li>Windows SDK <a href="http://msdn.microsoft.com/en-us/library/dd373424%28VS.85%29.aspx">AmCap</a> Sample (reference)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd390950%28VS.85%29.aspx">VideoLan VLC</a></li>
<li><a href="http://www.skype.com/">Skype</a> (see below)</li>
<li><a href="http://www.google.com/talk/">Google Talk Video Chat</a></li>
<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>
<li><a href="http://msdn.microsoft.com/en-us/library/dd390950%28VS.85%29.aspx">GraphEdit</a>, GraphStudio and similar tools</li>
</ul>
<p><span id="more-1216"></span></p>
<p>For a created device it is required to configure:</p>
<ol>
<li>JPEG or M-JPEG resource URL on the device, where the driver will access video feed or sequential snapshots</li>
<li>Image/video size on the device</li>
</ol>
<p><img class="alignnone size-full wp-image-1219" title="Device Property Sheet - General Property Page" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0032.png" alt="" width="377" height="432" /></p>
<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>
<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>
<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>
<p>Hence, http://demo2.stardotcams.com/nph-mjpeg.cgi</p>
<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>
<h4>Skype Compatibility</h4>
<p>To make the device work with Skype, it is necessary to:</p>
<ol>
<li>Configure the device (using its web interface) to work at resolution 640&#215;480</li>
<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>
</ol>
<p><img class="alignnone size-full wp-image-1220" title="Skype Video Device" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0042.png" alt="" width="716" height="612" /></p>
<h4>Internals</h4>
<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>
<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>
<p><img class="alignnone size-full wp-image-1221" title="Outer DirectShow Fitler Graph" src="http://alax.info/blog/wp-content/uploads/2011/05/Image006.png" alt="" width="615" height="295" /></p>
<p>Internally, software creates a worker filter graph in order to stream data from the device:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/05/Image0051.png"><img class="alignnone size-large wp-image-1222" title="Inner DirectShow Fitler Graph" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0051-800x294.png" alt="" width="620" height="227" /></a></p>
<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>
<h4>Download Information</h4>
<ul>
<li>Download (32-bit): <a href="http://alax.info/blog-dist/AlaxInfoIpVideoSourceSetup.msi">AlaxInfoIpVideoSourceSetup.msi</a></li>
<li>Download (64-bit): To Be Done/On Request</li>
<li>License: This software is free to use</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1216/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to use your own video transformation DirectShow filter as an effect while playing back a file</title>
		<link>http://alax.info/blog/1175</link>
		<comments>http://alax.info/blog/1175#comments</comments>
		<pubDate>Fri, 11 Mar 2011 23:34:31 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Source]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1175</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1175" title="How to use your own video transformation DirectShow filter as an effect while playing back a file"></a>One of the popular questions asked in relation to DirectShow filters, and also a popular task is to modify video stream while in playback. There are various reasons one might need to do it, including keying video to replace color/range, &#8230;<p class="read-more"><a href="http://alax.info/blog/1175">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1175" title="How to use your own video transformation DirectShow filter as an effect while playing back a file"></a><p>One of the popular questions asked in relation to DirectShow filters, and also a popular task is to modify video stream while in playback. There are various reasons one might need to do it, including keying video to replace color/range, or apply text or time code on top of video, including while re-compressing footage, adjust brightness or contrast.</p>
<p>DirectShow BaseClasses/SDK include samples (in most cases <a href="http://msdn.microsoft.com/en-us/library/dd375634%28VS.85%29.aspx">EzRGB24</a> sample is the best to start for a video effect, also demonstrates use of private interface on a filter) to quick-start with the task without getting too much into detail and once this part is done, next step is to integrate filter into playback, connect it with other filters.</p>
<p>As a result of DircetShowflexibility, there are ways to do things not so good, while still being under impression of keeping right track.</p>
<p>File playback is one of the basic tasks with DirectShow. To play a file, one creates a filter graph using powerful helpers provided by <a href="http://msdn.microsoft.com/en-us/library/dd375786%28VS.85%29.aspx">Filter Graph Manager</a> object. It might be a actually a single call <a href="http://msdn.microsoft.com/en-us/library/dd390090%28VS.85%29.aspx">IGraphBuilder::RenderFile</a> which takes all the complexity of finding matching filters, connecting them together, dealing with splitters and renderers, video and audio. A single call resolves the problems in a convenient way &#8211; easy.</p>
<p>Still a simple thing of inserting your own video transformation filters breaks the simplicity. One needs to build the graph partilly, insert the effect and complete building, or build the thing and break in with a new filter. How to find insertion point? Will the other filters like intrusion? Different file types and formats.</p>
<p>There is an easy and elegant solution to pre-add your own effect filter into graph and start rendering a file from there. Sounds reasonable and sometimes works. The problem is however that it does not work always, and you never know when it lets you down. The graph might be build and the effect filter is never taken and is left orphaned aside of playback pipeline.</p>
<p>Reliable graph building assumes you are in control over building steps and allow only the level of flexibility required to connect and build parts &#8211; and this is where <a href="http://msdn.microsoft.com/en-us/library/dd390342%28VS.85%29.aspx">Intelligent Connect</a> is still a powerful helper. With an effect, the parts are &#8220;before the effect&#8221; and &#8220;after the effect&#8221;. RenderFile is no longer an option, and one has to dive deeper into graph building API.</p>
<p>First of all, the building starts with the file itself: unlike RenderFile, <a href="http://msdn.microsoft.com/en-us/library/dd390087%28VS.85%29.aspx">IGraphBuilder::AddSourceFilter</a> method adds just the first filter for a given file/format. It stops there and lets caller continue building as required. At this point, it is the right time to manually add effect filter with <a href="http://msdn.microsoft.com/en-us/library/dd390016%28VS.85%29.aspx">IFilterGraph::AddFilter</a> (IGraphBuilder is inherited from IFilterGraph and exposes the same method).</p>
<p>Having both ends in the graph for the &#8220;before the effect&#8221; part, intelligent connect can be used to connect and add filters required to make the connection. For an arbitrary file format, the task may be not trivial: depending on format and installed software components, the chain may look rather different. First, some filters combine stream splitting capability with immediate access to file (or another type of resource), others rely on joint operation of <a href="http://msdn.microsoft.com/en-us/library/dd375641%28VS.85%29.aspx">Async File Source</a> filter with a format-dependent splitter filter. Some expose elementary stream pins immediately, some provide transport stream pin.</p>
<p>There may be a few approaches as for addressing pin connection task (see also <a href="http://msdn.microsoft.com/en-us/library/dd375815%28VS.85%29.aspx">General Graph-Building Techniques</a> on MSDN). Straightforwardly, one might want to call <a href="http://msdn.microsoft.com/en-us/library/dd390088%28VS.85%29.aspx">IGraphBuilder::Connect</a> and take advantage of intelligent connect. Before this can be done, however it takes caller to select a pin of the obtained source filter to start from. There might be a few pins, including those exposing video formats, non-video formats and pre-split formats where video is behind depacketizing (demultiplexing). Considering variety of formats and support, it might make sense to make a first attempt finding a video pin (by enumerating pins and their media types, looking and <a href="http://msdn.microsoft.com/en-us/library/dd373477%28VS.85%29.aspx">AM_MEDIA_TYPE</a>::majortype and comparing to MEDIATYPE_Video) and, if not found, taking a first output pin of any type, or going through ping trying to connect first one which succeeds in connection.</p>
<p>An alternate approach is to take advantage of a helper object: <a href="http://msdn.microsoft.com/en-us/library/ms779896%28VS.85%29.aspx">Capture Graph Builder</a>. While originally it is intended to help capture graph building, it contains useful methods for general building and connecting pins. It does not own a graph itself: it is designed to operate on top of existing graph, provided by its owner. So one need to provide its existing graph and call helper methods for easy graph building. One of the methods is <a href="http://msdn.microsoft.com/en-us/library/ms784859%28VS.85%29.aspx">ICaptureGraphBuilder2::RenderStream</a>, which connects pins of given filters. Unlike API discussed earlier, it takes filter interfaces on input and will be responsible for finding proper pins itself, which might be a good idea if you don&#8217;t want to bother yourself doing it. To specify the requested task, it takes media type argument, which in this case might be video or, if fails, any type provided that video media type will still be anyway checked on input of effect filter.</p>
<p>Once the part &#8220;before the effect&#8221; is done, the other part may be completed as simple as calling <a href="http://msdn.microsoft.com/en-us/library/dd390089%28VS.85%29.aspx">IGraphBuilder::Render</a> on the output pin of the effect. This will correspond to final step of original RenderFile execution.</p>
<p>A tiny Visual Studio 2010 C++ project illustrates discussed techniques and it available at SVN repository: <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/RenderStreamTest01">RenderStreamTest01</a>:</p>
<ul>
<li>for a given media file in <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/RenderStreamTest01/RenderStreamTest01.cpp#ln109">line 109</a> the project will start graph building</li>
<li>a suitable replacement for a video effect filter will be a <a href="http://msdn.microsoft.com/en-us/library/dd377544%28VS.85%29.aspx">Sample Grabber</a> filter initialized with a video type (24-bit RGB, but the <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/RenderStreamTest01/RenderStreamTest01.cpp#ln137">line 137</a> can be commented out)</li>
<li>switch in <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/RenderStreamTest01/RenderStreamTest01.cpp#ln109">line 147</a> switches between base Connect approach and Capture Graph Builder helper</li>
<li>while message box is on the screen and also showing building status, the graph can be looked at using <a href="http://msdn.microsoft.com/en-us/library/dd390950%28VS.85%29.aspx">Graph Edit</a> or similar tool, provided that <a href="http://alax.info/blog/777">DirectShow Spy</a> is installed; alternatively you might want to put the graph onto <a href="http://msdn.microsoft.com/en-us/library/ms694349%28VS.85%29.aspx">ROT</a> manually</li>
</ul>
<p>The project also illustrates a solution for recent problems referencing Sample Grabber with new SDK. Sample Grabber was obsoleted and removed from Window SDK definition file (qedit.h). In order to resolved the problem without using an older version of SDK, the definitions might be imported from type the corresponding library and (apart from used as such) copied into the source code directly, as in lines <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/RenderStreamTest01/RenderStreamTest01.cpp#ln13">13-60</a>.</p>
<p>See also on graph building:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/dd318197%28VS.85%29.aspx">Basic DirectShow Tasks</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd390342%28VS.85%29.aspx">Intelligent Connect</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd375815%28VS.85%29.aspx">General Graph-Building Techniques</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd387915%28VS.85%29.aspx">Connect Filters</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd318240%28VS.85%29.aspx">Using Capture Graph Builder</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1175/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectShow Spy: Memory Allocator Properties</title>
		<link>http://alax.info/blog/1168</link>
		<comments>http://alax.info/blog/1168#comments</comments>
		<pubDate>Sat, 05 Mar 2011 10:15:42 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[allocator]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1168</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1168" title="DirectShow Spy: Memory Allocator Properties"></a>A small update to the DirectShow Spy today: DirectShow Filter Graph Spy prints memory allocator properties as a part of graph topology trace on transition to running state. Why is that and what it is for? Filters normally agree on &#8230;<p class="read-more"><a href="http://alax.info/blog/1168">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1168" title="DirectShow Spy: Memory Allocator Properties"></a><p>A small update to the DirectShow Spy today: <a href="http://alax.info/blog/777">DirectShow Filter Graph Spy</a> prints memory allocator properties as a part of graph topology trace on transition to running state. Why is that and what it is for? Filters normally agree on allocator properties (<a href="http://msdn.microsoft.com/en-us/library/dd373419%28VS.85%29.aspx">ALLOCATOR_PROPERTIES</a>, obtained from <a href="http://msdn.microsoft.com/en-us/library/dd407061%28VS.85%29.aspx">IMemAllocator</a>, obtained from <a href="http://msdn.microsoft.com/en-us/library/dd407073%28VS.85%29.aspx">IMemInputPin</a>) themselves without interference from controlling application. Sometimes an undesired choice of buffers can cause sick runtime behavior, including but not limited to the following:</p>
<ol>
<li>live audio capture buffers are too long, and introduce significant latency, including from live video capture stream taking place in parallel; controlling application might need to take advantage of <a href="http://msdn.microsoft.com/en-us/library/dd389144%28VS.85%29.aspx">IAMBufferNegotiation::SuggestAllocatorProperties</a> and request shorter buffers.</li>
<li>a filter, such as for example DMO Wrapper Filter, may default to 1 buffer on allocator, which means that if a buffer reference is for some reason held for future reference (e.g. a video filter might be holding a reference to be able to re-push a video sample if an application is requesting video update), the entire streaming might lock.</li>
<li>some filters are requesting unreasonably many/large buffers and consume vast spaces of RAM, such as MainConcept MXF Demultiplexer requesting 200 buffers x 640 kilobytes each (128 MB in total out of sudden)</li>
<li>some filters are requesting unreasonably few/small buffers resulting in inability to pre-buffer data</li>
</ol>
<p>In a chase for answers to questions &#8220;Where is my memory?&#8221;, &#8220;Why is it so choppy?&#8221;, &#8220;I would really appreciate a nice lipsync&#8221; and to troubleshoot the mentioned scenarios it is helpful to understand buffering configuration. DirectShow Filter Spy is here to deliver this information. Once the graph is put into running state, spy prints out topology data into log file (which is in most cases C:\ProgramData\DirectShowSpy.log):</p>
<pre>Pin 2: Name "Input 01", Direction "Input", Peer "Tee 0x087A5AF0.Output2"
 Connection media type:
 majortype {73646976-0000-0010-8000-00AA00389B71}, subtype {31435641-0000-0010-8000-00AA00389B71}, pUnk 0x00000000
 bFixedSizeSamples 0, bTemporalCompression 0, lSampleSize 1
 formattype {E06D80E3-DB46-11CF-B4D1-00805F6CBBEA}, cbFormat 170, pbFormat 0x07c46fc0
pbFormat as MPEG2VIDEOINFO:
 rcSource { 0, 0, 0, 0 ), rcTarget { 0, 0, 0, 0 }
 dwBitRate 0, dwBitErrorRate 0, AvgTimePerFrame 0
 dwInterlaceFlags 0x0, dwCopyProtectFlags 0x0, dwPictAspectRatioX 16, dwPictAspectRatioY 9, dwControlFlags 0x0
 bmiHeader.biSize 40, bmiHeader.biWidth 1280, bmiHeader.biHeight 720, bmiHeader.biPlanes 1, bmiHeader.biBitCount 24, bmiHeader.biCompression avc1
 bmiHeader.biSizeImage 0, bmiHeader.biXPelsPerMeter 1, bmiHeader.biYPelsPerMeter 1, bmiHeader.biClrUsed 0, bmiHeader.biClrImportant 0
 dwStartTimeCode 0x00000000, cbSequenceHeader 38, dwProfile 100, dwLevel 31, dwFlags 0x4
 [0x0000] 00 1D 67 64 00 1F AC 24 88 05 00 5B BF F0 00 10
 [0x0010] 00 11 00 00 03 03 E8 00 00 E9 BA 0F 18 32 A0 00
 [0x0020] 05 68 EE 32 C8 B0
<strong><span style="text-decoration: underline;"> Memory Allocator: 1 buffers, 1,024 bytes each (1,024 bytes total), align 1, prefix 0</span></strong></pre>
<p>Partial Visual C++ .NET 2008 source code is <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy">available  from SVN</a>, release binary included (<a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/Win32/DirectShowSpy.dll?format=raw">Win32</a>,  <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/x64/DirectShowSpy.dll?format=raw">x64</a>);  installation instructions are in <a href="http://alax.info/blog/777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1168/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

