# Playlist with MPEG-TS as source

**URL:** <https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715>\
**Category:** Wowza Streaming Engine\
**Created:** [August 6, 2014, 3:11pm UTC](https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715 "2014-08-06T15:11:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Shimamoto](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@David\_Shimamoto](https://community.wowza.com/u/David_Shimamoto)\
**Post date:** [August 6, 2014, 3:11pm UTC](https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715/1 "2014-08-06T15:11:15Z")

</div>

I am making a scheduled play list using two sources.

1. MPEG-TS input

2. Local file

Above sources alternate at specified hours.

Following the tutorial, I got the system working as expected.

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

However, this method requires two procedures.

1. For the MPEG-TS, create a Stream file listening to the UDP port. (Name it ‘test.stream’ for now)

2. Edit ‘streamschedule.smil’ so that video source points to ‘test.stream’ at desired hour.

Instead of this, I would like to write directly inside ‘streamschedule.smil’ which UDP port to listen to for the incoming MPEG-TS and use that as video source.

Is this possible?

---

<div class="post-metadata">

**Author:** ![Zoran](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/zoran/32/385_2.png) [@Zoran](https://community.wowza.com/u/Zoran)\
**Post date:** [August 6, 2014, 4:45pm UTC](https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715/2 "2014-08-06T16:45:07Z")

</div>

Hi,

The streamschedule.smil file needs to have a reference to a file or a stream that is already available/published on your Wowza server.

In order to have Wowza connect/listen to a certain UDP port, you will need to configure the .stream file with the correct IP and port information and then publish the stream to your Wowza server.

After these conditions are satisfied, you will be able to have your scheduled stream working.

Just as a remark, some player do not support a sudden change in video codec and/or video image size. Having this in mind, you will need to make sure that your local file and the incoming MPEG-TS stream, have the same encoding parameters.

Zoran

---

<div class="post-metadata">

**Author:** ![Daren\_Johnson](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@Daren\_Johnson](https://community.wowza.com/u/Daren_Johnson)\
**Post date:** [August 7, 2014, 8:55pm UTC](https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715/3 "2014-08-07T20:55:17Z")

</div>

Hi,

It does not have that capability. You would need to extend the module Stream Publisher to do that.

The Schedule Stream Publisher is part of the Wowza [Module Collection.](https://www.wowza.com/docs/utility-modules-for-wowza-streaming-engine-media-server-software)

The Module Collection download package includes source code that you can use to see how the modules are implemented and to extend the modules for your own use.

Daren

---

<div class="post-metadata">

**Author:** ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)\
**Post date:** [August 11, 2014, 10:22am UTC](https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715/4 "2014-08-11T10:22:42Z")

</div>

Hi,

The original method does send a response back to the flash client so it would possibly be left hanging and waiting for a response.

Assuming that the attempt to reload the schedule is malicious, it would probably be better to close the connection instead.

The following will do that.

```auto
	public void loadSchedule(IClient client, RequestFunction function, AMFDataList params)
	{
		try
		{
			logger.info("StreamPublisher: Relaod requested by: " + client.getIp());
			if (!client.getIp().equals("127.0.0.1"))
			{
				client.setShutdownClient(true);
				logger.info("StreamPublisher: Rejecting remote request.");	
			}
			else
			{
				sendResult(client, params, loadSchedule());
			}
		}
		catch (Exception e)
		{
			sendResult(client, params, e.getMessage());
		}
	}

```

Roger.

---

<div class="post-metadata">

**Author:** ![David\_Shimamoto](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@David\_Shimamoto](https://community.wowza.com/u/David_Shimamoto)\
**Post date:** [August 8, 2014, 1:42pm UTC](https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715/5 "2014-08-08T13:42:21Z")

</div>

Dear Zoran,

Thank you.

I will keep the current settings then.

I would appreciate one more help

The files provided to call the reload method from a web browser ‘ModuleScheduleClient’ works fine.

However, by default the module seems to accept calls from any remote host.

Does StreamPublisher module provide a way to limit which hosts to listen to?

Thank you.

---

<div class="post-metadata">

**Author:** ![David\_Shimamoto](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@David\_Shimamoto](https://community.wowza.com/u/David_Shimamoto)\
**Post date:** [August 9, 2014, 1:24pm UTC](https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715/6 "2014-08-09T13:24:50Z")

</div>

Hi Daren,

Thank you.

I modified ‘ModuleStreamPublisher.java’,

At the top of ‘loadSchedule’ method, added the following to reject remote calls.

logger.info("StreamPublisher: Relaod requested by: " + client.getIp());

if (!client.getIp().equals(“127.0.0.1”)) {

logger.info(“StreamPublisher: Rejecting remote request.”);

return;

}

logger.info(“StreamPublisher: Reloading schedule file.”);

It seems to be working as expected on the surface.

However, to be honest I am not so familiar with the Wowza API, nor Flash programming.

Could the above code (how it leaves the method) potentially leave any server threads or Flash clients waiting for a response hanging?

---

<div class="post-metadata">

**Author:** ![David\_Shimamoto](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@David\_Shimamoto](https://community.wowza.com/u/David_Shimamoto)\
**Post date:** [August 21, 2014, 11:17am UTC](https://community.wowza.com/t/playlist-with-mpeg-ts-as-source/41715/7 "2014-08-21T11:17:56Z")

</div>

Hi Roger,

That is great.

I will be using your suggested code.

Thank you.
