[英]How to retrieve filename from OpenCV's VideoCapture() in Python?
After we've created VideoCapture
with cv2.VideoCapture(filename)
how can we retrieve filename
?在我们使用
cv2.VideoCapture(filename)
创建VideoCapture
之后,我们如何检索filename
? Looks like get()
method with propId
is not what I'm looking for看起来带有
propId
的get()
方法不是我想要的
sorry, but you cannot retrieve the filename from a cv2.VideoCapture.抱歉,您无法从 cv2.VideoCapture 中检索文件名。
(also, webcams or ip captures wont even have one) (此外,网络摄像头或 ip 捕获甚至都没有)
since the filename is in your code, you need to cache it in a variable instead.由于文件名在您的代码中,因此您需要将其缓存在变量中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.