Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/143.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
如何同时使用两个CameraCaptureUI(UWP/C+;+;) 我正在研究一个通用的Windows平台应用程序(UWP),其中我使用C++作为主要语言。我想同时从两台摄像机上阅读。一个摄像头属于Kinect RGB摄像头,另一个属于Kinect深度摄像头。到目前为止,我仅使用以下代码阅读了一篇文章: void SDKTemplate::Scenario4_ReproVideo::Grabar_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { CameraCaptureUI^ dialog = ref new CameraCaptureUI(); dialog->VideoSettings->Format = CameraCaptureUIVideoFormat::Mp4; Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values; concurrency::task<StorageFile^>(dialog->CaptureFileAsync(CameraCaptureUIMode::Video)).then([this](StorageFile^ file) { if (file != nullptr) { concurrency::task<Streams::IRandomAccessStream^> (file->OpenAsync(FileAccessMode::Read)).then([this] (Streams::IRandomAccessStream^ stream){ CapturedVideo->SetSource(stream, "video/mp4"); logger->Text = "recording"; }); Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values; appSettings->Insert("CapturedVideo", PropertyValue::CreateString(file->Path)); } else { logger->Text = "Something went wrong or was cancelled"; } }); } void SDKTemplate::Scenario4\u ReproVideo::Grabar\u单击(平台::对象^ 发件人,Windows::UI::Xaml::RoutedEventArgs^e) { CameraCaptureUI^dialog=ref新建CameraCaptureUI(); 对话框->视频设置->格式=CameraCaptureUIVideoFormat::Mp4; Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; 并发::任务(对话框->CaptureFileAsync(CameraCaptureUIMode::Video))。然后([this](存储文件^file){ 如果(文件!=nullptr){ 并发::任务(文件->OpenAsync(FileAccessMode::Read))。然后([此](Streams::IRandomAccessStream ^stream){ CapturedVideo->SetSource(流,“视频/mp4”); 记录器->文本=“记录”; }); Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; appSettings->Insert(“CapturedVideo”,PropertyValue::CreateString(文件->路径)); } 否则{ logger->Text=“出现问题或被取消”; } }); }_C++_Concurrency_Uwp_Video Capture_Uwp Xaml - Fatal编程技术网 视频设置->格式=CameraCaptureUIVideoFormat::Mp4; Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; 并发::任务(对话框->CaptureFileAsync(CameraCaptureUIMode::Video))。然后([this](存储文件^file){ 如果(文件!=nullptr){ 并发::任务(文件->OpenAsync(FileAccessMode::Read))。然后([此](Streams::IRandomAccessStream ^stream){ CapturedVideo->SetSource(流,“视频/mp4”); 记录器->文本=“记录”; }); Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; appSettings->Insert(“CapturedVideo”,PropertyValue::CreateString(文件->路径)); } 否则{ logger->Text=“出现问题或被取消”; } }); },c++,concurrency,uwp,video-capture,uwp-xaml,C++,Concurrency,Uwp,Video Capture,Uwp Xaml" /> 视频设置->格式=CameraCaptureUIVideoFormat::Mp4; Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; 并发::任务(对话框->CaptureFileAsync(CameraCaptureUIMode::Video))。然后([this](存储文件^file){ 如果(文件!=nullptr){ 并发::任务(文件->OpenAsync(FileAccessMode::Read))。然后([此](Streams::IRandomAccessStream ^stream){ CapturedVideo->SetSource(流,“视频/mp4”); 记录器->文本=“记录”; }); Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; appSettings->Insert(“CapturedVideo”,PropertyValue::CreateString(文件->路径)); } 否则{ logger->Text=“出现问题或被取消”; } }); },c++,concurrency,uwp,video-capture,uwp-xaml,C++,Concurrency,Uwp,Video Capture,Uwp Xaml" />

