# RTSP CCTV Streaming Optimization in Ignition Perspective

**URL:** <https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036>\
**Category:** Ignition\
**Tags:** perspective, vision\
**Created:** [November 23, 2024, 10:52am UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036 "2024-11-23T10:52:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SOON\_HWAN\_WANG1](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SOON\_HWAN\_WANG1](https://forum.inductiveautomation.com/u/SOON_HWAN_WANG1)\
**Post date:** [November 23, 2024, 10:52am UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036/1 "2024-11-23T10:52:20Z")

</div>

Hello,

I’m trying to implement streaming for over 100 RTSP CCTV cameras in Ignition Perspective, but I’m encountering several technical challenges and would appreciate your guidance.

- Initial Attempts and Issues

1. Using VLC for MJPEG Conversion  
I successfully used VLC commands to convert RTSP streams to MJPEG format and stream them via HTTP.  
However, there were major issues:  
Managing individual ports for each CCTV camera added complexity.  
High resource consumption with MJPEG, which caused significant performance degradation, even with just a few streams.

2. FastAPI-based WebSocket Server  
I built a FastAPI-based web server that converts RTSP streams into HTTP streams via WebSocket.  
However, this also encountered problems:  
Initial WebSocket connection delay of over 5 seconds.  
Severe performance degradation when more than three streams were connected simultaneously.  
I also tested both FFmpeg and GStreamer, but neither resolved the issues.

3. Additional Attempt: pturmel’s Video Player Module  
I considered using pturmel’s Video Player Module, which appears to be a great solution.  
Unfortunately, it only supports Ignition Vision, while my project requires implementation in Ignition Perspective.

- Questions  
Could you recommend a better approach to implement stable RTSP streaming for multiple CCTV cameras in Ignition Perspective?  
Specifically, I’m looking for solutions that address performance optimization and scalability.  
Are there any other modules or methods specifically suited for Ignition Perspective that you could suggest?

Thank you for your assistance.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 23, 2024, 11:50am UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036/2 "2024-11-23T11:50:32Z")

</div>

you can test:

