This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests.auth import HTTPDigestAuth | |
def get_json(cgi, user, password, headers={'Accept': 'application/json'}): | |
response = requests.get(cgi, auth=HTTPDigestAuth(user, password), headers) | |
response_json = response.json() | |
return response | |
# in the case of Heatmap, if want to get key values, | |
# heatmap_response_json['HeatMap'][0].keys() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zeep.client import Client, CachingClient, Settings | |
from zeep.wsse.username import UsernameToken | |
import zeep.helpers | |
import logging.config | |
# Put Zeep into verbose mode | |
logging.config.dictConfig({ | |
'version': 1, | |
'formatters': { | |
'verbose': { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Under directory 'templates' */ | |
<html> | |
<head> | |
<title>RTSP web streaming</title> | |
</head> | |
<body> | |
<h1>RTSP web streaming</h1> | |
<h3>XND-6080RV (ip:192.168.2.196)</h3> | |
<h4>python webstreaming.py --ip <host ip> --port <host port></h4> | |
<img src="{{ url_for('video_feed') }}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the necessary packages | |
from pyimagesearch.motion_detection import SingleMotionDetector | |
from imutils.video import VideoStream | |
from flask import Response, Flask, render_template | |
import threading | |
import argparse | |
import datetime, time | |
import imutils | |
import cv2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# opencv-python: 4.1.1.26 | |
# python: 3.7.3 | |
import cv2 | |
source = 'rtsp://admin:[email protected]/profile2/media.smp' | |
cap = cv2.VideoCapture(source) | |
if cap.isOpened(): | |
cv2.namedWindow("ip camera demo", cv2.WINDOW_AUTOSIZE) |