PTZ カメラを制御する (Python) 🔗

i-PRO PTZ カメラ(WV-S61702-Z3)の Pan, Tilt, Zoom を制御する方法を紹介します。実機確認済みです。

他の i-PRO PTZ カメラでも恐らく動作すると思いますが未確認です。

 

 

 

WV-S61702-Z3
WV-S61702-Z3

 

 

1. PTZ カメラ (WV-S61702-Z3) を Python プログラムで制御する 🔗

ここでは cgi コマンド /cgi-bin/absctrl を使用して実現してみます。

 

注意

ID, パスワード, カメラのIPアドレスは例です。

あなたが使用する環境に合わせて変更してください。

 

 

CURL コマンド例: 🔗

curl --digest -u admin:Admin12345 "http://192.168.0.11/cgi-bin/absctrl?pan=0&tilt=800&zoom=0"

 

Python プログラム例: 🔗

'''
値範囲:
PAN:     0 to 3599
TILT: -300 to 900
ZOOM:   10 to 6400

WV-S61702-Z3 でテスト

環境構築:
1. Python をインストール
2. requests ライブラリをインストール (`pip install requests`)
3. カメラの IP アドレス、ユーザー名、パスワードを設定
'''

import requests
from requests.auth import HTTPDigestAuth

CAMERA_IP = "192.168.0.11"
USER      = "admin"
PASSWORD  = "Admin12345"
PAN       = 600
TILT      = 900
ZOOM      = 0

url = (
    f"http://{CAMERA_IP}/cgi-bin/absctrl?pan={PAN}&tilt={TILT}&zoom={ZOOM}"
)

response = requests.get(
    url,
    auth=HTTPDigestAuth(USER, PASSWORD)
)

print(response.status_code)
print(response.text)

 

 

cgi-bin/absctrl
cgi-bin/absctrl 説明

 

 

ライセンス

本ページの情報は、特記無い限り下記 MIT ライセンスで提供されます。

The MIT License (MIT)

  Copyright 2026 Kinoshita Hidetoshi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 

 

参考

 


 

変更履歴

2026-09-19 - 新規作成

 

Programming Items トップページ

プライバシーポリシー