Re: how to calculate cnsSampleTime



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


.



Relevant Pages

  • Re: [PATCH 10/30] cr: core stuff
    ... You can do many nice things when the checkpoint can be streamed: ... transform the stream from one c/r version to another etc. ... kernel doesn't know in which order to dump A and B. ... if tidy-bits issues to solve during restart regardless. ...
    (Linux-Kernel)
  • Re: WMS does not restart automatically
    ... > Windows media serves does not automatically restart when the source stream ... > fails and restarts the Media services does not restart the broadcast. ... > monitor tab states that the publishing point is started, but the stream has ... > restart the publishing point. ...
    (microsoft.public.windowsmedia.server)
  • Re: Time setting in my Wince device
    ... Chris Tacke, Embedded MVP ... I was able to change the system time using SetSystemTime. ... application even when i restart. ... But once i connect the Active sync my system time is changing to some ...
    (microsoft.public.windowsce.app.development)
  • Re: Media Services - Automatic Restart of PublishigPoint?
    ... In this way the publishing point never stops. ... I am streaming a live stream from a remote distribution server. ... possibility to automatically restart a publishing point after the publishing ...
    (microsoft.public.windowsmedia)
  • Re: how to calculate cnsSampleTime
    ... I have live stream and I am saving it using writestreamsample in ... onstreamsample method. ... except the cases when the stream breaks and the reader is restarted. ... I didn't plan to use the system time as is, but some calculation based on it. ...
    (microsoft.public.windowsmedia.sdk)

Loading