如何在Python上获取Onvif媒体配置文件令牌

2024-09-28 19:02:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直试图请求Onvif快照,但是GetSnapshotUri()函数以“Profile Token”作为参数。在

我调用了GetProfiles()函数,结果是一个概要文件列表,其中一个有a _token = "MediaProfile000"。在

如果我只是在GetSnapshotUri()函数中键入此标记,它将显示:

onvif.exceptions.ONVIFError: Unknown error: Method instance argument after ** must be a mapping, not str

所以我试着这样做:

^{pr2}$

但你猜怎么着?在

onvif.exceptions.ONVIFError: Unknown error: Method instance argument after ** must be a mapping, not Text

请帮忙


Tags: instance函数noterrorbeargumentmethodmapping
1条回答
网友
1楼 · 发布于 2024-09-28 19:02:43
profilesList = media.GetProfiles()
firstProfile = profilesList[0]
mediaProfileToken = firstProfile.token
media.GetSnapshotUri(mediaProfileToken)

这对我有用!! 将firstProfile.\u令牌替换为firstProfile.token在

相关问题 更多 >