[英]Capturing RTSP stream fails when the script is turned into a standalone executable using pyinstaller
碼:
from imutils.video import VideoStream
import cv2
# Read rtsp stream
rtsp = u"rtsp://admin:admin@10.64.1.31:554/1/h264major"
#vs = VideoStream(src=0).start() # for capturing from webcam
vs = VideoStream(src=rtsp).start()
while True:
frame = vs.read()
# show the output frame
cv2.imshow("Frame", frame)
key = cv2.waitKey(1) & 0xFF
# if the `q` key was pressed, break from the loop
if key == ord("q"):
break
# do a bit of cleanup
cv2.destroyAllWindows()
vs.stop()
這可能是由於RTSP鏈接的utf-8等編碼問題引起的嗎? 還有其他選擇嗎?
解決 :我的可執行文件旁邊包含opencv_ffmpeg320_64.dll。
我的可執行文件旁邊包含opencv_ffmpeg320_64.dll。 或者,將該dll文件復制到python目錄中的DLLs文件夾中
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.