уменьшить задержку при потоковой передаче веб-камеры или экрана с помощью кодировщика выражений - PullRequest
1 голос
/ 01 июня 2011

У меня задержка 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>
...