> [@VIDEO starter kit for Ignition Vision and Perspective 8.1 / 8.3](https://forum.inductiveautomation.com/t/video-starter-kit-for-ignition-vision-and-perspective-8-1/66190):
>
> new VIDEO starter kit for Ignition Vision and Perspective 8.1 video_camera ! 3 use case: A standalone video wall Ignition Vision project A video wall Ignition Vision Project with the choices of the cameras driven by an Ignition Perspective Project A video stream displayed in a standalone Ignition Perspective Project (3. is a tricky and complex solution. Don't use it in production without running test over time) Ignition Vision edition support : RTS…

use the last version of the module.  
For RTSP h264 the stream can be transported to the perspective client.  
For RTSP h265, you need to decode/encode the stream to h264 or webM vp8/vp9 and it can cost a lot from a CPU point of view.  
In that case nvidia card can help you (GPU usage).

---

<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:** [November 23, 2024, 2:58pm UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036/3 "2024-11-23T14:58:45Z")

</div>

> [@SOON\_HWAN\_WANG1](#):
>
> pturmel’s Video Player Module

I don't have a "Video Player" Module. I have an Image Streamer Module.

> [@SOON\_HWAN\_WANG1](#):
>
> it only supports Ignition Vision

Not true. The MJPEG image streams are consumable by Perspective, too. The OpenCV loading in Vision is moot, as Perspective would use the OpenCV that loads in the gateway.

Anyways, the Perspective Video component plays the Image Streamer MJPEG just fine, with one caveat--you need an event script to restart playing whenever the stream stops.

However:

> [@SOON\_HWAN\_WANG1](#):
>
> over 100 RTSP CCTV cameras

That's a lot of cameras. My module is a resource hog, even for cameras that have no viewers.

---

<div class="post-metadata">

**Author:** ![SOON\_HWAN\_WANG1](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SOON\_HWAN\_WANG1](https://forum.inductiveautomation.com/u/SOON_HWAN_WANG1)\
**Post date:** [November 24, 2024, 3:49am UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036/5 "2024-11-24T03:49:15Z")

</div>

The test results show that the speed is incredibly fast! How can I purchase this module?

---

<div class="post-metadata">

**Author:** ![SOON\_HWAN\_WANG1](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SOON\_HWAN\_WANG1](https://forum.inductiveautomation.com/u/SOON_HWAN_WANG1)\
**Post date:** [November 24, 2024, 3:54am UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036/6 "2024-11-24T03:54:53Z")

</div>

Thank you for your response. I mistakenly thought your module would only work in Vision. I am trying again, but after registering the device, I cannot connect. What might I be missing? I have installed FFmpeg and OpenCV, and have completed all the settings

- open-cv  

- device  

- [http://192.168.85.21:8088/system/streamer](http://192.168.85.21:8088/system/streamer)  

- [http://192.168.85.21:8088/system/streamer/CAM](http://192.168.85.21:8088/system/streamer/CAM)  

- log

---

<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:** [November 24, 2024, 12:42pm UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036/7 "2024-11-24T12:42:38Z")

</div>

Your CAM device probably didn't start, possibly because you tried to use a set of location overrides for the gateway but didn't use the string "Gateway" for the MAC ID. (MAC IDs are for distinguishing designer/Vision instances.)

Look in your wrapper.log file for likely errors loading OpenCV or its dependencies. (They won't show in the java logs.)

---

<div class="post-metadata">

**Author:** ![SOON\_HWAN\_WANG1](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SOON\_HWAN\_WANG1](https://forum.inductiveautomation.com/u/SOON_HWAN_WANG1)\
**Post date:** [November 25, 2024, 4:56am UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036/8 "2024-11-25T04:56:28Z")

</div>

INFO | jvm 1 | 2024/11/25 13:51:25 | Couldn't repair and continue parse  
INFO | jvm 1 | 2024/11/25 13:51:39 | I [c.a.s.s.DummyImgResource] [13:51:39.332]: Instantiated Singleton  
INFO | jvm 1 | 2024/11/25 13:51:39 | I [c.a.s.s.DummyImgResource] [13:51:39.332]: Instantiated Generator Thread  
INFO | jvm 1 | 2024/11/25 13:51:39 | I [c.a.s.s.StreamerServlet] [13:51:39.333]: Streamer Servlet Initialized in w/  
INFO | jvm 1 | 2024/11/25 13:51:39 |  
INFO | jvm 1 | 2024/11/25 13:51:39 | I [c.a.s.s.DummyImgResource] [13:51:39.333]: Started Generator  
INFO | jvm 1 | 2024/11/25 13:51:39 | I [c.a.s.s.StreamerServlet] [13:51:39.334]: New Stream for streamer/CAM in Thread[webserver-57,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:51:44 | I [c.a.s.s.StreamerServlet] [13:51:44.278]: New Stream for streamer/CAM in Thread[webserver-44,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:51:46 | I [c.a.s.s.StreamerServlet] [13:51:46.681]: New Stream for streamer/null in Thread[webserver-60,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:52:02 | I [c.a.s.s.StreamerServlet] [13:52:02.156]: New Stream for streamer/CAM in Thread[webserver-74,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:52:02 | I [c.a.s.s.StreamerServlet] [13:52:02.561]: Client Closed Thread[webserver-60,5,main]  
INFO | jvm 1 | 2024/11/25 13:52:05 | I [c.a.s.s.StreamerServlet] [13:52:05.677]: New Stream for streamer/CAM in Thread[webserver-53,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:52:05 | I [c.a.s.s.StreamerServlet] [13:52:05.869]: New Stream for streamer/CAM in Thread[webserver-74,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:52:06 | I [c.a.s.s.StreamerServlet] [13:52:06.027]: New Stream for streamer/CAM in Thread[webserver-53,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:52:06 | I [c.a.s.s.StreamerServlet] [13:52:06.196]: New Stream for streamer/CAM in Thread[webserver-60,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:52:06 | I [c.a.s.s.StreamerServlet] [13:52:06.367]: New Stream for streamer/CAM in Thread[webserver-53,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:52:06 | I [c.a.s.s.StreamerServlet] [13:52:06.540]: New Stream for streamer/CAM in Thread[webserver-60,5,main] w/ skip=0 & qs=null  
INFO | jvm 1 | 2024/11/25 13:52:06 | I [c.a.s.s.StreamerServlet] [13:52:06.681]: New Stream for streamer/CAM in Thread[webserver-74,5,main] w/ skip=0 & qs=null

Based on my review of the `wrapper.log` file, it seems the streaming is working properly. However, accessing `stream/CAM` still results in a 404 error.

---

<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:** [November 25, 2024, 12:57pm UTC](https://forum.inductiveautomation.com/t/rtsp-cctv-streaming-optimization-in-ignition-perspective/99036/9 "2024-11-25T12:57:48Z")

</div>

No, that isn't the logging of interest. The part right after the module starts loading where it reports its success/failure loading the JAR and JNI. Then loading details for OpenCV scripting.

I **don't** think your streaming is starting correctly.
