title: wpf application for broadcasting video with 15sec delay
body: <p>I have a WPF application for broadcasting video using Microsoft.expression.encoder and framework 4.0, but i got a delay of 15 sec while broadcasting.Is there any suggestion to reduce the delay while broadcasting.</p>
  
  <p>below is the Code</p>
  
  <pre><code>using Microsoft.Expression.Encoder.Live; 
  using Microsoft.Expression.Encoder;
  
  private void button1_Click(object sender, RoutedEventArgs e)
  { 
      try 
      { 
          EncoderDevice video = null; 
          EncoderDevice audio = null;
          GetSelectedVideoAndAudioDevices(out video, out audio);
          StopJob();
  
          if (video == null)
          {
              return;
          }
  
          StopJob();
          _job = new LiveJob();
  
          if (video != null &amp;&amp; audio != null)
          {
              //StopJob();
              _deviceSource = null;
              _deviceSource = _job.AddDeviceSource(video, audio);
              _job.ActivateSource(_deviceSource);
  
              // Finds and applys a smooth streaming preset        
              //_job.ApplyPreset(LivePresets.VC1HighSpeedBroadband4x3);
  
              // Creates the publishing format for the job
              PullBroadcastPublishFormat format = new PullBroadcastPublishFormat();
              format.BroadcastPort = 9090;
              format.MaximumNumberOfConnections = 50;
  
              // Adds the publishing format to the job
              _job.PublishFormats.Add(format);
  
              // Starts encoding
              _job.StartEncoding();
          }
          //webCamCtrl.StartCapture();
      }
      catch (Exception ex)
      {
          WriteLogFile(this.GetType().Name, "button1_Click", ex.Message.ToString());
      }
  
  }
  </code></pre>
  
  <p>I am using MediaElement to show  the webcam both on my server and client systems.</p>
  
  <p>on Client Side </p>
  
  <pre><code> try
              {
  
                  theMainWindow.getServerIPAddress();
                  IP = theMainWindow.machineIP;
                  MediaElement1.Source = new Uri("http://" + IP + ":9090/");
              }
              catch (Exception ex)
              {
              }
  </code></pre>