亚洲天堂h,成人精品一区二区久久久,国产精品成人第一区,丁香婷婷六月天,九色视频网址,综合激情五月婷婷

系統(tǒng)下載、安裝、激活,就到系統(tǒng)天地來(lái)!

Windows10 IoT Core:視頻錄制移動(dòng)應(yīng)用程序

作者:系統(tǒng)天地 日期:2015-11-26

 

windows10 IoT Core的視頻錄制移動(dòng)應(yīng)用程序,是一個(gè)展示如何在windows10 IoT Core上創(chuàng)建視頻捕獲移動(dòng)應(yīng)用程序的實(shí)例,同時(shí)也支持在拍攝過(guò)程中預(yù)覽視頻。
 
需求組件:
1個(gè)USB攝像頭
1個(gè)USB鼠標(biāo)
1個(gè)HDMI顯示器和HDMI線
1個(gè)樹(shù)莓派2開(kāi)發(fā)板
 
建立示例移動(dòng)應(yīng)用程序:
連接USB攝像頭,USB鼠標(biāo),HDMI顯示器,以太網(wǎng)電纜(或者WiFi無(wú)線網(wǎng)絡(luò))到樹(shù)莓派2,然后打開(kāi)它
下載示例,構(gòu)建并部署到樹(shù)莓派2上
查看如何在樹(shù)莓派2上運(yùn)行
 
移動(dòng)應(yīng)用程序建立核心步驟:
1、 打開(kāi)VS2015,創(chuàng)建一個(gè)新的Windows通用空白應(yīng)用程序:

2、啟用package.appxmanifest功能,確保麥克風(fēng)和視頻庫(kù)(用于保存音頻文件)以及網(wǎng)絡(luò)攝像頭功能被選中:

在MainPage.xaml中,添加按鈕“開(kāi)始捕捉”,“結(jié)束捕捉”,“播放拍攝的視頻”,增加一個(gè)“捕捉元件”用于視頻預(yù)覽和一個(gè)“媒體元件”用于視頻播放
<Button x:Name="btn1" Content="Start Capturing" Click="startCapture" Margin="10,50,0,0"></Button> <Button x:Name="btn2" Content="End Capturing" Click="stopCapture" Margin="10, 20,0,0"/> <Button x:Name="btn3" Content="Play Captured Video" Click="playVideo" Margin="10, 20, 0,20"/> <TextBox Text="Video Preview Window:" Margin="10,10,0,5" TextAlignment="Center" BorderThickness="0"/> <CaptureElement Name="capturePreview" Height="300" Margin="10,10,0,10" Width="300"/> <TextBox Text="Video Review Window" Margin="10,10,0,5" TextAlignment="Center" BorderThickness="0"/> <MediaElement Name="media" AutoPlay="True" AreTransportControlsEnabled="False" Height="300" Width="300" Margin="10,10,0,10" > </MediaElement>
在MainPage.xaml.cs中,你將需要枚舉找到錄像機(jī)設(shè)備:
var devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(Windows.Devices.Enumeration.DeviceClass.VideoCapture);
設(shè)置“捕獲設(shè)置”:
captureInitSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();captureInitSettings.StreamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.AudioAndVideo;captureInitSettings.PhotoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.VideoPreview;
初始化“媒體捕捉”:
mediaCapture = new Windows.Media.Capture.MediaCapture();await mediaCapture.InitializeAsync(captureInitSettings);
創(chuàng)建文件:
profile = Windows.Media.MediaProperties.MediaEncodingProfile.CreateMp4(Windows.Media.MediaProperties.VideoEncodingQuality.Qvga);
 
開(kāi)始錄制:
var storageFile = await Windows.Storage.KnownFolders.VideosLibrary.CreateFileAsync("cameraCapture.wmv", Windows.Storage.CreationCollisionOption.GenerateUniqueName);   await mediaCapture.StartRecordToStorageFileAsync(profile, storageFile);
也可以在拍攝過(guò)程中啟動(dòng)預(yù)覽:
// start the preview capturePreview.Source=mediaCapture; await mediaCapture.StartPreviewAsync();
停止錄制和預(yù)覽:
private async void StopMediaCaptureSession() { await mediaCapture.StopRecordAsync(); recording = false; (App.Current as App).IsRecording = false; //stop the preview await mediaCapture.StopPreviewAsync(); }
播放錄像:
private async void playVideo(object sender, RoutedEventArgs e) { Windows.Storage.StorageFile storageFile = await Windows.Storage.KnownFolders.VideosLibrary.GetFileAsync(fileName); var stream = await storageFile.OpenAsync(Windows.Storage.FileAccessMode.Read); // mediaControl is a MediaElement defined in XAML if (null != stream) { media.Visibility = Visibility.Visible; media.SetSource(stream, storageFile.ContentType); media.Play(); } }
 
主站蜘蛛池模板: 一区二区三区四区视频 | 国产亚洲欧洲一区二区三区 | 久久久久女人精品毛片 | 亚洲精品在线看 | 中文字幕在线观看免费视频 | 久久精品国内一区二区三区 | 久久蜜视频 | 亚洲免费电影网 | 四虎精品成人免费视频 | 综合色影院 | 激情综合网婷婷 | 久久网站免费 | 精品一区二区三区在线成人 | 一级国产 | 久久网精品视频 | 日韩视频免费在线 | 男人天堂2018 | 国产精品久久免费视频 | 一区二区免费 | 一对一在线观看 | 羞羞视频入口网站 | 美日韩免费视频 | 国产成人毛片亚洲精品不卡 | 久久一区视频 | 亚洲欧美日韩久久一区 | 久久精品国产第一区二区 | 婷婷国产天堂久久综合五月 | 欧美日韩精品一区二区三区不卡 | 国产精品视频公开费视频 | 中文字幕热久久久久久久 | 欧美综合一区二区三区 | 在线观看va | 一级看片免费视频 | 伊人网站在线观看 | 欧美自拍视频 | 2021国产麻豆剧传媒精品网站 | 亚洲欧美日本综合一区二区三区 | 聚会的目的4韩语中文字 | 蜜桃精品视频 | 国产在线欧美精品 | 国产精品视频在 |