Thanks Alessandro Angeli.
I can play video using WMASFReader Filter.
Post by Alessandro AngeliFrom: "jack123"
Post by jack123I set up a broadcast session with Windows Media Encoder.
My URL is something like http://127.0.0.1:8080.
I can open this Url in Windows Media player, video is
working fine. How can I open this Url in Directshow.
You need to use the WMASFReader filter. However, by default
the HTTP protocol is handled by the URLReader filter, which
won't work with a WMSP source like WME.
However, an HTTP URL which ends with a WM extension (e.g.
ASF, WMA, WMV...) will be handled by the WMASFReader. So you
can just use
http://127.0.0.1:8080/ignore.wmv
to make it work with IGraphBuilder::AddSourceFilter() or
IGraphBuilder::RenderFile(), since WME ignores the path URI.
Otherwise, you can manually use the WMASFReader (in
IGraphBuilder* pGrfBuilder;
IBaseFilter* pAsfFilter
=
CoCreateInstance(CLSID_WMAsfReader,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter);
pGrfBuilder->AddFilter(pAsfFilter,NULL);
IFileSourceFilter* pAsfSource
= pAsfFilter->QueryInterface(IID_IFileSourceFilter);
pAsfSource->Load(L"http://127.0.0.1:8080",NULL);
IEnumPins* pAsfPins
= pAsfFilter->EnumPins();
while(IPin* pAsfPin = pAsfPins->Next(1)) {
pGrfBuilder->Render(pAsfPin);
}
You could also change the "Source Filter" value in the
[HKEY_CLASSES_ROOT\http] registry key to point to the
WMASFReader CLSID, but it would be a very bad idea. Or you
could set the TreatAs key in the URLReader registration
(manually or through CoTreatAsClass()), but this is also a
global change and thus a bad idea.
You could also locally redirect the URLReader's CLSID to the
WMASFReader using RegisterClassObject(). This is still
process-wide, but at least not system-wide or permanent.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
.