Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用expression编码器减少流式网络摄像头或screencap时的延迟_C#_Wpf_Stream_Expression Encoder_Low Latency - Fatal编程技术网

C# 使用expression编码器减少流式网络摄像头或screencap时的延迟

C# 使用expression编码器减少流式网络摄像头或screencap时的延迟,c#,wpf,stream,expression-encoder,low-latency,C#,Wpf,Stream,Expression Encoder,Low Latency,我有10秒的延迟,我需要实时或至少1秒。它不通过互联网。是否可以减少WPF中的缓冲时间 服务器代码: job = new LiveJob(); Collection<EncoderDevice> devices = EncoderDevices.FindDevices(EncoderDeviceType.Video); EncoderDevice device = devices[0]; LiveDeviceS

我有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();
job=newlivejob();
采集设备=EncoderDevices.FindDevices(EncoderDeviceType.Video);
编码器设备=设备[0];
LiveDeviceSource=job.AddDeviceSource(设备,空);
source.ScreenCaptureSourceProperties=新的ScreenCaptureSourceProperties
{
CaptureCursor=true,
CaptureLargeCursor=false,
帧率=6,
CaptureLayeredWindow=true,
高度=600,
宽度=800,
左=0,
Top=0,
};
作业。激活资源(源);
//查找并应用平滑流媒体预设
job.ApplyPreset(LivePresets.VC1256kDSL16x9);
//为fomat数据设置变量
var format=new PullBroadcastPublishFormat{BroadcastPort=8080};
job.PublishFormats.Add(格式);
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>