# HTTP Bindings for Axis camera

**URL:** <https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [September 20, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256 "2024-09-20T20:01:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philip\_Knowlton](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Philip\_Knowlton](https://forum.inductiveautomation.com/u/Philip_Knowlton)\
**Post date:** [September 20, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256/1 "2024-09-20T20:01:10Z")

</div>

_Disclaimer - I'm inexperienced in webdev, so please excuse lack of knowledge or incorrect terminology._

**Context:**

I'm working on getting a live IP camera feed from an Axis camera onto an Ignition [Perspective Video Player](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-video-player). I'm following [Axis documentation for media stream over HTTP](https://www.axis.com/vapix-library/subjects/t10175981/section/t10188469/display?section=t10188469-t10188466). I got a live feed working with the correct camera view by passing a static address as the source of the video feed:

> '`http://username:password@cameraIP/axis-cgi/media.cgi?video=1&camera=4&fps=30`'

The only problem with this is that it seems passing a static, single instance of the username and password causes the authorization to time out, and sometime several hours later the feed drops. As soon as I refresh the project, the feed starts fresh. I can (and have) used Python to script a periodic reset of the project, but it's clunky to have the whole thing reload unnecessarily just to reinitialize the feed.

**Where I'm stuck now:**

The video player has the ability to accept [HTTP bindings with headers/body](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/bindings-in-perspective/http-bindings-in-perspective) and Digest authorization (which the Axis documentation tells me is what's necessary). The problem is that no matter what I've read on forums and documentation, I haven't been able to figure out how to format what I'm putting into the binding. I don't understand the function of headers vs body and every combination of values that I've tried thus far returns a 401 error (not authorized).

If you were attempting this, where/how would you enter the username/password? Would you use headers/body, and if so, which ones?

Thank you in advance for whatever help you can lend. I've been digging for days and read most of the content in forum posts already.

 ![java_YIv3d7mbzP](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/78032f3362caac049eef9363cd05fd87d400795d.jpeg)

---

<div class="post-metadata">

**Author:** ![Philip\_Knowlton](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Philip\_Knowlton](https://forum.inductiveautomation.com/u/Philip_Knowlton)\
**Post date:** [September 20, 2024, 8:02pm UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256/2 "2024-09-20T20:02:48Z")

</div>

It also bears mentioning that if I copy/paste the working static URL into the HTTP binding, that it doesn't work. I've only had it work by entering the text rather than binding.

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [September 20, 2024, 11:51pm UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256/3 "2024-09-20T23:51:55Z")

</div>

Only thing I can say is that you don't need the binding to display. It will not work with it as you already discovered.

For the authentication, I suppose you would need have a iframe to just load the authentication from time to time, but I am not sure it would work

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 21, 2024, 12:07am UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256/4 "2024-09-21T00:07:57Z")

</div>

Whether video or audio or IFrames, such components need the URL supplied as a string, not a binding, because they make the connection they need on their own, from the **browser side**. For such purposes, Ignition simply does not support digest authentication. Sorry.

You will need to transcode/proxy through another server. Perhaps the gateway itself, via my Image Streamer module (but beware of the CPU load that generates):

> [@Automation Professionals' Image Streamer Driver Module](https://forum.inductiveautomation.com/t/automation-professionals-image-streamer-driver-module/29371):
>
> Automation Professionals is pleased to announce a Release Candidate for its new driver module, supporting the live Network Image transmission format of [Keyence CV-5000](https://www.keyence.com/products/vision/vision-sys/cv-5000/index.jsp) machine vision controllers, plus support for common Network Video streams via [OpenCV](https://opencv.org/). Stream metadata is exposed as OPC items, and the output streams are Motion JPEG. The IP Camera Viewer Component in Vision can consume these streams, making it possible to integrate IP Cameras that don't have MJPEG support or have poor support f…

---

<div class="post-metadata">

**Author:** ![Philip\_Knowlton](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Philip\_Knowlton](https://forum.inductiveautomation.com/u/Philip_Knowlton)\
**Post date:** [September 21, 2024, 12:39am UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256/5 "2024-09-21T00:39:51Z")

</div>

> [@pturmel](#):
>
> Whether video or audio or IFrames, such components need the URL supplied as a string, not a binding, because they make the connection they need on their own, from the **browser side**.

Thank you!

Out of curiosity, do you know if refreshBinding() might work to re-initialize the feed even if the source component is a static string not a binding? Otherwise, I'm stuck sending a scheduled/periodic refresh to the whole session which works but is a bit clunky for my needs.

---

<div class="post-metadata">

**Author:** ![Philip\_Knowlton](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Philip\_Knowlton](https://forum.inductiveautomation.com/u/Philip_Knowlton)\
**Post date:** [September 21, 2024, 12:44am UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256/6 "2024-09-21T00:44:33Z")

</div>

> [@calimero100582](#):
>
> For the authentication, I suppose you would need have a iframe to just load the authentication from time to time, but I am not sure it would work

As in have a hidden iframe just to load/re-initialize the authentication periodically? There's gotta be a better way...

I don't know if it makes a difference, but I forgot to mention the camera view is on a carousel component. Maybe there's something I can do in the config on the carousel that would make the feed reload periodically?

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [September 21, 2024, 1:30am UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256/7 "2024-09-21T01:30:06Z")

</div>

Not really, you need client (browser) to be authenticated. If you use a binding, the gateway will do the authentication

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 21, 2024, 2:06am UTC](https://forum.inductiveautomation.com/t/http-bindings-for-axis-camera/96256/8 "2024-09-21T02:06:41Z")

</div>

> [@Philip\_Knowlton](#):
>
> might work to re-initialize the feed even if the source component is a static string not a binding?

Consider using a binding that delivers the string conditionally. Like, one second once per hour, make the string empty, then back to the proper string. That should briefly halt the stream, then start it over. (There might be something better in the component to pause/resume.)
