Log in

View Full Version : Does DirectShowSource() accept VIH2?


zambelli
7th July 2006, 10:02
Hopefully someone knows the answer to this off top of their head so I don't have to dig through the source code... :)

Does DirectShowSource() accept VIH2 (VideoInfoHeader2 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/videoinfoheader2structure.asp)) output types, or is it limited to VIH only?

IanB
8th July 2006, 04:02
In the current 2.5.7 directshow_source.cpp see from line 818 (esp line 867!)

It currently acceptsAM_MEDIA_TYPE.majortype == MEDIATYPE_Video
and AM_MEDIA_TYPE.subtype == MEDIASUBTYPE_{YV12, YUY2, RGB24, RGB32 or ARGB32}
and (AM_MEDIA_TYPE.formattype == FORMAT_VideoInfo
or AM_MEDIA_TYPE.formattype == FORMAT_VideoInfo2)Any thoughts on improving the algorithm would be appreciated.

zambelli
8th July 2006, 21:56
Excellent! Thanks a lot for the info, Ian.

At Microsoft we are making a change in WMV decoder where starting in v11 (Vista and XP) VIH2 will be the preferred output. Up until now it was VIH only and so aspect ratio and interlacing flags never got passed downstream in DirectShow graphs. We're working on eliminating any potential compatibility problems with VIH-only applications. Looks like AviSynth is safe, but I'll give you a heads up anyway if any compatibility issues arise.

IanB
9th July 2006, 07:14
As I hinted in some other (audio) post recently, bidding your best format first (VIH2) and letting older clients reject the connection, then bidding a more compatible format (VIH) avoids incompatibility issues in directshow.

Of course the challenge now becomes how best to expose all these new attributes to the script world. ;-)

Sulik
9th July 2006, 15:55
The biggest problem might be application that rely on the sample grabber, since it only supports VIH and not VIH2.

IanB
10th July 2006, 05:54
And as long as the filter eventually bids a pin connection offer with AM_MEDIA_TYPE.formattype == FORMAT_VideoInfo the application will still work.