5

Microsoft.expression.encoder とフレームワーク 4.0 を使用してビデオをブロードキャストするための WPF アプリケーションがありますが、ブロードキャスト中に 15 秒の遅延が発生しました。ブロードキャスト中の遅延を減らすための提案はありますか。

以下はコードです

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 && 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());
    }

}

サーバー システムとクライアント システムの両方で Web カメラを表示するために MediaElement を使用しています。

クライアント側

 try
            {

                theMainWindow.getServerIPAddress();
                IP = theMainWindow.machineIP;
                MediaElement1.Source = new Uri("http://" + IP + ":9090/");
            }
            catch (Exception ex)
            {
            }
4

2 に答える 2

2

残念ながら解決策はありません (少なくとも 2011 年 1 月現在)。マイクロソフトによると:

「エンコード中に数秒の遅延を追加します。その後、サーバー レベルでキャッシングが行われ、さらに 5 ~ 20 秒追加される可能性があります。最後に、Silverlight もさらに数秒の遅延のためにキャッシュします。」

http://social.expression.microsoft.com/Forums/is/encoder/thread/898b2659-c0d5-4c84-8fba-225f58806f5d

于 2012-11-06T22:21:24.293 に答える