Tôi có ứng dụng WPF để phát video bằng Microsoft.expression.encoder và khung 4.0, nhưng tôi bị trễ 15 giây trong khi phát sóng. Có đề xuất nào để giảm độ trễ khi phát sóng .ứng dụng wpf để phát video với độ trễ 15 giây
dưới đây là Bộ luật
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());
}
}
Tôi đang sử dụng MediaElement để hiển thị webcam cả trên các hệ thống máy chủ và khách hàng của tôi.
trên Client Side
try
{
theMainWindow.getServerIPAddress();
IP = theMainWindow.machineIP;
MediaElement1.Source = new Uri("http://" + IP + ":9090/");
}
catch (Exception ex)
{
}
Kể tìm thấy giải pháp cho điều này? –
KevinCloet: Không, Chưa. –