c# - 无法使用 StorageItemContentProperties SavePropertiesAsync 在 MP4 文件中设置属性
问题描述
我正在尝试在 UWP 应用程序的 MP4 视频文件中设置一些属性。我能够毫无问题地检索扩展属性。但是,当我尝试修改和保存属性时,其中一些会导致应用程序失败。
我认为可以通过 Windows 资源管理器修改的任何属性也可以通过编程方式进行修改,但它不适用于我的代码。
我找到了可用于在 windows 属性页中检索和保存属性的不同参数。https://docs.microsoft.com/en-us/windows/win32/properties/props
我还检查了像这样的不同主题,并且我能够保存关键字等属性,但是当我尝试保存 Actors (ItemParticipants) 时它失败了。uwp StorageFile 添加自定义属性
这是我用来保存属性的代码
// The list of pair of key/values to pass in the retrieve or save properties
IDictionary<string, Object> PropertiesToSave = new Dictionary<string, Object>();
//Adding the property to save
PropertiesToSave.Add("System.ItemParticipants", myParticipantsList[]);
PropertiesToSave.Add("System.Keywords", myKeywordsList[]);
//saving the properties
await video.Properties.SavePropertiesAsync(PropertiesToSave);
如果我只保存关键字,工作正常,但如果我保存 ItemParticipants 它会失败,即使我能够检索它们并且我也能够直接从 Windows 资源管理器中设置它们。
我如何知道可以为视频设置哪些 windows 属性?是否只能设置 VideoProperties 中的属性(表示为可设置)?
解决方案
推荐阅读
- javascript - Deck.GL如何正确调整setstate,让Scatterplotlayer和Tripslayer可以同步渲染
- python - 我可以在每个单元格都是列表列表的 Python Pandas 列上使用正则表达式搜索或匹配吗?
- c# - MessagePack 反序列化异常 FormatterNotRegisteredException
- google-cloud-platform - 无法访问站点:找不到服务器 IP 地址 ERR_NAME_NOT_RESOLVED
- linux - 使用 cat 将文件从远程复制到本地
- asp.net-mvc - 引用模型中的外键字段
- mysql - MySQL 中的 char(2) 或 enum 或 tinyint
- python - SQLAlchmey:如何在查询中按 timedelta 和日期进行过滤?
- javascript - 包含函数的对象上的 Chai 深度相等
- node.js - 未捕获的类型错误:socket.to 不是函数