4

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

1 に答える 1

0

おそらく IIS Smooth Streaming を使用して、ビットレートの低い素材で再生を開始し、クライアント バッファーがいっぱいになるにつれてビットレートを徐々に上げていくことができます。Silverlight には Smooth Streaming の組み込みサポートがあり、同じことを WPF で (少なくとも理論的には) 手動で実装できます。

クライアント側で SL を使用することを妨げている特定の理由はありますか?

于 2014-03-03T14:00:01.493 に答える