# Starting and stoping live streams programmatically

**URL:** <https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872>\
**Category:** Wowza Streaming Engine\
**Tags:** server-administration\
**Created:** [December 16, 2011, 1:00pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872 "2011-12-16T13:00:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 16, 2011, 1:00pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/1 "2011-12-16T13:00:42Z")

</div>

I need to start and stop a live stream programmatically.

I’ve been told before to look into HTTPProviders for this, which appear to allow me to create an API to interact with as far as I can tell, and the authentication would work the same way that it does for the localhost:8500/streammanager interface (am I right here?).

My question is that if the HTTPProvider allows me to create a streammanager like API, then why can’t I just use the streammanger API?

It looks like I just need to create a form post to the ‘streamAction’ page with the right data and that would work? assuming I get the authentication part working right… does anyone have any tips on how to do this authentication too, if it is possible?

Thanks,

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 16, 2011, 9:10pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/2 "2011-12-16T21:10:57Z")

</div>

If you are stopping and starting MediaCaster streams, e.g. IP camera or mpeg-ts stream, then you can use StreamManager.

If you are talking about stopping and starting RTMP or RTP push encoder, a software or hardware encoder that is pushing a stream to Wowza, StreamManager or HTTPProvider won’t work.

Richard

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [December 19, 2011, 3:07pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/3 "2011-12-19T15:07:24Z")

</div>

We are not currently documenting and supporting the query parameters and POST data of today’s stream manager. There is a good chance it will change in the future. So that is why we don’t approach it this way. It is best to build your own HTTPProvider. Then you can control the interface and we do not plan to change this API moving forward.

I hope this helps to clarify the reason for pushing to the HTTPProvider method.

Charlie

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 17, 2011, 1:06pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/4 "2011-12-17T13:06:56Z")

</div>

The MediaCaster API which StreamManager uses is very simple really:

[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)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 17, 2011, 1:09pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/5 "2011-12-17T13:09:39Z")

</div>

Also, before StreamManager was built-in to Wowza 2 it was an Addon that included source code, which will work in Wowza 3:

> [@MediaCasterStreamManager controls start/stop/record of RTP, MPEG-TS and SHOUTcast](http://community.wowza.com/t/-/54):
>
> This package provides a Flash tool to interface with the MediaCasterStreamManager API. This to tool is used to start and stop the publishing of non-pushed based encoder streams such as Native RTP, MPEG-TS and SHOUTcast. It provides greater control over the publishing and recording process when using these encoder technologies. This tool is designed to work with the live, live-lowlatency and liverepeater-origin stream types rather than the MediaCaster stream types (rtp-live[-\*] and shoutcast[-\*])…

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 19, 2011, 7:34pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/6 "2011-12-19T19:34:51Z")

</div>

You would use that MediaCaster API in a HTTPProvider on Server B which Server A can run using the HTTPUtils API in a Wowza Module, ServerListener or other HTTPProvider. Use Module or HTTProvider on Server B if you need a Flash or HTTP UI involved. Use ServerListener for long running processes that might call Server B.

