Video capturing is one of the common tool used now a days in application development. It is quite obvious a person might be needing to integrate Video capturing in his Windows 10 Application. So, here we are beginning with our Video Capturing application:
In Visual Studio 2015, Start a new project and select Blank app in Universal App category. Before starting any coding, we have to go to package.appxmanifest file of the solution, we need to select Webcam and Video Library under Capabilities.
Then in the MainPage.xaml file we will add the code for button which will be used to capture the video and a media element where video will be shown:
- <Button x:Name="Capture_button" Content="Start Capturing Video" HorizontalAlignment="Left" Margin="79,240,0,0" VerticalAlignment="Top" Height="78" Width="169" Click="Capture_button_Click"/>
- <MediaElement x:Name="video" HorizontalAlignment="Left" Height="720" Margin="312,0,0,0" VerticalAlignment="Top" Width="968" AreTransportControlsEnabled="True"/>
- <Button x:Name="Save_button" Content="Save Video" HorizontalAlignment="Left" Margin="79,391,0,0" VerticalAlignment="Top" Height="78" Width="169" Click="save_Video"/>
After adding the above code in the xaml file, we will go to the methods of the buttons: Capture_button and Save_button and add their functionality. But before adding the functionality to the methods, we need to add the namespaces which will be required in the application:
- using Windows.Media.Capture;
- using Windows.Media.Core;
- using Windows.Media.Editing;
- using Windows.Storage;
- using Windows.Storage.Pickers;
- using Windows.Storage.Streams;
- using Windows.UI.Popups;
- using Windows.UI.Xaml;
- using Windows.UI.Xaml.Controls;
Now, we add the declaration code for two objects of StorageFile class and IRandomAccessStream class which will be used throughout the application:
- private StorageFile sf;
- private IRandomAccessStream rs;
Now, the functionality for Capture_button method which will invoke the default video capturing tool of the system:

Saineshwar BageriPosted Sep 13, 2015, 11:54 PM
Good One Sir