如何同时使用两个CameraCaptureUI(UWP/C+;+;) 我正在研究一个通用的Windows平台应用程序(UWP),其中我使用C++作为主要语言。我想同时从两台摄像机上阅读。一个摄像头属于Kinect RGB摄像头,另一个属于Kinect深度摄像头。到目前为止,我仅使用以下代码阅读了一篇文章: void SDKTemplate::Scenario4_ReproVideo::Grabar_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { CameraCaptureUI^ dialog = ref new CameraCaptureUI(); dialog->VideoSettings->Format = CameraCaptureUIVideoFormat::Mp4; Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values; concurrency::task<StorageFile^>(dialog->CaptureFileAsync(CameraCaptureUIMode::Video)).then([this](StorageFile^ file) { if (file != nullptr) { concurrency::task<Streams::IRandomAccessStream^> (file->OpenAsync(FileAccessMode::Read)).then([this] (Streams::IRandomAccessStream^ stream){ CapturedVideo->SetSource(stream, "video/mp4"); logger->Text = "recording"; }); Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values; appSettings->Insert("CapturedVideo", PropertyValue::CreateString(file->Path)); } else { logger->Text = "Something went wrong or was cancelled"; } }); } void SDKTemplate::Scenario4\u ReproVideo::Grabar\u单击(平台::对象^ 发件人,Windows::UI::Xaml::RoutedEventArgs^e) { CameraCaptureUI^dialog=ref新建CameraCaptureUI(); 对话框->视频设置->格式=CameraCaptureUIVideoFormat::Mp4; Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; 并发::任务(对话框->CaptureFileAsync(CameraCaptureUIMode::Video))。然后([this](存储文件^file){ 如果(文件!=nullptr){ 并发::任务(文件->OpenAsync(FileAccessMode::Read))。然后([此](Streams::IRandomAccessStream ^stream){ CapturedVideo->SetSource(流,“视频/mp4”); 记录器->文本=“记录”; }); Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; appSettings->Insert(“CapturedVideo”,PropertyValue::CreateString(文件->路径)); } 否则{ logger->Text=“出现问题或被取消”; } }); }

如何同时使用两个CameraCaptureUI(UWP/C+;+;) 我正在研究一个通用的Windows平台应用程序(UWP),其中我使用C++作为主要语言。我想同时从两台摄像机上阅读。一个摄像头属于Kinect RGB摄像头,另一个属于Kinect深度摄像头。到目前为止,我仅使用以下代码阅读了一篇文章: void SDKTemplate::Scenario4_ReproVideo::Grabar_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { CameraCaptureUI^ dialog = ref new CameraCaptureUI(); dialog->VideoSettings->Format = CameraCaptureUIVideoFormat::Mp4; Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values; concurrency::task<StorageFile^>(dialog->CaptureFileAsync(CameraCaptureUIMode::Video)).then([this](StorageFile^ file) { if (file != nullptr) { concurrency::task<Streams::IRandomAccessStream^> (file->OpenAsync(FileAccessMode::Read)).then([this] (Streams::IRandomAccessStream^ stream){ CapturedVideo->SetSource(stream, "video/mp4"); logger->Text = "recording"; }); Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values; appSettings->Insert("CapturedVideo", PropertyValue::CreateString(file->Path)); } else { logger->Text = "Something went wrong or was cancelled"; } }); } void SDKTemplate::Scenario4\u ReproVideo::Grabar\u单击(平台::对象^ 发件人,Windows::UI::Xaml::RoutedEventArgs^e) { CameraCaptureUI^dialog=ref新建CameraCaptureUI(); 对话框->视频设置->格式=CameraCaptureUIVideoFormat::Mp4; Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; 并发::任务(对话框->CaptureFileAsync(CameraCaptureUIMode::Video))。然后([this](存储文件^file){ 如果(文件!=nullptr){ 并发::任务(文件->OpenAsync(FileAccessMode::Read))。然后([此](Streams::IRandomAccessStream ^stream){ CapturedVideo->SetSource(流,“视频/mp4”); 记录器->文本=“记录”; }); Windows::Foundation::Collections::IPropertySet^appSettings=ApplicationData::Current->LocalSettings->Values; appSettings->Insert(“CapturedVideo”,PropertyValue::CreateString(文件->路径)); } 否则{ logger->Text=“出现问题或被取消”; } }); },c++,concurrency,uwp,video-capture,uwp-xaml,C++,Concurrency,Uwp,Video Capture,Uwp Xaml,通过这样做,我可以可靠地从其中一台摄像机上记录下来。我的问题是,我需要从两台摄像机同时录制,因为我需要深度和RGB来处理视频 我不熟悉并发,有没有一种方法(越简单越好)可以同时实现两次录制?在UWP应用程序中,我们可以使用提供从捕获设备捕获照片、音频和视频功能的类来捕获照片和视频。参见主题 我们可以初始化多个实例,然后使用类读取帧。请参阅主题并查看官方示例 此外,关于UWP多摄像头捕获也有类似的线索,您也可以参考:

通过这样做,我可以可靠地从其中一台摄像机上记录下来。我的问题是,我需要从两台摄像机同时录制,因为我需要深度和RGB来处理视频


我不熟悉并发,有没有一种方法(越简单越好)可以同时实现两次录制?

在UWP应用程序中,我们可以使用提供从捕获设备捕获照片、音频和视频功能的类来捕获照片和视频。参见主题

我们可以初始化多个实例,然后使用类读取帧。请参阅主题并查看官方示例

此外,关于UWP多摄像头捕获也有类似的线索,您也可以参考: