|
|
|
date: Mon, 7 Jul 2008 11:43:01 -0700,
group: microsoft.public.win32.programmer.directx.video
back
Re: Direcshow problems with WMV9 Decoder for XP platform
Hi Alessandro,
setting the synchPoint worked thanks so much.
BUT ... it only displays one frame (the first one) for some reason. Is there
anything else I should be setting on the IMediaSample ?
Also on the encoder side, the first frame as a synchPoint set to FALSE and
the rest of the frames are all TRUE.
Thanks,
Kristine
"Kris" wrote:
> Me again ...
>
> Looking at the custom filter code I see that SetActualDataLength is about
> the only thing that was set on the IMediaSample. This was done on the
> FillBuffer() method.
>
> Disregard the comment about how to access IMediaSample.
>
> Thanks for your help,
> Kristine
>
> "Kris" wrote:
>
> > So one the encoder side ... use IMediaSample::IsSyncPoint() (this is just a
> > true/false flag).
> >
> > Then when I get it on the receiver side use IMediaSample::SetSyncPoint
> > correct?
> >
> > Also how to I access the IMediaSample?
> >
> > Thanks for your help,
> > Kristine
> >
> > "Alessandro Angeli" wrote:
> >
> > > From: "Kris"
> > >
> > > > How do I transmit the syncpoint flag? By using
> > > > IMediaSample::SetSyncPoint?? Will this modify the actual
> > > > encoded stream for the decoder to read?
> > >
> > > Get the flag on the encoder side, transmit it to the decoder
> > > side, set it on the sample before deliverying it. The sample
> > > is metadata, it does not change the contents of the sample
> > > buffer.
> > >
> > > > Note that this scenario was working with a DIVX
> > > > decoder/encoder (in that scenario a laptop was used and
> > > > not a mobile).
> > >
> > > You've been lucky because the stream packing you had
> > > included the required metadata in the stream itself and the
> > > decoder you were using did not rely on the sample flags.
> > >
> > > In the general case, you need to replicate the whole media
> > > sample, not just its data buffer.
> > >
> > > --
> > > // Alessandro Angeli
> > > // MVP :: DirectShow / MediaFoundation
> > > // mvpnews at riseoftheants dot com
> > > // http://www.riseoftheants.com/mmx/faq.htm
> > >
> > >
> > >
> > >
> > >
> > >
date: Wed, 9 Jul 2008 08:50:03 -0700
author: Kris
Re: Direcshow problems with WMV9 Decoder for XP platform
Ah ... it's acutally not stuck on the first frame ... but playing in *super*
slow motion... like a minute to do movement changes.
"Kris" wrote:
> Hi Alessandro,
>
> setting the synchPoint worked thanks so much.
>
> BUT ... it only displays one frame (the first one) for some reason. Is there
> anything else I should be setting on the IMediaSample ?
>
> Also on the encoder side, the first frame as a synchPoint set to FALSE and
> the rest of the frames are all TRUE.
>
> Thanks,
> Kristine
>
> "Kris" wrote:
>
> > Me again ...
> >
> > Looking at the custom filter code I see that SetActualDataLength is about
> > the only thing that was set on the IMediaSample. This was done on the
> > FillBuffer() method.
> >
> > Disregard the comment about how to access IMediaSample.
> >
> > Thanks for your help,
> > Kristine
> >
> > "Kris" wrote:
> >
> > > So one the encoder side ... use IMediaSample::IsSyncPoint() (this is just a
> > > true/false flag).
> > >
> > > Then when I get it on the receiver side use IMediaSample::SetSyncPoint
> > > correct?
> > >
> > > Also how to I access the IMediaSample?
> > >
> > > Thanks for your help,
> > > Kristine
> > >
> > > "Alessandro Angeli" wrote:
> > >
> > > > From: "Kris"
> > > >
> > > > > How do I transmit the syncpoint flag? By using
> > > > > IMediaSample::SetSyncPoint?? Will this modify the actual
> > > > > encoded stream for the decoder to read?
> > > >
> > > > Get the flag on the encoder side, transmit it to the decoder
> > > > side, set it on the sample before deliverying it. The sample
> > > > is metadata, it does not change the contents of the sample
> > > > buffer.
> > > >
> > > > > Note that this scenario was working with a DIVX
> > > > > decoder/encoder (in that scenario a laptop was used and
> > > > > not a mobile).
> > > >
> > > > You've been lucky because the stream packing you had
> > > > included the required metadata in the stream itself and the
> > > > decoder you were using did not rely on the sample flags.
> > > >
> > > > In the general case, you need to replicate the whole media
> > > > sample, not just its data buffer.
> > > >
> > > > --
> > > > // Alessandro Angeli
> > > > // MVP :: DirectShow / MediaFoundation
> > > > // mvpnews at riseoftheants dot com
> > > > // http://www.riseoftheants.com/mmx/faq.htm
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
date: Wed, 9 Jul 2008 09:22:03 -0700
author: Kris
Re: Direcshow problems with WMV9 Decoder for XP platform
Acutally I think maybe the problem is on the encoder side. Looking at
wireshark it seems the packets are not sent very fast.
On the Pocket PC ... I have the following graph
hr = pFilterGraph->ConnectDirect(m_pCamOutPin , m_pBufferInPin, 0);
hr = pFilterGraph->ConnectDirect(m_pBufferOutPin , m_pEncoderInPin, 0);
hr = pFilterGraph->ConnectDirect(m_pEncoderOutPin , stackPin, 0);
Maybe the CLSID_BufferingFilter needs something set or causing the delay?
Thanks,
Kris
"Alessandro Angeli" wrote:
> From: "Kris"
>
> > sample flags (syncpoint, discontinuity, preroll) are set
> > as the same ...
> >
> > IMediaSample::GetTime() is not set on the receiver side
> > (it is set on the sending side). What values do I need to
> > set for the start and end time? Do I need to ship those
> > accross ?
>
> It depends on the exact graph (wjat is it?) but it would be
> better if you did.
>
> On the sender side, substract the start time of the first
> sample from the values (so that they are zero-based). On the
> receiver side, use the value as they are or, if you are a
> live source, add to them the graph's current reference clock
> time of when you deliver the first sample).
>
> You should still produce the 2 logs since they will give you
> clues on what is going on.
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> // http://www.riseoftheants.com/mmx/faq.htm
>
>
>
date: Wed, 9 Jul 2008 12:45:14 -0700
author: Kris
Re: Direcshow problems with WMV9 Decoder for XP platform
When I changed the complexity ... it was faster ... ~150ms instead of ~1100ms
in frame rate ... but the image was terrible ... it would be good for a
couple of frames ... then for a batch of them have huge pixelixations ...
Wow do you zero-based the system time. I am not certain how this is done.
I am not inverting the flags ... I am not doing any manipulation on them.
Just printing out the way they are ... see code below
HRESULT synchpoint;
HRESULT preroll;
HRESULT discontinuity;
synchpoint = sample->IsSyncPoint();
preroll = sample->IsPreroll();
discontinuity = sample->IsDiscontinuity();
fprintf(fp, "%s%ld%s%ld%s%ld%s",
" synchpoint: ", synchpoint,
" preroll: " , preroll,
" discontinuity: ", discontinuity, "\n" );
The problem why things are slow would be the encoder ... because when I
remove it ... my frame rate is much higher. Changing does make things faster
... though not fast enough and still have the quality problem.
"Alessandro Angeli" wrote:
> From: "Kris"
>
> > Here are the logs ... let me know if you want more info.
> > I did not print the getTime values from the receiving end
> > since it was not set.
>
> I asked you to normalize the system time so that it is
> zero-based, anyway...
>
> As clearly stated in the docs, IMediaSample::IsSyncPoint()
> returns an HRESULT, not a BOOL, where S_OK (0) means TRUE
> and S_FALSE (1) means FALSE, not the other way around, so
> you are inverting all the flags (and you should also handle
> other HRESULTs as errors). The same applies to the other
> flags.
>
> Look at the difference of the system time between
> consecutive frames: it is taking you on average 1300..1500
> millisecs (< 1 fps) to process a frame instead of < 66.7
> millis (15 fps).
>
> Either your code takes too long to process the frames or you
> are not dispatching window messages or the light is so low
> that the camera has a hard time shooting or the encoder is
> too slow (and you should change the complexity as I told you
> before).
>
> > A side question ... I was looking for other encoders
> > (other than WMV3) for the pocket pc but could not find
> > any. Do you know if others exits?
>
> It depends on the OEM.
>
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> // http://www.riseoftheants.com/mmx/faq.htm
>
>
>
>
date: Thu, 10 Jul 2008 13:47:01 -0700
author: Kris
|
|