Re: how to calculate cnsSampleTime
- From: "Alessandro Angeli" <nobody@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 21 Nov 2008 15:50:41 -0500
From: "oan"
I have live stream and I am saving it using
writestreamsample in onstreamsample method. everything
works fine when I use sampletime parameter except the
cases when the stream breaks and the reader is restarted.
let say, if i have a gap from 3:30 to 3:40 in the
incoming stream, in saved stream i should have the same
10 minutes gap. i wanted to set the sample time according
to the system time when the sample is written to solve
this issue. I didn't plan to use the system time as is,
but some calculation based on it.
Assuming that, when the reader restarts, the new sample
times restart from 0, simply add to them a costant offset
that is equals to the last timestamp before the break plus
the system time that elapsed from the break to the restart.
After the restart, you must also mark the first sample of
each stream with WM_SF_DISCONTINUITY. Hopefully that will
solve your problem.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
.
- References:
- how to calculate cnsSampleTime
- From: oan
- Re: how to calculate cnsSampleTime
- From: Alessandro Angeli
- Re: how to calculate cnsSampleTime
- From: oan
- how to calculate cnsSampleTime
- Prev by Date: Re: how to calculate cnsSampleTime
- Next by Date: Re: developing my own windows media server for live devices
- Previous by thread: Re: how to calculate cnsSampleTime
- Index(es):
Relevant Pages
|
Loading