# Start / stop outgoing stream using API

**URL:** https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568
**Category:** Wowza Developer Dojo
**Tags:** encoder, rest-api, server-administration
**Created:** [June 24, 2019, 2:51pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568 "2019-06-24T14:51:02Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Anders\_Gunnarsson](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Anders\_Gunnarsson](https://community.wowza.com/u/Anders_Gunnarsson)
#### Post date: [June 24, 2019, 2:51pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/1 "2019-06-24T14:51:02Z")

</div>

Hi

I have a always on RTMP camera in a conference room, that streams to my Wowza Engine (using Source Authentication).

How can I start/stop the outgoing live stream using the API?

(I only want to allow people from outside to look at specific times)

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [June 24, 2019, 6:38pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/2 "2019-06-24T18:38:08Z")

</div>

We have an article on how to list, create, update, and remove stream targets at the URL below.

[https://www.wowza.com/docs/stream-targets-query-examples-push-publishing](https://www.wowza.com/docs/stream-targets-query-examples-push-publishing)

---

<div class="post-metadata">

### Author: ![Anders\_Gunnarsson](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Anders\_Gunnarsson](https://community.wowza.com/u/Anders_Gunnarsson)
#### Post date: [June 24, 2019, 8:14pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/3 "2019-06-24T20:14:26Z")

</div>

Maybe I’ve miss understood the use of Stream Targets, I thought they were only used to redistribute to CDNs, youtube, etc?

But are you saying I can use them to stop/start a regular outgoing stream? (Where viewing on /live/myStream/playlist.m3u8, with HLS/mpeg-dash)

In the guide it seems like they are redistributing the stream to it’s self? (“host”: “localhost”) Does that mean the same instance of wowza?

---

<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: [June 24, 2019, 11:40pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/4 "2019-06-24T23:40:40Z")

</div>

Hi [@Anders Gunnarsson](http://community.wowza.com/community/questions/52063/start-stop-outgoing-stream-using-api.html#), yes stream targets are used to push a stream to another server, CDN or other distributed destinations; not for a regular outgoing stream. The article above refers to settings for stream targets admin.

---

<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: [June 24, 2019, 11:40pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/5 "2019-06-24T23:40:53Z")

</div>

Wowza uses localhost rather than actual IP addresses as people might use that actual IP address for testing. It is assumed that the person who is managing the server is logged directly into the server.

This is why localhost is used in the API call.

```auto
`curl -X GET \
-H 'Accept:application/json; charset=utf-8' \
-H 'Content-Type:application/json; charset=utf-8' \
"http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/adv"

```

---

<div class="post-metadata">

### Author: ![Anders\_Gunnarsson](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Anders\_Gunnarsson](https://community.wowza.com/u/Anders_Gunnarsson)
#### Post date: [June 25, 2019, 3:01pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/6 "2019-06-25T15:01:49Z")

</div>

Ok, but I don’t have a need to redistribute anywhere, I prefer to use the regular wowza outgoing live stream, but I need to start/stop it (even that the incoming stream isn’t stopped).

Do you have suggestions on how to do that?

---

<div class="post-metadata">

### Author: ![Andrew\_Ramberg](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Andrew\_Ramberg](https://community.wowza.com/u/Andrew_Ramberg)
#### Post date: [June 25, 2019, 7:15pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/7 "2019-06-25T19:15:40Z")

</div>

Hi Anders,

If you’re looking to restrict playback to a specific time or for only certain users then using Secure Token might be a good optio

[https://www.wowza.com/docs/how-to-protect-streaming-using-securetoken-in-wowza-streaming-engine#securetoken-query-parameters](https://www.wowza.com/docs/how-to-protect-streaming-using-securetoken-in-wowza-streaming-engine#securetoken-query-parameters)

Otherwise, if you’re looking to control when a playback stream is created by the Application, you could control the source publishing credentials or MediaCaster stream file connections using the REST API.

[https://www.wowza.com/docs/stream-management-query-examples](https://www.wowza.com/docs/stream-management-query-examples)

[https://www.wowza.com/docs/live-sources-query-examples](https://www.wowza.com/docs/live-sources-query-examples)

Best regards,  
Andrew

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [June 26, 2019, 12:04am UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/8 "2019-06-26T00:04:22Z")

</div>

Servers do not push content to players. Players “pull” content from streaming media servers. For example.

```auto
Encoder --> Wowza Streaming Engine <-- Clients connect to server for playback.

```

The article below will show you how to configure an RTMP encoder to send a live stream to Wowza Streaming Engine and play back the content via Apple HLS.

[https://www.wowza.com/docs/how-to-set-up-live-streaming-using-an-rtmp-based-encoder](https://www.wowza.com/docs/how-to-set-up-live-streaming-using-an-rtmp-based-encoder)

This is an example of an Apple HLS playback URL.

```auto
http://[wowza-address]:1935/live/myStream/playlist.m3u8

```

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [June 26, 2019, 12:06am UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/9 "2019-06-26T00:06:53Z")

</div>

Servers do not push content to players. Players “pull” content from streaming media servers. For example.

```auto
Encoder --> Wowza Streaming Engine <-- Clients connect to server for playback.

```

The article below will show you how to configure an RTMP encoder to send a live stream to Wowza Streaming Engine and play back the content via Apple HLS.

[https://www.wowza.com/docs/how-to-set-up-live-streaming-using-an-rtmp-based-encoder](https://www.wowza.com/docs/how-to-set-up-live-streaming-using-an-rtmp-based-encoder)

This is an example of an Apple HLS playback URL.

```auto
http://[wowza-address]:1935/live/myStream/playlist.m3u8

```

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [June 26, 2019, 12:09am UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/10 "2019-06-26T00:09:13Z")

</div>

You have a few choices on when you want to perform streaming.

**1)** Manually start and stop your live stream.

**2)** Use our Stream Scheduler plugin.

[https://www.wowza.com/docs/how-to-schedule-streaming-with-wowza-streaming-engine-streampublisher](https://www.wowza.com/docs/how-to-schedule-streaming-with-wowza-streaming-engine-streampublisher)

---

<div class="post-metadata">

### Author: ![Anders\_Gunnarsson](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Anders\_Gunnarsson](https://community.wowza.com/u/Anders_Gunnarsson)
#### Post date: [June 26, 2019, 11:33am UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/11 "2019-06-26T11:33:36Z")

</div>

Yes, what I’m trying to achieve is something like

```auto
Encoder --> Wowza Streaming Engine [Conversion & Streaming Start/Stop] <-- Clients connect to server for playback.

```

Both so that users can’t connect, and that wowza doesn’t keep converting (wasting cpu) during that time.

Maybe **ModuleTranscoderControl** is close, but that cant be controlled remotely.

Seems like Wowza Cloud has a REST API for their Scheduling, is that possible for Streaming Engine?  
[https://www.wowza.com/docs/how-to-schedule-a-transcoder-by-using-the-wowza-streaming-cloud-rest-api](https://www.wowza.com/docs/how-to-schedule-a-transcoder-by-using-the-wowza-streaming-cloud-rest-api)

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [June 26, 2019, 2:53pm UTC](https://community.wowza.com/t/start-stop-outgoing-stream-using-api/53568/12 "2019-06-26T14:53:25Z")

</div>

Take a look at our stream publisher module.

[https://www.wowza.com/docs/how-to-schedule-streaming-with-wowza-streaming-engine-streampublisher](https://www.wowza.com/docs/how-to-schedule-streaming-with-wowza-streaming-engine-streampublisher)
