如何解决减少使用表情编码器流式传输网络摄像头或屏幕截图时的延迟
| 我有10秒的延迟,我需要实时或至少1秒。它不通过互联网。是否可以减少WPF中的缓冲时间? 服务器代码: job = new LiveJob();
Collection<EncoderDevice> devices = EncoderDevices.FindDevices(EncoderDeviceType.Video);
EncoderDevice device = devices[0];
LiveDeviceSource source = job.AddDeviceSource(device,null);
source.ScreenCaptureSourceProperties = new ScreenCaptureSourceProperties
{
CaptureCursor = true,CaptureLargeCursor = false,FrameRate = 6,CapturelayeredWindow = true,Height = 600,Width = 800,Left = 0,Top = 0,};
job.ActivateSource(source);
// Finds and applys a smooth streaming preset
job.ApplyPreset(LivePresets.VC1256kDSL16x9);
// Sets up variable for fomat data
var format = new PullbroadcastPublishFormat {broadcastPort = 8080};
job.PublishFormats.Add(format);
job.StartEncoding();
播放器代码:
<Window x:Class=\"XescPlayer.MainWindow\"
xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"
xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"
Title=\"MainWindow\" Height=\"600\" Width=\"800\">
<Grid>
<MediaElement Name=\"VideoControl\" Source=\"http://localhost:8080\" />
</Grid>
</Window>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。