Wowza Community

Starting and stoping live streams programmatically

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,

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

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

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

Richard

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

Richard

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 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-record-live-streams-httplivestreamrecord

Richard

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

Stream Manger is documented here:

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/

Richard

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

Richard

“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

You can use HTTP requests and send those requests to the Stream Manager or use the MediaCaster API directly to stop/start streams.

-Lisa

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?

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?

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?

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

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…

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?

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.

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?

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/

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.

Stream Manger is documented here:

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.