# Advice requested: Advice: Best way to integrate PTZ ONVIF camera into Ignition 8.3 (Vision)

**URL:** <https://forum.inductiveautomation.com/t/advice-requested-advice-best-way-to-integrate-ptz-onvif-camera-into-ignition-8-3-vision/110632>\
**Category:** Module Development\
**Tags:** scripting, vision\
**Created:** [September 15, 2025, 4:57pm UTC](https://forum.inductiveautomation.com/t/advice-requested-advice-best-way-to-integrate-ptz-onvif-camera-into-ignition-8-3-vision/110632 "2025-09-15T16:57:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjhosseinzade](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@mjhosseinzade](https://forum.inductiveautomation.com/u/mjhosseinzade)\
**Post date:** [September 15, 2025, 4:57pm UTC](https://forum.inductiveautomation.com/t/advice-requested-advice-best-way-to-integrate-ptz-onvif-camera-into-ignition-8-3-vision/110632/1 "2025-09-15T16:57:40Z")

</div>

Hi everyone

I’m integrating PTZ cameras into an Ignition 8.3 (Vision) system and I need advice which development approach to choose.

- PTZ control (move, goto preset)

- snapshot capture (later stored in MongoDB)

- scheduled timelapse (camera moves to preset → capture → back)

I tried calling the camera’s ONVIF endpoints directly from Ignition using `system.net.httpGet` / `httpPost`, but I always get **401 Unauthorized**. ONVIF requires WS-Security (UsernameToken, PasswordDigest), which is hard to implement in Ignition’s Jython scripting.

So I see **two possible approaches** :

**Option A — Direct in Ignition (Jython/SOAP):**

- Build WS-Security SOAP requests in scripts, post them to the camera.

- Pros: single environment, simpler deployment.

- Cons: implementing WS-Security and parsing SOAP in Jython is difficult, harder to maintain.  
👉 If you recommend this, could you share a tested Jython example for PTZ (e.g., GotoPreset with UsernameToken)?

**Option B — External Python middleware (Flask + ONVIF library):**

- Middleware handles ONVIF via a proper library, exposes simple REST endpoints for Ignition.

- Pros: easier to develop & maintain, good for future MongoDB/timelapse features.

- Cons: adds another service to deploy.  
👉 If you recommend this, any example Flask + ONVIF snippets or best practices for connecting Ignition to it?

**Question:** For a project that will later need MongoDB snapshot/timelapse storage, which approach do you recommend for long-term development?

Thanks in advance for any advice or code samples!

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [September 15, 2025, 5:11pm UTC](https://forum.inductiveautomation.com/t/advice-requested-advice-best-way-to-integrate-ptz-onvif-camera-into-ignition-8-3-vision/110632/2 "2025-09-15T17:11:36Z")

</div>

You're getting very close to the line where it would be better to build a PTZ/ONVIF driver module in Java that exposes all the functions as Ignition Scripting Functions that you then use as you need inside Ignition.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 15, 2025, 6:22pm UTC](https://forum.inductiveautomation.com/t/advice-requested-advice-best-way-to-integrate-ptz-onvif-camera-into-ignition-8-3-vision/110632/3 "2025-09-15T18:22:27Z")

</div>

I'm not really sure why/if you meant to put this in the #Module Development subcategory - it doesn't sound like that's the way you're leaning.

> [@mjhosseinzade](#):
>
> I tried calling the camera’s ONVIF endpoints directly from Ignition using `system.net.httpGet` / `httpPost`, but I always get **401 Unauthorized**. ONVIF requires WS-Security (UsernameToken, PasswordDigest), which is hard to implement in Ignition’s Jython scripting.

Never use `system.net.httpGet/httpPost`, always use `system.net.httpClient`.  
There are some examples floating around this forum of doing digest auth via scripting, e.g:

> [@\[IGN-4258\]Digest auth with httpClient](https://forum.inductiveautomation.com/t/ign-4258-digest-auth-with-httpclient/66137/10):
>
> Here is an example function: def getData(client, uri, url, username, password): import hashlib import random res = client.get(url) if res.statusCode == 401: headers = res.headers digestParts = headers["www-authenticate"][0].replace("Digest ", "").split(",") digestData = {} for part in digestParts: partParts = part.strip().split("=") digestData[partParts[0]] = partParts[1].replace("\"", "") realm = digestData["realm"] charset = digestData["charset"] …

> [@mjhosseinzade](#):
>
> MongoDB snapshot/timelapse storage,

Tangential, but MongoDB seems a very strange choice for binary file storage. NoSQL gives you no benefits if you're storing well formatted binary image snapshots.
