Wowza Community

Push Publishing AddOn package to push stream to CDNs and service providers

It’s the first arg of the IMediaStreamActionNotify2 onPubish handler:

public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
		{
			if (true)//!streamName.startsWith(streamPrefix))
			{
				try
				{
					IApplicationInstance appInstance = stream.getStreams().getAppInstance();
					
					synchronized(publishers)
					{
						PushPublisherRTMP publisher = new PushPublisherRTMP();
						
						// Source stream
						publisher.setAppInstance(appInstance);
						publisher.setSrcStreamName(streamName);
			
						// Destination stream
						publisher.setHostname(pushToDestination);
						publisher.setPort(pushToPort);
						publisher.setDstApplicationName(pushToApplicationName);
						publisher.setDstStreamName(streamPrefix+streamName + "?test=test");
						
						//publisher.getAppInstance().r
			
						// SecureToken shared secret
						//publisher.setSecureTokenSharedSecret(secureTokenSharedSecret);
			
						publisher.setSendFCPublish(true);
						publisher.setSendReleaseStream(true);
			
						publisher.connect();
						publishers.put(stream, publisher);
					}
				}
				catch(Exception e)
				{
					WMSLoggerFactory.getLogger(null).error("ModulePushPublishSimpleExample#StreamNotify.onPublish: "+e.toString());
				}
			}
		}

Richard

Try this:

AMFDataMixedArray data = new AMFDataMixedArray();
data.put("caption", new AMFDataItem(capton);
stream.sendDirect("setCaption", data);

Flash client-side

// set up netstream for the callback on the live stream
nsPlayClientObj:Object = new Object();
nsPlayClientObj.setCaption = function(caption:String):void
{
trace(caption);
}
nsPlay.client = nsPlayClientObj;

Richard

What version of Wowza are you using? It should work with 2.2.3

https://www.wowza.com/docs/wowza-streaming-engine-software-updates

Richard

Maybe so. Write to sales@wowza.com to see if there is a newer version.

Richard

I think it should work if both server A and B are both Wowza 2.2.3+

You need to listen in a Flash client that is playing the stream from B server.

Server-side on “A” server:

stream.sendDirect("myClientsideHandler","somedata");

Client-side, Flash connected to “B” server and subscribed to the pushed stream:

var clientObj:Object = new Object();
clientObj.myClientsideHandler = function(data:String):void
{
trace(data);
});
netconnection.client = clientObj;
netconnection.connect("rtmp://ip/app");

Richard

Ale,

Do this:

publisher.setConnectionFlashVerion("FMLE/3.0");

Richard

You probably need to upgrade:

https://www.wowza.com/docs/wowza-streaming-engine-software-updates

Richard

Ale,

You should be able to just create a 2nd Publisher, publisher2, that has same source and different destination.

Richard

I think you can push publish to ustream as if it were another Wowza server, which I think they are.

You should not need the below line, in fact it might be a problem. Remove this:

publisher.setRemoveDefaultAppInstance(true);

When testing, make sure you are using app instance that you are specifying in playback

Server: rtmp:[ustream-server-address]:1935/ustreamVideo/777xxxxx

Stream: nilJslfZP83FFZLvBGR2DCxxxxxxxxx

If there is an actual space in your stream name (as in your example), I would take that out.

Richard

Joe,

I asked to confirm, and found that I was wrong that ustream.tv is necessarily Wowza servers. Couldn’t you just publish to ustream.tv directly with an encoder?

Richard

Alex,

Try this:

publisher.setConnectionFlashVerion("someUserAgent");

Richard

It is an API. The package includes a simple example that will push from Wowza to Wowza.

Richard

@Kristian,

Add the following line before publisher.connect()

// add:
publisher.setConnectionFlashVerion("FMLE/3.0");
publisher.connect();

Richard

Kristian,

I’ll see about adding that line to the example.

Also, it would be better to do this:

publisher.setConnectionFlashVerion(PushPublisherRTMP.CURRENTFMLEVERSION);

Richard

When the stream is started in StreamManager onPublish event should fire. If you have push publisher module setup, which uses onPublish, it should work.

Richard

@Kristian,

We updated the example in the push package per your suggestion, and included (commented out) the authentication process.

Thanks,

Richard

I tried it again:

I already have a push application named “push” and a live application named “live” that is the target of the push application. I made no changes to either one.

I have a .stream file named axis.stream in the content that has the rtsp url of an axis camera.

I opened StreamManager and started axis.stream on the push application with MediaCaster Type “rtp”

PushPublisher#StreamOnStatus.onCallback[rtmp://localhost:1935/live/definst/definst/axis.stream]: NetStream.Publish.Start

Then I tested with LiveVideoStreaming player:

Server: rtmp://[wowza-address]:1935/live

Stream: axis.stream

Richard

You can only push RTMP streams to Akamai with the Push Publishing addon:

https://www.wowza.com/docs/how-to-push-streams-to-cdns-and-other-services-push-publishing

I think RTSP output can be configured on Akamai side

Richard

You can use this work-around in this case too:

http://www.wowza.com/forums/showthread.php?13593-Wowza-scaling-what-are-the-possibilities

Richard

Try adding this line for Akamai:

publisher.setSendOriginalTimecodes(true);

Richard