I'm noob to Vlc.DotNet (Wpf)! I want to develop a CCTV application that support 100 camera live view in one page! I have a 10x10 grid that shows videos in cells.
The problem is that the application slows down and goes to halt after 36 tiles of videos.
here is my test :
xaml:
<Window x:Class="vlc_stream_test.videoGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Wpf="clr-namespace:Vlc.DotNet.Wpf;assembly=Vlc.DotNet.Wpf" Title="Video Lan Grid" Height="500" Width="525" Loaded="Window_Loaded">
<Grid Name="root" ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
</Grid>
code behind :
try
{
VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
}
catch
{
VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_X86;
VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_X86;
}
VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = false;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = false;
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.None;
Vlc.DotNet.Core.VlcContext.StartupOptions.AddOption("--network-caching=1000");
Vlc.DotNet.Core.VlcContext.StartupOptions.AddOption("--no-skip-frames");
Vlc.DotNet.Core.VlcContext.StartupOptions.AddOption("--no-video-title");
Vlc.DotNet.Core.VlcContext.StartupOptions.AddOption("--live-caching=10000");
VlcContext.Initialize();
InitializeComponent();
root.Background = Brushes.DarkGreen;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
{
var visBrush = new VisualBrush() { Stretch = Stretch.UniformToFill };
Grid g = new Grid() {Background = visBrush, Margin = new Thickness(1) };
g.PreviewMouseDown += (sender, e) =>
{
VlcControl vlc = new VlcControl() { Media = new LocationMedia("file:///C:/Users/Public/Videos/wildlife.wmv") };
Binding binding = new Binding("VideoSource") { Source = vlc };
var imgBox = new Image();
imgBox.SetBinding(Image.SourceProperty, binding);
visBrush.Visual = imgBox;
};
root.Children.Add(g);
Grid.SetColumn(g, j);
Grid.SetRow(g, i);
}
The video specification that I used :
Resolution : 128x96
bitRate : 72 kb/s
Audio : none
video format : wmv1
I need a solution that solve my problem... thanks.