首页 > 解决方案 > 如何在 Open CV Python 中从文本文件中提供视频源

问题描述

我想在 Opencv 中使用视频捕获并从文本文件中提供视频路径或相机路径,他们是否有可能在 Open CV Python 中从文本文件中提供视频源

标签: python-3.xopencvartificial-intelligence

解决方案


    cap = cv2.VideoCapture(open('file.txt').read())

在文本文件中只需写下您的 : -
带有 extn 的视频文件名。: - 视频.mp4

或者

摄像头路径: - rtsp://User_Name:Password@127.0.0.1/Streaming/Channels/501


推荐阅读