<?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>Tue, 03 Aug 2010 09:48:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adobe Flash Media Live Encoder 3.1</title>
		<link>http://alax.info/blog/1138</link>
		<comments>http://alax.info/blog/1138#comments</comments>
		<pubDate>Sat, 24 Jul 2010 08:02:59 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[crap]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[FMLE]]></category>
		<category><![CDATA[garbage]]></category>
		<category><![CDATA[media]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1138</guid>
		<description><![CDATA[It is the first time ever &#8211; because probably I am not as experienced as Geraint &#8211; I witness availability of IMediaSample interface without availability of IMediaSample2. One might be curious what kind of software could provide such a weirdo in 2010? It is latest and greatest Adobe Flash Media Live Encoder 3.1.
Additionally to this, [...]]]></description>
			<content:encoded><![CDATA[<p>It is the first time ever &#8211; because probably I am not as experienced as <a href="http://www.gdcl.co.uk/">Geraint</a> &#8211; I witness availability of <a href="http://msdn.microsoft.com/en-us/library/dd407001%28VS.85%29.aspx">IMediaSample</a> interface without availability of <a href="http://msdn.microsoft.com/en-us/library/dd407002%28VS.85%29.aspx">IMediaSample2</a>. One might be curious what kind of software could provide such a weirdo in 2010? It is latest and greatest <a href="http://www.adobe.com/products/flashmediaserver/flashmediaencoder/">Adobe Flash Media Live Encoder 3.1</a>.</p>
<p>Additionally to this, they decided to provide garbage in <a href="http://msdn.microsoft.com/en-us/library/dd373477%28VS.85%29.aspx">AM_MEDIA_TYPE</a>::formattype field of <a href="http://msdn.microsoft.com/en-us/library/dd319788%28VS.85%29.aspx">IAMStreamConfig::SetFormat</a>. They perhaps learned that standard <a href="http://msdn.microsoft.com/en-us/library/dd317587%28VS.85%29.aspx">Audio Capture Filter</a> will ignore it anyway, so why bother then?</p>
<p>Having fixed that, <a href="http://alax.info/blog/859">Tone Source Filter</a> based virtual audio device is now compatible with <a href="http://www.adobe.com/products/flashmediaserver/flashmediaencoder/">Adobe Flash Media Live Encoder 3.1</a> and it is possible to send audio to remote Flash Media Server, e.g. such as <a href="http://www.ustream.tv/">Ustream.tv</a> service (over <a href="http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol">RTMP protocol</a>, as implemented by FMLE).</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/07/24-Image002.png"><img class="alignnone size-medium wp-image-1143" title="24-Image002" src="http://alax.info/blog/wp-content/uploads/2010/07/24-Image002-320x240.png" alt="24-Image002" width="320" height="240" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1138/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MediaTools: Two samples to capture M-JPEG video into JPEG files and to play JPEG files back</title>
		<link>http://alax.info/blog/1127</link>
		<comments>http://alax.info/blog/1127#comments</comments>
		<pubDate>Thu, 13 May 2010 06:15:48 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Media Tools]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[ip camera]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[M-JPEG]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1127</guid>
		<description><![CDATA[I added two new simple samples for the MediaTools DirectShow filters to demonstrate how to capture M-JPEG video feed, esp. from an IP camera, and write the video frames into sequence of JPEG files. The other sample takes a directory on the input and plays the images back as video. If you are working on [...]]]></description>
			<content:encoded><![CDATA[<p>I added two new simple samples for the MediaTools DirectShow filters to demonstrate how to capture M-JPEG video feed, esp. from an IP camera, and write the video frames into sequence of JPEG files. The other sample takes a directory on the input and plays the images back as video. If you are working on certain transformation filter, it is an easy way to make a reference feed and use it for debugging purposes.</p>
<p>The filters behind that empower the sample are described in <a href="http://alax.info/blog/741">another post</a>.</p>
<p><strong>RenderHttpMjpegVideoIntoFiles01</strong> sample takes an URL on the input to generate <a href="http://www.w3schools.com/media/media_mimeref.asp">image/jpeg JPEG</a> or <a href="http://en.wikipedia.org/wiki/Motion_JPEG">multipart/x-mixed-replace M-JPEG</a> stream. For example, it might be <a href="http://demo1.stardotcams.com/nph-mjpeg.cgi">http://demo1.stardotcams.com/nph-mjpeg.cgi</a> feed from a demo <a href="http://www.stardot.com/">StarDot Technologies</a> IP camera.</p>
<p>The application will create a new directory to write files into, and will save each new video frame received into new JPEG file.</p>
<pre>Z:\MediaTools\Samples\RenderHttpMjpegVideoIntoFiles01\Release&gt;RenderHttpMjpegVideoIntoFiles01.exe http://demo1.stardotcams.com/nph-mjpeg.cgi
URL: http://demo1.stardotcams.com/nph-mjpeg.cgi
Writing to directory: Z:\MediaTools\Samples\RenderHttpMjpegVideoIntoFiles01\Release\2010-05-12 22-07-37
Event: nCode EC_CLOCK_CHANGED 0xD, nParameter1 0x00000000, nParameter2 0x00000000
Event: nCode EC_PAUSED 0xE, nResult 0x00000000, nParameter2 0x00000000
[...]
^C</pre>
<p>The application will generate the files and convert media sample time stamps into file time.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/05/13-Image001.png"><img class="alignnone size-medium wp-image-1128" title="RenderHttpMjpegVideoIntoFiles01 Sample Output" src="http://alax.info/blog/wp-content/uploads/2010/05/13-Image001-320x175.png" alt="RenderHttpMjpegVideoIntoFiles01 Sample Output" width="320" height="175" /></a></p>
<p>The DirectShow graph that implements the operation is the following:</p>
<p><img class="alignnone size-full wp-image-1129" title="RenderHttpMjpegVideoIntoFiles01 Filter Graph" src="http://alax.info/blog/wp-content/uploads/2010/05/13-Image002.png" alt="RenderHttpMjpegVideoIntoFiles01 Filter Graph" width="661" height="346" /></p>
<p>The other sample <strong>RenderJpegFiles01</strong> takes a directory path to look for JPEG files, e.g. generated by previous sample, and pushes them into DirectShow graph as a video feed. File times will be converted [back] to media sample times.</p>
<p><span id="more-1127"></span></p>
<pre>Z:\MediaTools\Samples\RenderJpegFiles01\Release&gt;RenderJpegFiles01 "Z:\MediaTools\Samples\RenderHttpMjpegVideoIntoFiles01\Release\2010-05-12 22-07-37"
Directory: Z:\MediaTools\Samples\RenderHttpMjpegVideoIntoFiles01\Release\2010-05-12 22-07-37
Event: nCode EC_CLOCK_CHANGED 0xD, nParameter1 0x00000000, nParameter2 0x00000000
Event: nCode EC_PAUSED 0xE, nResult 0x00000000, nParameter2 0x00000000
Event: nCode EC_VMR_RECONNECTION_FAILED 0x55, nResult 0x80004005, nParameter2 0x00000000
Event: nCode EC_VMR_RENDERDEVICE_SET 0x53, RendererDeviceType 0x2, nParameter2 0x00000000
Event: nCode EC_VIDEO_SIZE_CHANGED 0xA, Extent 384x240, nParameter2 0x00000000
Event: nCode EC_COMPLETE 0x1, nResult 0x00000000, nParameter2 0x00000000
Event: nCode EC_ERRORABORT 0x3, nResult 0x80004005, nParameter2 0x00000000
Detected resolution change, new resolution is 1024x768, recreating filter graph...
Event: nCode EC_VMR_RECONNECTION_FAILED 0x55, nResult 0x80004005, nParameter2 0x00000000
Event: nCode EC_VMR_RENDERDEVICE_SET 0x53, RendererDeviceType 0x2, nParameter2 0x00000000
Event: nCode EC_VIDEO_SIZE_CHANGED 0xA, Extent 384x240, nParameter2 0x00000000
Event: nCode EC_CLOCK_CHANGED 0xD, nParameter1 0x00000000, nParameter2 0x00000000
Event: nCode EC_PAUSED 0xE, nResult 0x00000000, nParameter2 0x00000000</pre>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/05/13-Image003.png"><img class="alignnone size-medium wp-image-1130" title="RenderJpegFiles01 DirectShow Graph and Output" src="http://alax.info/blog/wp-content/uploads/2010/05/13-Image003-312x320.png" alt="RenderJpegFiles01 DirectShow Graph and Output" width="312" height="320" /></a></p>
<p>Download links:</p>
<ul>
<li>RenderHttpMjpegVideoIntoFiles01: <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/MediaTools/Samples/RenderHttpMjpegVideoIntoFiles01">source code</a>, <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/MediaTools/Samples/RenderHttpMjpegVideoIntoFiles01/Release/RenderHttpMjpegVideoIntoFiles01.exe?format=raw">binary</a></li>
<li>RenderJpegFiles01: <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/MediaTools/Samples/RenderJpegFiles01">source code</a>, <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/MediaTools/Samples/RenderJpegFiles01/Release/RenderJpegFiles01.exe?format=raw">binary</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1127/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DirectShow Spy: IAMFilterData interface</title>
		<link>http://alax.info/blog/1111</link>
		<comments>http://alax.info/blog/1111#comments</comments>
		<pubDate>Mon, 08 Feb 2010 18:47:28 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[mapper]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1111</guid>
		<description><![CDATA[This quick update for DirectShow Filter Graph Spy adds tracing for (deprecated) IAMFilterData interface, and also fixes problem with Media Player Classic &#8211; Home Cinema, when the player crashes in External Filters windows.
Partial Visual C++ .NET 2008 source code is available  from SVN, release binary included (Win32,  x64);  installation instructions are in [...]]]></description>
			<content:encoded><![CDATA[<p>This quick update for <a href="http://alax.info/blog/777">DirectShow Filter Graph Spy</a> adds tracing for (deprecated) <a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/dd389369%28VS.85%29.aspx">IAMFilterData</a> interface, and also fixes problem with <a href="http://www.xvidvideo.ru/media-player-classic-home-cinema-x86-x64/">Media Player Classic &#8211; Home Cinema</a>, when the player <a href="http://alax.info/blog/1100/comment-page-1#comment-5738">crashes in External Filters windows</a>.</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="http://alax.info/blog/777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1111/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DirectShow Spy: Filter Mapper Spy</title>
		<link>http://alax.info/blog/1100</link>
		<comments>http://alax.info/blog/1100#comments</comments>
		<pubDate>Thu, 24 Dec 2009 13:07:50 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[mapper]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1100</guid>
		<description><![CDATA[DirectShow Filter Graph Spy was updated to add new functionality: spying over another DirectShow object &#8211; Filter Mapper. Filter Mapper object is used for filter registration purposes and also internally by DirectShow&#8217;s Intelligent Connect. IFilterMapper2 interface traces provide detailed description on steps DirectShow takes in order to connect  and/or render filter pins. For example when [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://alax.info/777">DirectShow Filter Graph Spy</a> was updated to add new functionality: spying over another DirectShow object &#8211; <a href="http://msdn.microsoft.com/en-us/library/dd375788%28VS.85%29.aspx">Filter Mapper</a>. Filter Mapper object is used for filter registration purposes and also internally by DirectShow&#8217;s <a href="http://msdn.microsoft.com/en-us/library/ms940065.aspx">Intelligent Connect</a>. <a href="http://msdn.microsoft.com/en-us/library/dd390033%28VS.85%29.aspx">IFilterMapper2</a> interface traces provide detailed description on steps DirectShow takes in order to connect  and/or render filter pins. For example when trying to render <em>MEDIATYPE_Audio</em> pin, Filter Mapper suggested &#8220;RDP DShow Redirection Filter&#8221; and, then, &#8220;Default DirectSound Device&#8221;:</p>
<pre>
<pre style="background: #ffffff none repeat scroll 0% 0%; color: #000000; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">186</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> nFlags 0x0<span style="color: #808030;">,</span> bExactMatch <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> nMinimalMerit 0x00200001<span style="color: #808030;">,</span> bInputNeeded <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> nInputTypeCount <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> pInputPinCategory NULL<span style="color: #808030;">,</span> bRender <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> bOutputNeeded <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> nOutputTypeCount <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> pOutputPinCategory NULL
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">191</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> nInputTypeIndex <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> MajorType <span style="color: #808030;">{</span><span style="color: #008c00;">73647561</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0010</span><span style="color: #808030;">-</span><span style="color: #008c00;">8000</span><span style="color: #808030;">-</span>00AA00389B71<span style="color: #808030;">}</span><span style="color: #808030;">,</span> Subtype <span style="color: #808030;">{</span><span style="color: #008c00;">00000000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">000000000000</span><span style="color: #808030;">}</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">212</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> pMoniker @device<span style="color: #808030;">:</span>sw<span style="color: #808030;">:</span><span style="color: #808030;">{</span>083863F1<span style="color: #808030;">-</span>70DE<span style="color: #808030;">-</span>11D0<span style="color: #808030;">-</span>BD40<span style="color: #808030;">-</span>00A0C911CE86<span style="color: #808030;">}</span><span style="color: #808030;">\</span><span style="color: #808030;">{</span>AB9D6472<span style="color: #808030;">-</span>752F<span style="color: #808030;">-</span>43F6<span style="color: #808030;">-</span>B29E<span style="color: #808030;">-</span>61207BDA8E06<span style="color: #808030;">}</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">220</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> sFriendlyName <span style="color: #800000;">"</span><span style="color: #0000e6;">RDP DShow Redirection Filter</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDescription <span style="color: #800000;">"</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDevicePath <span style="color: #800000;">"</span><span style="color: #800000;">"</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">212</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> pMoniker @device<span style="color: #808030;">:</span>cm<span style="color: #808030;">:</span><span style="color: #808030;">{</span>E0F158E1<span style="color: #808030;">-</span>CB04<span style="color: #808030;">-</span>11D0<span style="color: #808030;">-</span>BD4E<span style="color: #808030;">-</span>00A0C911CE86<span style="color: #808030;">}</span><span style="color: #808030;">\</span>Default DirectSound Device
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">220</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> sFriendlyName <span style="color: #800000;">"</span><span style="color: #0000e6;">Default DirectSound Device</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDescription <span style="color: #800000;">"</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDevicePath <span style="color: #800000;">"</span><span style="color: #800000;">"</span></pre>
</pre>
<p>Important is that DirectShow&#8217;s internals are using the mapper through COM instantiation and this provides a safe method to override default behavior process wide in order to, for example, extend <a href="http://msdn.microsoft.com/en-us/library/ms940065.aspx">Intelligent Connect</a> functionality onto custom, unregistered globally, private filters.</p>
<p>Also, the binary is renamed from FilterGraphSpy.dll to DirectShowSpy.dll.</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/1100/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>DirectShow Filter Graph Spy: 64-bit version and hook API</title>
		<link>http://alax.info/blog/1094</link>
		<comments>http://alax.info/blog/1094#comments</comments>
		<pubDate>Sun, 01 Nov 2009 19:30:19 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[spy]]></category>
		<category><![CDATA[x64]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1094</guid>
		<description><![CDATA[Today&#8217;s update for DirectShow Filter Graph Spy introduces 64-bit version (mind the beta state) and a mini-API for an external module to be involved into graph building process.
Filter Graph Spy is offering three new interfaces that provide extensibility of the spy:

IFilterGraphAddRemoveHook
IFilterGraphConnectHook
IFilterGraphStateControlHook

The interfaces are contained in the type library and can be imported using #import directive. [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s update for DirectShow Filter Graph Spy introduces 64-bit version (mind the beta state) and a mini-API for an external module to be involved into graph building process.</p>
<p>Filter Graph Spy is offering three new interfaces that provide extensibility of the spy:</p>
<ul>
<li>IFilterGraphAddRemoveHook</li>
<li>IFilterGraphConnectHook</li>
<li>IFilterGraphStateControlHook</li>
</ul>
<p>The interfaces are contained in the type library and can be imported using <a href="http://msdn.microsoft.com/en-us/library/8etzzkb6%28VS.71%29.aspx">#import</a> directive. An implementation of one or more of these interfaces will receive hook style calls corresponding to respective <a href="http://msdn.microsoft.com/en-us/library/dd375786%28VS.85%29.aspx">Filter Graph Manager</a> calls, system wide including in context of other applications.</p>
<p>A COM object may be registered as a hook object with <em>Spy</em> and <em>NoThreadSpy</em> COM classes under predefined registry keys:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2009/11/02-Image001.png"><img class="alignnone size-medium wp-image-1095" title="Registering a DirectShow Filter Graph Spy Hook" src="http://alax.info/blog/wp-content/uploads/2009/11/02-Image001-320x136.png" alt="Registering a DirectShow Filter Graph Spy Hook" width="320" height="136" /></a></p>
<p>Spy will instantiate the registered hook objects and forward them the calls it receive, before passing them to system Filter Graph Manager object. A hook object has an option to override default processing, including, for example, inserting its own filter in between. For example, <a href="http://msdn.microsoft.com/en-us/library/dd390021%28VS.85%29.aspx">IFilterGraph::Reconnect</a> call is implemented the following way:</p>
<pre>
<pre style="background: #ffffff none repeat scroll 0% 0%; color: #000000;">STDMETHOD<span style="color: #808030;">(</span>Reconnect<span style="color: #808030;">)</span><span style="color: #808030;">(</span>IPin<span style="color: #808030;">*</span> pPin<span style="color: #808030;">)</span> <span style="color: #800000; font-weight: bold;">throw</span><span style="color: #808030;">(</span><span style="color: #808030;">)</span>
<span style="color: #800080;">{</span>
    _Z4<span style="color: #808030;">(</span>atlTraceCOM<span style="color: #808030;">,</span> <span style="color: #008c00;">4</span><span style="color: #808030;">,</span> _T<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">...</span><span style="color: #0f69ff;">\n</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
    HOOK_PROLOG<span style="color: #808030;">(</span>CFilterGraphConnectHookHost<span style="color: #808030;">)</span>
        OnReconnect<span style="color: #808030;">(</span>pT<span style="color: #808030;">,</span> pPin<span style="color: #808030;">,</span> <span style="color: #808030;">&amp;</span>bDefault<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
    HOOK_EPILOG<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
    <span style="color: #800000; font-weight: bold;">return</span> m_pInnerFilterGraph2<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>Reconnect<span style="color: #808030;">(</span>pPin<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
<span style="color: #800080;">}</span></pre>
</pre>
<p>Before passing the call to original Reconnect method, spy is iterating through associated hooks, passing them <em>IFilterGraphConnectHook::OnReconnect</em> call. Setting <em>bDefault</em> parameter to <em>FALSE</em> will prevent spy from passing the call to original method.</p>
<p>Included <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/BdaHooks">BdaHooks</a> project shows a sample implementation of the hooking COM classes (note <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/BdaHooks/ConnectHook.rgs">.rgs registration</a>).</p>
<p>Filter Graph Spy is compatible with all current Windows operating systems, 32-bit and 64-bit (<a href="http://en.wikipedia.org/wiki/X86-64">x64</a>), in particular including:</p>
<ul>
<li><a href="http://www.microsoft.com/windows/windows-7/">Windows 7</a></li>
<li>Windows Server 2008</li>
<li>Windows Vista</li>
<li>Windows Server 2003</li>
<li>Windows XP</li>
<li>Windows 2000</li>
</ul>
<p>NOTE: DirectShow Filter Graph Spy is <span style="text-decoration: underline;">NOT</span> suitable for production environment, it is <span style="text-decoration: underline;">NOT</span> licensed to be redistributed to be a part of production state software item.</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="http://alax.info/blog/777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1094/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to use windowless Video Mixing Renderer Filter to show video fullscreen</title>
		<link>http://alax.info/blog/1082</link>
		<comments>http://alax.info/blog/1082#comments</comments>
		<pubDate>Fri, 09 Oct 2009 17:04:27 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[WTL]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[IVideoWidow]]></category>
		<category><![CDATA[IVMRWindowlessControl]]></category>
		<category><![CDATA[renderer]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[VMR]]></category>
		<category><![CDATA[windowless]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1082</guid>
		<description><![CDATA[The question is being asked from time to time. Everyone knows what is full screen video. Video renderers implement full screen capability since long ago through their IVideoWindow::put_FullScreenMode property, and even Filter Graph Manager exposes its own IVideoWindow interface to forward calls to filter&#8217;s implementation of IVideoWindow interface.
However, for Video Mixing Renderers, version 7 and [...]]]></description>
			<content:encoded><![CDATA[<p>The question is being asked from time to time. Everyone knows what is full screen video. Video renderers implement full screen capability since long ago through their <a href="http://msdn.microsoft.com/en-us/library/dd377320(VS.85).aspx">IVideoWindow::put_FullScreenMode</a> property, and even <a href="http://msdn.microsoft.com/en-us/library/dd375786(VS.85).aspx">Filter Graph Manager</a> exposes its own <a href="http://msdn.microsoft.com/en-us/library/dd377276%28VS.85%29.aspx">IVideoWindow</a> interface to forward calls to filter&#8217;s implementation of <a href="http://msdn.microsoft.com/en-us/library/dd377276%28VS.85%29.aspx">IVideoWindow</a> interface.</p>
<p>However, for Video Mixing Renderers, version <a href="http://msdn.microsoft.com/en-us/library/dd407343(VS.85).aspx">7</a> and <a href="http://msdn.microsoft.com/en-us/library/dd407344%28VS.85%29.aspx">9</a>, the preferred and recommended mode is windowless, where no IVideoWindow interface is available.</p>
<blockquote><p><strong>Note</strong> The <a id="ctl00_MTCS_main_ctl01" onclick="javascript:Track('ctl00_MTCS_main_ctl00|ctl00_MTCS_main_ctl01',this);" href="http://msdn.microsoft.com/en-us/library/dd390536%28VS.85%29.aspx"><strong>IVMRWindowlessControl</strong></a> or <a id="ctl00_MTCS_main_ctl02" onclick="javascript:Track('ctl00_MTCS_main_ctl00|ctl00_MTCS_main_ctl02',this);" href="http://msdn.microsoft.com/en-us/library/dd390537%28VS.85%29.aspx"><strong>IVMRWindowlessControl9</strong></a> interface is now preferred over <strong>IVideoWindow</strong>. For more information, see <a id="ctl00_MTCS_main_ctl03" onclick="javascript:Track('ctl00_MTCS_main_ctl00|ctl00_MTCS_main_ctl03',this);" href="http://msdn.microsoft.com/en-us/library/dd407299%28VS.85%29.aspx">Using Windowless Mode</a>.</p></blockquote>
<p>So in order to implement full screen mode it takes the application to attach Video Mixing Renderer filter to a private frameless window, to its entire client area and expand the window to entire monitor area.</p>
<p>The sample project <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FullScreenWindowlessVmrSample01">FullScreenWindowlessVmrSample01</a> is illustrating this technique.</p>
<p><img class="alignnone size-full wp-image-1083" title="FullScreenWindowlessVmrSample01 Main Dialog" src="http://alax.info/blog/wp-content/uploads/2009/10/09-Image001.png" alt="FullScreenWindowlessVmrSample01 Main Dialog" width="489" height="141" /></p>
<p><span id="more-1082"></span>Main application dialog owns a special window to host renderer, implemented by CRendererDialog class.</p>
<pre>
<pre style="background: #ffffff none repeat scroll 0% 0%; color: #000000;"><span style="color: #800000; font-weight: bold;">class</span> CRendererDialog <span style="color: #800080;">:</span>
    <span style="color: #800000; font-weight: bold;">public</span> CDialogImpl<span style="color: #800080;">&lt;</span>CRendererDialog<span style="color: #800080;">&gt;</span>
<span style="color: #800080;">{</span>
<span style="color: #800000; font-weight: bold;">public</span><span style="color: #e34adc;">:</span>

    <span style="color: #800000; font-weight: bold;">enum</span> <span style="color: #800080;">{</span> IDD <span style="color: #808030;">=</span> IDD_RENDERER <span style="color: #800080;">}</span><span style="color: #800080;">;</span>

BEGIN_MSG_MAP_EX<span style="color: #808030;">(</span>CRendererDialog<span style="color: #808030;">)</span>
    MSG_WM_INITDIALOG<span style="color: #808030;">(</span>OnInitDialog<span style="color: #808030;">)</span>
    MSG_WM_DESTROY<span style="color: #808030;">(</span>OnDestroy<span style="color: #808030;">)</span>
    MSG_WM_ERASEBKGND<span style="color: #808030;">(</span><span style="color: #400000;">OnEraseBkgnd</span><span style="color: #808030;">)</span>
    MSG_WM_PAINT<span style="color: #808030;">(</span>OnPaint<span style="color: #808030;">)</span>
    MSG_WM_DISPLAYCHANGE<span style="color: #808030;">(</span>OnDisplayChange<span style="color: #808030;">)</span>
    MSG_WM_KEYDOWN<span style="color: #808030;">(</span>OnKeyDown<span style="color: #808030;">)</span>
    COMMAND_ID_HANDLER_EX<span style="color: #808030;">(</span>IDCANCEL<span style="color: #808030;">,</span> OnCancel<span style="color: #808030;">)</span>
END_MSG_MAP<span style="color: #808030;">(</span><span style="color: #808030;">)</span>

<span style="color: #800000; font-weight: bold;">private</span><span style="color: #e34adc;">:</span>
    CMainDialog<span style="color: #808030;">&amp;</span> m_Owner<span style="color: #800080;">;</span>
<span style="color: #696969;">//...</span></pre>
</pre>
<p>The dialog template does not have a caption, it has no frame and has its window rectangle equal to client area. As a result, spanning the Video Mixing Renderer to the entire client area and proper positioning of the dialog window is showing video on the entire monitor.</p>
<pre>
<pre style="background: #ffffff none repeat scroll 0% 0%; color: #000000;">ATLVERIFY<span style="color: #808030;">(</span>m_RendererDialog<span style="color: #808030;">.</span>Create<span style="color: #808030;">(</span>m_hWnd<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
ATLVERIFY<span style="color: #808030;">(</span>m_RendererDialog<span style="color: #808030;">.</span><span style="color: #400000;">MoveWindow</span><span style="color: #808030;">(</span>MonitorData<span style="color: #808030;">.</span>m_Position<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
m_RendererDialog<span style="color: #808030;">.</span><span style="color: #400000;">ShowWindow</span><span style="color: #808030;">(</span>SW_SHOWNORMAL<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
<span style="color: #696969;">// ...</span>
ATLENSURE_SUCCEEDED<span style="color: #808030;">(</span>pVmrWindowlessControl<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>SetVideoClippingWindow<span style="color: #808030;">(</span>m_RendererDialog<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
ATLENSURE_SUCCEEDED<span style="color: #808030;">(</span>pVmrWindowlessControl<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>SetVideoPosition<span style="color: #808030;">(</span><span style="color: #7d0045;">NULL</span><span style="color: #808030;">,</span> m_RendererDialog<span style="color: #808030;">.</span>GetVideoPosition<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span></pre>
</pre>
<p>Visual C++ .NET 2008 source code is <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FullScreenWindowlessVmrSample01">available from SVN</a>, release binary <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FullScreenWindowlessVmrSample01/Release/FullScreenWindowlessVmrSample01.exe?format=raw">included</a>. The project is using ATL and <a href="http://wtl.sourceforge.net/">WTL</a> libraries.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1082/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to make a constant frame rate video stream from variable frame rate stream, and rescale it</title>
		<link>http://alax.info/blog/1080</link>
		<comments>http://alax.info/blog/1080#comments</comments>
		<pubDate>Thu, 08 Oct 2009 16:51:15 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[fps]]></category>
		<category><![CDATA[frame rate]]></category>
		<category><![CDATA[resolution]]></category>
		<category><![CDATA[time stamp]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1080</guid>
		<description><![CDATA[From a conversation:
I have a  video stream with variable frame rate, I want to make this in to a constant  frame rate. Do you know of any filters that could help me with this?
Such filter is actually quite easy. You only need to update time stamps of the media samples that are going through. [...]]]></description>
			<content:encoded><![CDATA[<p>From a conversation:</p>
<blockquote><p>I have a  video stream with variable frame rate, I want to make this in to a constant  frame rate. Do you know of any filters that could help me with this?</p></blockquote>
<p>Such filter is actually quite easy. You only need to update time stamps of the media samples that are going through. I am not aware of  an &#8220;out of the box&#8221; ready filter, but you can even do it without special filter: if you build your graph with <a href="http://msdn.microsoft.com/en-us/library/dd377544%28VS.85%29.aspx">Sample Grabber Filter</a> in it in  the place of interest, and initialize it to have a callback for each sample, then in <a href="http://msdn.microsoft.com/en-us/library/dd376987%28VS.85%29.aspx">SampleCB</a> method you will be able to update time stamps using methods of <a href="http://msdn.microsoft.com/en-us/library/dd407001%28VS.85%29.aspx">IMediaSample</a> interface. This is sufficient to redistribute the frames on the timeline, so that they go at constant frame rate.</p>
<blockquote><p>In your opinion what is the best way to scale the video?</p></blockquote>
<p>The best depends on what is the criteria (speed, quality etc). The simplest for me while very efficient &#8211; and I did this a number of times &#8211; is to use a custom filter which inside it uses <a href="http://msdn.microsoft.com/en-us/library/dd145120%28VS.85%29.aspx">StretchBlt</a> <a href="http://msdn.microsoft.com/en-us/library/dd145120%28VS.85%29.aspx" target="_blank"></a> function on a per frame basis to scale input RGB video into output RGB video of a different resolution.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1080/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectShow Filter Graph Spy: Log Filters and Connection Media Types</title>
		<link>http://alax.info/blog/1078</link>
		<comments>http://alax.info/blog/1078#comments</comments>
		<pubDate>Tue, 06 Oct 2009 19:26:23 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1078</guid>
		<description><![CDATA[Having hard time to connect to remote filter graph on Windows 7 machine, I suspected that some of the filters do not like being connected through marshaling and freeze. Or, actually more likely, it is SDK&#8217;s proppage.dll which hosts proxy stub pairs behaves itself in a not quite expected way and freezes remote application (Graph [...]]]></description>
			<content:encoded><![CDATA[<p>Having hard time to connect to remote filter graph on Windows 7 machine, I suspected that some of the filters do not like being connected through marshaling and freeze. Or, actually more likely, it is SDK&#8217;s proppage.dll which hosts proxy stub pairs behaves itself in a not quite expected way and freezes remote application (Graph Edit or similar) during attempt to connect to remote graph.</p>
<p>As the goal was to find out details about connection media types between the filters being spied over, the spy received a new feature of logging graph details each time the graph is going to running state:</p>
<blockquote>
<pre>Filter 7: Name "[1BDADev]", Class {17CCA71B-ECD7-11D0-B908-00A0C9223196}, State 2
 Pin 1: Name "MPEG2 Transport", Direction "Input", Peer "[0BDATnr].MPEG2 Transport"
 Connection media type:
 majortype {E436EB83-524F-11CE-9F53-0020AF0BA770}, subtype {E06D8023-DB46-11CF-B4D1-00805F6CBBEA}, pUnk 0x00000000
 bFixedSizeSamples 0, bTemporalCompression 0, lSampleSize 1
 formattype {8DEDA6FD-AC5F-4334-8ECF-A4BA8FA7D0F0}, cbFormat 24, pbFormat 0x00350868
 [0x0000] BC 00 00 00 38 9A 00 00 00 00 00 00 00 00 00 00
 [0x0010] 00 00 00 00 00 00 00 00
 Pin 2: Name "MPEG2 Transport", Direction "Output", Peer "Infinite Pin Tee Filter[BDATsIft].Input"
 Connection media type:
 majortype {E436EB83-524F-11CE-9F53-0020AF0BA770}, subtype {F4AEB342-0329-4FDD-A8FD-4AFF4926C978}, pUnk 0x00000000
 bFixedSizeSamples 1, bTemporalCompression 0, lSampleSize 39480
 formattype {0F6417D6-C318-11D0-A43F-00A0C9223196}, cbFormat 0, pbFormat 0x00000000
Filter 8: Name "[0BDATnr]", Class {17CCA71B-ECD7-11D0-B908-00A0C9223196}, State 2
 Pin 1: Name "Input0", Direction "Input", Peer "Microsoft Network Provider[NwPvd].Antenna Out"
 Connection media type:
 majortype {71985F41-1CA1-11D3-9CC8-00C04F7971E0}, subtype {E436EB8E-524F-11CE-9F53-0020AF0BA770}, pUnk 0x00000000
 bFixedSizeSamples 0, bTemporalCompression 0, lSampleSize 1
 formattype {0F6417D6-C318-11D0-A43F-00A0C9223196}, cbFormat 0, pbFormat 0x00000000
 Pin 2: Name "MPEG2 Transport", Direction "Output", Peer "[1BDADev].MPEG2 Transport"
 Connection media type:
 majortype {E436EB83-524F-11CE-9F53-0020AF0BA770}, subtype {E06D8023-DB46-11CF-B4D1-00805F6CBBEA}, pUnk 0x00000000
 bFixedSizeSamples 0, bTemporalCompression 0, lSampleSize 1
 formattype {8DEDA6FD-AC5F-4334-8ECF-A4BA8FA7D0F0}, cbFormat 24, pbFormat 0x00350868
 [0x0000] BC 00 00 00 38 9A 00 00 00 00 00 00 00 00 00 00
 [0x0010] 00 00 00 00 00 00 00 00</pre>
</blockquote>
<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 <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/FilterGraphSpy.dll?format=raw">included</a>; installation instructions are in <a href="http://alax.info/blog/777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1078/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectShow Related Bugs: MediaLooks MPEG-2 Video Decoder, Haali Media Splitter (AR)</title>
		<link>http://alax.info/blog/1064</link>
		<comments>http://alax.info/blog/1064#comments</comments>
		<pubDate>Sat, 03 Oct 2009 06:50:03 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[decoder]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filters]]></category>
		<category><![CDATA[haali]]></category>
		<category><![CDATA[medialooks]]></category>
		<category><![CDATA[message]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1064</guid>
		<description><![CDATA[An attempt to render media file in GraphStudio ended up with an error message:
Protection
A monitor program has been foun drunning in your system. Please unload it from memory and restart your program.
The module which popped up the message chose to not identify itself in a friendly manner, however as nothing goes untraceable it appeared to [...]]]></description>
			<content:encoded><![CDATA[<p>An attempt to render media file in <a href="http://blog.monogram.sk/janos/tools/monogram-graphstudio/">GraphStudio</a> ended up with an error message:</p>
<blockquote><p>Protection<br />
A monitor program has been foun drunning in your system. Please unload it from memory and restart your program.</p></blockquote>
<p>The module which popped up the message chose to not identify itself in a friendly manner, however as nothing goes untraceable it appeared to be <a href="http://www.medialooks.com">MediaLooks</a> MPEG-2 Video Decoder file, Mpeg2DecoderL.dll (version 1.0.3.9). As the message was popped up from a non-GUI thread, there was no way to close the box &#8211; the entire application froze&#8230;</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2009/10/03-Image001.png"><img class="alignnone size-medium wp-image-1065" title="MediaLooks MPEG-2 Video Decoder Error Message" src="http://alax.info/blog/wp-content/uploads/2009/10/03-Image001-320x166.png" alt="MediaLooks MPEG-2 Video Decoder Error Message" width="320" height="166" /></a></p>
<p>The problem does not happen in <a href="http://msdn.microsoft.com/en-us/library/dd390950%28VS.85%29.aspx">GraphEdit</a>, as the decoder is probably handling this case specifically.</p>
<p>The decoder has an deinstallation batch file located in application directory: C:\Program Files\MediaLooks\Mpeg2Decoder\Uninstall.bat. A curious thing, however, is that running this file in attempt to uninstall the decoder shows the same problem: the decoder refuses to be uninstalled due to mystic &#8220;monitor program&#8221; running in the system:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2009/10/03-Image002.png"><img class="alignnone size-medium wp-image-1066" title="MediaLooks MPEG-2 Video Decoder Deinstallation Failure" src="http://alax.info/blog/wp-content/uploads/2009/10/03-Image002-320x96.png" alt="MediaLooks MPEG-2 Video Decoder Deinstallation Failure" width="320" height="96" /></a></p>
<p>After closing the message box the application still continues deinstallation script and removes the decoder from system.</p>
<p>Another issue for this file (and hopefully for today) is that another filter <a href="http://haali.cs.msu.ru/mkv/">Haali Media Splitter (AR)</a> (splitter.ax, version 1.9.42.1) is crashing the hosting process on being removed from the graph.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2009/10/03-Image003.png"><img class="alignnone size-medium wp-image-1067" title="Haali Media Splitter Crash" src="http://alax.info/blog/wp-content/uploads/2009/10/03-Image003-320x172.png" alt="Haali Media Splitter Crash" width="320" height="172" /></a> <a href="http://alax.info/blog/wp-content/uploads/2009/10/03-Image004.png"><img class="alignnone size-medium wp-image-1068" title="Haali Media Splitter Crash" src="http://alax.info/blog/wp-content/uploads/2009/10/03-Image004-320x122.png" alt="Haali Media Splitter Crash" width="320" height="122" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1064/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to dynamically change resolution for video preview</title>
		<link>http://alax.info/blog/1061</link>
		<comments>http://alax.info/blog/1061#comments</comments>
		<pubDate>Wed, 30 Sep 2009 16:28:08 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[bridge]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[question]]></category>
		<category><![CDATA[resolution]]></category>
		<category><![CDATA[split]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1061</guid>
		<description><![CDATA[From a conversation:
Q: I am using Web camera with DirectShow. Camera has only capture pin, so I am looking for the best way to switch resolution on the pin while graph is running. I would like to keep preview with smaller image size and when i would like to capture an image i would like [...]]]></description>
			<content:encoded><![CDATA[<p>From a conversation:</p>
<blockquote><p><span id=":1t8" dir="ltr">Q: I am using Web camera with DirectShow. </span>Camera has only capture pin, so I am looking for the best way to switch resolution on the pin while graph is running. I would like to keep preview with smaller image size and when i would like to capture an image i would like to switch to full resolution. I have to use sample grabber callback since i need access to single image to process them. Is there a way to do that without stopping and starting a graph? This works but very slow between captures.</p></blockquote>
<p><span id=":1sb" dir="ltr">Is it possible to just reconnect the sample grabber only with new media changes and then resume the graph? Currently i just kill the graph and start it again, but it takes few seconds to do so, so I am looking the way to reduce that time.</span></p>
<p><span id=":1rj" dir="ltr">There is no way to switch resolution on the running graph. There is a technique to dynamically start/stop individual filters and re-negotiate resolutions (media types), but it does not work for the majority of filters. </span><span id=":1rl" dir="ltr">Additionally to that <a href="http://msdn.microsoft.com/en-us/library/dd377544%28VS.85%29.aspx">Sample Grabber </a></span><a href="http://msdn.microsoft.com/en-us/library/dd377544%28VS.85%29.aspx"><span id=":1rl" dir="ltr">Filter</span></a><span id=":1rl" dir="ltr"><a href="http://msdn.microsoft.com/en-us/library/dd377544%28VS.85%29.aspx"></a> cannot change resolution too, as it passes data through.</span></p>
<p><span id=":1u4" dir="ltr">If you only have to use switched resolution for preview, you can use <a href="http://www.gdcl.co.uk/gjd.htm">Geraint&#8217;s</a> <a href="http://www.gdcl.co.uk/gmfbridge/index.htm">GMFBridge Toolkit</a> to join two graphs, and a filter that changes resolution. Combining all that you will have a running capture graph that [also] renders video to a bridge sink. </span>In the other graph you have another bridge sink that receives video from first graph and then you resize video to the resolution of interest already in the second graph. You can stop and reconfigure only second graph to update resolution and have first graph running and capturing. This is the best you can do, or just stop your single graph and change resolution this simple way.</p>
<p>So a solution, which is used by many, and I can recommend it too, is to use <span id=":1u4" dir="ltr"><a href="http://www.gdcl.co.uk/gmfbridge/index.htm">GMFBridge</a></span> bridging. Additionally, <span id=":1tv" dir="ltr">you can find questions and answers on it on <a href="http://social.msdn.microsoft.com/forums/en-US/windowsdirectshowdevelopment/threads/?filter=unread">MSDN DirectShow Development Forum</a> (search for &#8220;bridge&#8221; there). W</span><span id=":1tv" dir="ltr">ith a certain effort you can duplicate this with your own code but this is more or less ready to use solution and</span>, again, the key advantage you have that you have two graphs which you can top independently.</p>
<blockquote><p><span id=":1tc" dir="ltr">Would it be possible to use smart tee as a splitter on the capture pin, and then use two sample grabbers on capture and preview, one with smaller resolution and the other one with higher one?</span></p></blockquote>
<p><span id=":1tt" dir="ltr">With a <a href="http://msdn.microsoft.com/en-us/library/dd377612%28VS.85%29.aspx">Smart Tee Filter</a> you will still have 1 graph, so no individual resolution changes without stopping the graph. Additionally to that, Smart Tee Filter will deliver same frame on its output pins, so they will have to have one resolution and no resizing takes place inside.</span></p>
<blockquote><p><span dir="ltr">Also, </span><span id=":1sg" dir="ltr">is it possible to run 2 graphs in the same time? Same device, 2 graphs, 2 sample grabbers.</span></p></blockquote>
<p><span id=":1u8" dir="ltr">Most likely no, for only one reason: you won&#8217;t be able to have two running filters for the same device, as source filter will exclusively lock the device.</span><span dir="ltr"> </span> <span id=":1tf" dir="ltr">So capture filter will be a single filter. You can use <a href="http://msdn.microsoft.com/en-us/library/dd390336%28VS.85%29.aspx">Infinite Tee Pin Filter</a> to split stream between 2+ processing lines. And you can use the same bridge to pass data into another graph for further processing.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1061/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
