# Rtsp auto disconnect, reconnect

**URL:** <https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646>\
**Category:** Wowza Streaming Engine\
**Created:** [August 4, 2021, 7:15am UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646 "2021-08-04T07:15:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![changil\_shin](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@changil\_shin](https://community.wowza.com/u/changil_shin)\
**Post date:** [August 4, 2021, 7:15am UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646/1 "2021-08-04T07:15:31Z")

</div>

hello.  
There is a system consisting of cctv - wowza - player.  
The cctv is serviced as rtsp and it is configured using the stream file in wowza. The problem is that cctv uses LTE communication, which incurs a lot of cost.  
If there is no player, cctv and Wowza will be disconnected, and if there is a player, cctv and Wowza will be connected.  
How can I do it like above? Or is there a better way?  
thanks.

---

<div class="post-metadata">

**Author:** ![Connessione](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Connessione](https://community.wowza.com/u/Connessione)\
**Post date:** [August 5, 2021, 6:02pm UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646/2 "2021-08-05T18:02:02Z")

</div>

How do you configure your cctv now ? The key to saving cost is to either publish on demand or pull stream into wowza on demand.

1. CCTV must publish only on events like motion detection etc to save bandwidth

2. You can also have it in always on mode where it publishes locally and on demand restream it to online wowza instance.

Even if you want to pull on demand when a subscriber appears you will need to devise a system where you send the stream to wowza on event. Sounds like a custom app might be a good idea.

How do you wish to make this into an I demand system ?

---

<div class="post-metadata">

**Author:** ![video\_streaming](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@video\_streaming](https://community.wowza.com/u/video_streaming)\
**Post date:** [August 5, 2021, 7:06pm UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646/3 "2021-08-05T19:06:44Z")

</div>

Hi @changil_shin so we do have some customers that have set up IP cameras that will only connect to Wowza when a player or viewer tries to connect to the stream. An example would be a 24 hr wildlife live stream.

You could set this up for RTMP streams using rtp-live in Streaming Engine with Wowza MediaCaster.

[https://www.wowza.com/docs/how-to-start-streams-at-server-startup](https://www.wowza.com/docs/how-to-start-streams-at-server-startup)

* * *

If you have advanced Java skills, you could take a peek at this as well. Good luck!

[https://www.wowza.com/docs/how-to-use-the-wowza-streaming-engine-java-api-to-start-and-stop-mediacaster-streams](https://www.wowza.com/docs/how-to-use-the-wowza-streaming-engine-java-api-to-start-and-stop-mediacaster-streams)

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [August 5, 2021, 9:09pm UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646/4 "2021-08-05T21:09:29Z")

</div>

You can’t configure it via the manager. You just need to set the Stream Type to `rtp-live` in the Application.xml. It won’t work with any http streamers.

It does work with rtsp and webrtc players

---

<div class="post-metadata">

**Author:** ![changil\_shin](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@changil\_shin](https://community.wowza.com/u/changil_shin)\
**Post date:** [August 6, 2021, 1:27am UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646/5 "2021-08-06T01:27:04Z")

</div>

Thanks for answering my inquiry.  
CCTV is an rtsp server and is always encoded.  
How to work with wowza must be taken by wowza by accessing cctv.  
Stream Files is set in wowza’s Application.

---

<div class="post-metadata">

**Author:** ![changil\_shin](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@changil\_shin](https://community.wowza.com/u/changil_shin)\
**Post date:** [August 6, 2021, 1:32am UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646/6 "2021-08-06T01:32:12Z")

</div>

Thanks for answering my inquiry.  
What does rtp-live mean?

---

<div class="post-metadata">

**Author:** ![changil\_shin](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@changil\_shin](https://community.wowza.com/u/changil_shin)\
**Post date:** [August 6, 2021, 1:39am UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646/7 "2021-08-06T01:39:48Z")

</div>

Thanks for answering my inquiry.  
As a basic function of wowza, there is no function to disconnect the CCTV when there is no user access, right?

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [August 6, 2021, 4:25pm UTC](https://community.wowza.com/t/rtsp-auto-disconnect-reconnect/93646/8 "2021-08-06T16:25:22Z")

</div>

Hello, so if you look at the docs I sent, you will see that rtp-live is a type of streaming application you can create in the manager that pulls the stream from the camera only when a player tries to connect, so that it’s not running a stream 24 hrs costing you a fortune.

In one box, you select RTP which is a streaming protocol and in the next section, you click “live”. The images show you how to do this in the doc.

> **[Real-time Transport Protocol](https://en.wikipedia.org/wiki/Real-time_Transport_Protocol)**
>
> The Real-time Transport Protocol (RTP) is a network protocol for delivering audio and video over IP networks. RTP is used in communication and entertainment systems that involve streaming media, such as telephony, video teleconference applications including WebRTC, television services and web-based push-to-talk features.
> RTP typically runs over User Datagram Protocol (UDP). RTP is used in conjunction with the RTP Control Protocol (RTCP). While RTP carries the media streams (e.g., audio and vid...

When there is no player or viewer, the stream stops after a certain amount of time and there is nothing you have to do, it’s an automatic disconnect.

This is a bit of a unique workflow and not well documented on our site, even though it is possible to set up. I would strongly encourage you to submit a support ticket and have a Wowza engineer walk you through it. Good luck to you!
