1
私はVLCメディアプレーヤーを使用してhttpを使用して.mp4ビデオをストリーミングしています。ストリーミングはうまくいきます(VLCの別のインスタンスを使用してこのストリームにアタッチすることができました)。 今、私はこのストリームにPython 2.7でOpenCVを使用して接続し、フレームごとにビデオを取得したいと考えています。openCVとpythonを使用してストリームからビデオをフレームで取得する方法
(ローカルファイルと完全に正常に動作します)この変更されたチュートリアルコード:
<code>
import numpy as np
import cv2
address = '10.0.0.71' # this is my stream ip address
port = 8080 # this is stream port
# should I use socket somehow?
# found this somewhere, no idea what this do
# import socket
# msocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# msocket.connect((address, port))
cap = cv2.VideoCapture('file.mp4') # how to use VideoCapture with online stream?
# just showing video to screen
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
を助けてください。
http://answers.opencv.org/question/3664/ip-network-camera-access/ – udit043