There is no built-in way to do this. You need the [Wowza IDE](http://wowza.com/ide.html) to build these extensions.

Both of these HTTPProvider examples use MediaCaster API

[https://www.wowza.com/docs/how-to-parse-post-or-get-variables-in-an-http-provider](https://www.wowza.com/docs/how-to-parse-post-or-get-variables-in-an-http-provider)

[https://www.wowza.com/docs/how-to-record-live-streams-httplivestreamrecord](https://www.wowza.com/docs/how-to-record-live-streams-httplivestreamrecord)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 19, 2011, 9:28pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/7 "2011-12-19T21:28:01Z")

</div>

You said you need to “I need to start and stop a live stream programmatically”. I have provided several options. Take your pick, use StreamManager, it’s up to you.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 19, 2011, 9:39pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/8 "2011-12-19T21:39:11Z")

</div>

Stream Manger is documented here:

[https://www.wowza.com/docs/how-to-use-stream-manager-in-wowza-media-server-3](https://www.wowza.com/docs/how-to-use-stream-manager-in-wowza-media-server-3)

Again, you asked for “programmtic” solutions, which is what I have been showing you. All Articles and docs are here:

[https://www.wowza.com/docs/](https://www.wowza.com/docs/)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 19, 2011, 11:01pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/9 "2011-12-19T23:01:38Z")

</div>

The built-in StreamManager is an interactive user interface. The programmatic interface is the MediaCaster API, which is demonstrated in several links I have shown.

The Wowza IDE has a guide to getting started with HTTPProviders, and the IDE includes a menu itme (New \> Wowza HTTPProvider) for creating a new HTTPProvider (and application Modules and ServerListeners). There is learning curve if you are just getting started, but these examples and the IDE make it easy to get started quickly:

[http://wowza.com/ide.html](http://wowza.com/ide.html)

Richard

---

<div class="post-metadata">

**Author:** ![Randall\_Auriemma](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@Randall\_Auriemma](https://community.wowza.com/u/Randall_Auriemma)\
**Post date:** [December 17, 2011, 3:38am UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/10 "2011-12-17T03:38:00Z")

</div>

“Is it possible to execute actions on the streammanager via command line?”

See here: [Sample Java class for creating a command line interface to control Wowza Media Server](https://www.wowza.com/docs/how-to-set-up-a-command-line-interface-to-wowza-api)

---

<div class="post-metadata">

**Author:** ![Lisa\_Wong](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@Lisa\_Wong](https://community.wowza.com/u/Lisa_Wong)\
**Post date:** [December 16, 2011, 3:03pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/11 "2011-12-16T15:03:33Z")

</div>

You can use HTTP requests and send those requests to the [Stream Manager](https://www.wowza.com/docs/how-to-use-stream-manager-in-wowza-media-server-3) or use the [MediaCaster API directly to stop/start streams](https://www.wowza.com/docs/how-to-use-the-wowza-streaming-engine-java-api-to-start-and-stop-mediacaster-streams).

-Lisa

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 16, 2011, 1:17pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/12 "2011-12-16T13:17:21Z")

</div>

> If you are stopping and starting MediaCaster streams, e.g. IP camera or mpeg-ts stream, then you can use StreamManager.

This one, IP camera.

How can I use the streammanager? is it possible to make a http request to get these start/stop actions done?

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 16, 2011, 2:42pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/13 "2011-12-16T14:42:36Z")

</div>

Is it possible to execute actions on the streammanager via command line? http request (appears so)? or programmatically via Java class living in the same Java environment or something?

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 16, 2011, 3:28pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/14 "2011-12-16T15:28:58Z")

</div>

Since we want to be able to scale (ie: introduce as many wowza servers as we want), I’m thinking http requests would be a better method. This does look possible, if I read the html source code for the stream manager, but is there not any documentation for this?

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 19, 2011, 10:58am UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/15 "2011-12-19T10:58:09Z")

</div>

> The MediaCaster API which StreamManager uses is very simple really:
> 
> [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)
> 
> Richard

I don’t understand how this is useful to me… I have one server, server A, running anything on it let’s say it’s NodeJS, and I have another server, server B, running Wowza, and I want server A to tell server B to start a live stream… so I want to do a http request to the stream manager to start the stream…

So, how is Java code examples supposed to help me?

Where is the documentation for the stream manager? or is there none? and if there is none, then why is there none? Is starting IP cameras on cell phone networks, which requires ondemand streaming, not a common enough use case?

Please don’t point me to another Java code example…

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 19, 2011, 1:20pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/16 "2011-12-19T13:20:54Z")

</div>

Isn’t the Stream Mananager a HTTPProvider? and doesn’t it do everything that I want already? (ie: start and stop live streams), so why do I need to create a new HTTPProvider that has the same functionality as the stream manager?

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 19, 2011, 1:34pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/17 "2011-12-19T13:34:51Z")

</div>

Yes I understand that the stream manager is a choice that I can use, but I’ve been asking if there is documentation on the particulars of making these post requests (page names, variables names, variable value options) that I am interested in, and if they don’t exist I then I’m wondering why that is.

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 19, 2011, 1:37pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/18 "2011-12-19T13:37:01Z")

</div>

> You said you need to “I need to start and stop a live stream programmatically”. I have provided several options. Take your pick, use StreamManager, it’s up to you.
> 
> Richard

I’ve asked follow-up questions, are these not permitted?

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 19, 2011, 2:26pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/19 "2011-12-19T14:26:19Z")

</div>

> Again, you asked for “programmtic” solutions, which is what I have been showing you. All Articles and docs are here:
> 
> [Wowza docs](https://www.wowza.com/docs/)
> 
> Richard

Are http requests made with code not a programmatic solution?

My original post was asking for documentation on making posts to the Stream Manager programmatically, in order to start/stop live streams, which I haven’t seen yet; but I was also open to better options, which I have not seen.

---

<div class="post-metadata">

**Author:** ![Z\_Tatic](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Z\_Tatic](https://community.wowza.com/u/Z_Tatic)\
**Post date:** [December 19, 2011, 2:40pm UTC](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872/20 "2011-12-19T14:40:55Z")

</div>

> Stream Manger is documented here:
> 
> [Stream from an IP camera over RTSP to Engine](https://www.wowza.com/docs/how-to-use-stream-manager-in-wowza-media-server-3)

This just seems to document how one sets a username/password for the Stream Manager and where one goes to login in to it, but I don’t see documentation on using it programmatically. Wouldn’t using this existing code be more useful then writing another HTTPProvider that does a subset of tasks, and would require me to rewrite existing code?

I’m sorry if I seem rude, but I"m trying to understand your product, and I’m just not understanding why creating a HTTPProvider is being suggested to me… It’s like saying you shouldn’t talk to a operator, instead you should create a sub-operator to talk to the operator… and I don’t understand why, is there some reason? or is this because it’s something that used to have to be done and no longer does need to be, but the new method isn’t documented yet, or is the Stream Manager subject to change and thus building on it is like building on a moving platform?

I feel like I’m talking to a brick wall here that says “use HTTPProvider (which StreamManager is hint hint)” or “look at how you login to Stream Manager”.

Richard if you don’t want to answer my questions, then you don’t need to post the same links.

[Next page](https://community.wowza.com/t/starting-and-stoping-live-streams-programmatically/36872.md?page=2)
