|
|
|
date: Thu, 26 Jun 2008 12:21:01 -0700,
group: microsoft.public.win32.programmer.directx.video
back
Trying to wrap synchronous WM reader in filter
I have a simple source filter that uses the synchronous reader. The input
is a WMV file (no audio). My filter connects to the DMO WMV decoder.
However, when I run, I get no video. I used the Tee filter and dumped the
output and I see the the WMV payload is correct. I am concerned that I am
not getting the correct format information from the reader during
initialization. I notice that the ASF Reafer filter has the output type
WVC1, but enumerating the format types on the reader, I only get the RGB and
YUV formats for sub-types (I get WMMEDIATYPE_Video for major type). Also, I
notice that the ASF reader has much more video format info in the media type
on the video pin.
I suspect that I am not properly presenting the media type info to the WMV
decoder DMO. Any ideas?
Thanks.
hrx = m_pReader->GetOutputCount( &cOutputs );
for(DWORD i = 0; i < cOutputs; i++ )
{
WORD strmId = 0;
hr = m_pReader->GetStreamNumberForOutput(i, &strmId);
hr = m_pReader->SetReadStreamSamples(strmId, TRUE);
DWORD numFmts = 0;
hr = m_pReader->GetOutputFormatCount(i, &numFmts);
for(DWORD j = 0 ; j < numFmts; ++j)
{
CComPtr< IWMOutputMediaProps> pOutProps;
m_pReader->GetOutputFormat(i, j, &pOutProps);
hrx = pOutProps->GetMediaType(pWmMt, &propSize);
if( WMMEDIATYPE_Video == pWmMt->majortype)
{
// never get any of the WMV subtypes in here
if(pWmMt->subtype = WMMEDIASUBTYPE_WMV1)
}
AddOneProp(pOutProps);
}
date: Thu, 26 Jun 2008 12:21:01 -0700
author: jonathannah
Re: Trying to wrap synchronous WM reader in filter
From: "jonathannah"
> I have a simple source filter that uses the synchronous
> reader. The input is a WMV file (no audio). My filter
> connects to the DMO WMV decoder. However, when I run, I
> get no video. I used the Tee filter and dumped the
> output and I see the the WMV payload is correct. I am
> concerned that I am not getting the correct format
> information from the reader during initialization. I
> notice that the ASF Reafer filter has the output type
> WVC1, but enumerating the format types on the reader, I
> only get the RGB and YUV formats for sub-types (I get
> WMMEDIATYPE_Video for major type).
Since the WM[Sync]Reader is not a simple demuxer but it also
acts as a decoder, you get 2 sets of formats:
1. if you ask the profile, you get the compressed stream
format, which is the input to the decoder
2. if you ask the reader's output, you get the supported
decompressed formats, which are the output from the decoder
If you configure the reader to deliver compressed stream
samples, there will be no decoder, so you should use the
format you get from profile, otherwise one of the formats
you get from the reader's output. By default, the reader
delivers decompressed samples.
> Also, I notice that
> the ASF reader has much more video format info in the
> media type on the video pin.
What do you mean???
> hr = m_pReader->SetReadStreamSamples(strmId, TRUE);
> hr = m_pReader->GetOutputFormatCount(i, &numFmts);
> // never get any of the WMV subtypes in here
You are not supposed to. You are enumerating the second set,
but you asked the reader to deliver compressed sample, so
you should use the information in the profile. I can't even
imagine how you got your filter to connect to the WMV
decoder without a WMV media type...
Anyway, query the reader for IWMProfile, get the
IWMStreamConfig for your video stream and query it for
IWMMediaProps.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
date: Thu, 26 Jun 2008 17:04:22 -0400
author: Alessandro Angeli
Re: Trying to wrap synchronous WM reader in filter
"Alessandro Angeli" wrote:
> If you configure the reader to deliver compressed stream
> samples, there will be no decoder, so you should use the
> format you get from profile, otherwise one of the formats
> you get from the reader's output. By default, the reader
> delivers decompressed samples.
>
This works.
> > Also, I notice that
> > the ASF reader has much more video format info in the
> > media type on the video pin.
>
> What do you mean???
When I enum the media formats on the ASF source filter, I get two format
sets (shown below), but from the IWMMediaProps, I only get one format. Also,
if I look at the prop dialog for the decoder dmo connected to the readers,
the displayed values are very different. The ASF reader shows a guid for the
subtype (WMV1), mine shows the text "WMV1". The ASF rdr shows format WVC1,
mine shows "RGB). The Asf rdr shows rcSrc, rcDest, aspect ration, interlace
format, and ctrl flags. My source only shows rcSrc and rcDest. I am
convinced that this format issue is why no video is displayed.
// Enum media types for ASF reader gives two items
maj= MEDIATYPE_Video
sub = WMMEDIASUBTYPE_WVC
format = FORMAT_VideoInfo2
maj= MEDIATYPE_Video
sub = WMMEDIASUBTYPE_WVC
format = FORMAT_VideoInfo
date: Thu, 26 Jun 2008 19:07:01 -0700
author: jonathannah
Re: Trying to wrap synchronous WM reader in filter
From: "jonathannah"
> When I enum the media formats on the ASF source filter, I
> get two format sets (shown below), but from the
Do you mean by calling IPin::EnumMediaTypes() on the output
oin of the WmAsfReader filter?
> IWMMediaProps, I only get one format.
Do you mean the IWMMediaProps you get from the
IWMStreamConfig retrieved from the IWMProfile of the
WMSyncReader object? Or what else?
> Also, if I look at
> the prop dialog for the decoder dmo connected to the
> readers, the displayed values are very different. The
> ASF reader shows a guid for the subtype (WMV1), mine
> shows the text "WMV1". The ASF rdr shows format WVC1,
What fields are you talking about exactly? You need to make
an effort and be specific because I can't guess.
> mine shows "RGB).
Where did you get that media type? Did your filter actually
connect to the DMO or not? The DMO does not accept an RGB
subtype.
> The Asf rdr shows rcSrc, rcDest,
> aspect ration, interlace format, and ctrl flags. My
> source only shows rcSrc and rcDest. I am convinced that
> this format issue is why no video is displayed.
It looks like the WmAsfReader (if that is what you mean by
"Asf rdr") is offering a FORMAT_VideoInfo2 while you are
offering a FORMAT_VideoInfo. It doesn't really make a
difference with compressed video (well, it depends on the
codec).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
date: Fri, 27 Jun 2008 15:24:16 -0400
author: Alessandro Angeli
Re: Trying to wrap synchronous WM reader in filter
First pint is that I can successfully connect to the decoder DMO. When I
play, I can see that the compressed video stream is beign delivered to the
DMO, but I do not get any video.
"Alessandro Angeli" wrote:
> What fields are you talking about exactly? You need to make
> an effort and be specific because I can't guess.
In GraphEdit, I use the input properties dialog for the WMV decoder DMO when
connected to my src filter and the ASF Reader filter.
When connected to my src filter, the DMO filter has the following info:
Major type: Video
Sub Type: WMV1
Format: RGB 720x480, 24 bits
rcSrc=(0,0,720,480)
rcDst=(0,0,720,480)
When connected to the ASF Reader filter, the DMO has the following info:
Major type: Video
Sub Type: {31435657-0000-0010-8000-00AA00389B71}
Format: WVC1 720x480, 24 bits
Aspect Ratio: 23040x12960
rcSrc=(0,0,720,480)
rcDst=(0,0,720,480)
CtrlFlags=00000000
I know that the media types I present to the decoder DMO are exactly
identical to the mediatypes that the ASF Reader supports. I do not
understand why the format on my filter is reported as RGB, but I suspect that
this is why I get no video. I suspect that the diplay of the GUID for VC1
(vs. WMV1 for my src) also suggests a problem.
Thanks.
date: Fri, 27 Jun 2008 13:21:03 -0700
author: jonathannah
|
|