1

I have a Windows 8.1 app (NOT Silverlight or WPF) which plays custom audio/video stream (aac/h264 file in ASF format).

I parse the stream and supply samples to MediaStreamSource for MediaElement (in MSS SampleRequested event). The stream plays fine for a few seconds and then pauses (MediaElement state changes from playing to buffering) then it plays again and stops again etc. I verified that MediaStreamSource has enough samples to supply to MediaElement (I never have to use deferral).

The network conditions are ideal (I stream the media file via ISS on the same PC where I run the app). If I play only the audio or only the video portion of the file, it works fine with no pauses. Increasing MSS Buffertime reduces the problem. I'd appreciate any advice on how to troubleshoot this problem.

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
alexb
  • 61
  • 1
  • 7

1 Answers1

1

If you are still having trouble with this, two things come to mind:

  • Make sure both your audio and video time stamps start at (or very near) zero.
  • Make sure they both increment in a reasonable way and don't drift too far apart.

Also for anyone using deferrals (you did say that was not the case here), make sure to keep the audio and video deferrals separate.

I ported some code that plays an audio/video stream from Windows Phone to the new MSS in Win8.1 and found it much, much easier to deal with. (At least, nothing has bitten me yet. Knock on wood...?) At any rate, this works for me: WinRtMediaStreamSource.cs

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130