title: Syncronization audio and video
body: <p>I need to display stream video using MediaElement in Windwso Phone application.</p>
  
  <p>I'm getting from web-service a stream that contains frames in H264 format AND raw-AAC bytes (strange, but <code>ffmpeg</code> can parse with <code>-f ac3</code> parameter only).</p>
  
  <p>So, if try to play only one of stream (audio OR video) it plays nice. But I have issues when  try it both. </p>
  
  <p>For example, if I report video sample <strong>without</strong> timestamp and report audio <strong>with</strong> timestamp, my video plays 3x-5x faster then I need. </p>
  
  <pre><code>MediaStreamSample msSamp = new MediaStreamSample(
                      _videoDesc,
                      vStream,
                      0,
                      vStream.Length,
                      0,
                      _emptySampleDict);
  
                  ReportGetSampleCompleted(msSamp);
  </code></pre>
  
  <p>From my web-service I getting a DTS and PTS for video and audio frames in following format:</p>
  
  <blockquote>
    <p>120665029179960</p>
  </blockquote>
  
  <p>but when I set it for sample, my audio stream plays too slow and with delays. </p>
  
  <p>Timebase is 90khz. </p>
  
  <p>So, could someone tell me how I can resolve it? Maybe I should calculate others timestamps for samples? If so, show me the way, please.</p>
  
  <p>Thanks.</p>