更改使用CameraCaptureUI[C+;+;]录制的视频的名称 我使用C++和XAML来开发一个UI应用程序。在执行过程中,我使用CameraCaptureUI来录制视频。代码如下所示: CameraCaptureUI^ dialog = ref new CameraCaptureUI(); dialog->VideoSettings->Format = CameraCaptureUIVideoFormat::Mp4; 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 = "grabando"; }); Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values; appSettings->Insert("CaptureVideo", PropertyValue::CreateString(file->Path)); });
但我的视频库上什么也没出现,也没有错误指引我更改使用CameraCaptureUI[C+;+;]录制的视频的名称 我使用C++和XAML来开发一个UI应用程序。在执行过程中,我使用CameraCaptureUI来录制视频。代码如下所示: CameraCaptureUI^ dialog = ref new CameraCaptureUI(); dialog->VideoSettings->Format = CameraCaptureUIVideoFormat::Mp4; 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 = "grabando"; }); Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values; appSettings->Insert("CaptureVideo", PropertyValue::CreateString(file->Path)); });,c++,multithreading,concurrency,cameracapturetask,C++,Multithreading,Concurrency,Cameracapturetask,但我的视频库上什么也没出现,也没有错误指引我 我的问题是:如何控制输出视频的名称?我已经搜索了文档和论坛,但似乎找不到解决方案。查看我找到的文档。因为我已经有了一个StorageFile,所以我可以很容易地更改调用此函数的名称 create_task(StorageLibrary::GetLibraryAsync(KnownLibraryId::Videos)) .then([this](StorageLibrary^ videosLibrary)
我的问题是:如何控制输出视频的名称?我已经搜索了文档和论坛,但似乎找不到解决方案。查看我找到的文档。因为我已经有了一个StorageFile,所以我可以很容易地更改调用此函数的名称
create_task(StorageLibrary::GetLibraryAsync(KnownLibraryId::Videos))
.then([this](StorageLibrary^ videosLibrary)
{
Windows::Storage::StorageFolder^ _videoLib = videosLibrary->SaveFolder;
if (_videoLib == nullptr)
{
// In this case fall back to the local app storage since the Pictures Library is not available
_videoLib = ApplicationData::Current->LocalFolder;
}
});
//EtiquetaVid is a string created earlier
file->CopyAsync(_videoLib, stringToPlatformString(etiquetaVid), NameCollisionOption::GenerateUniqueName);