Wowza Community

Push Publish using Server API not visible in UI

Hi all,

Using the Java API, I am creating several pushPublish instances for my stream. The stream is successfully getting pushed to the destinations. But, I’m not able to see any of them under the Stream Targets page in the Wowza Streaming Engine Manager page. When I use the pushPublishMap.txt method, then these stream targets are showing up on this page. But, when I use the Java API based method, then the stream targets list is empty on that page.

Is there anything that I need to do in order for API based PushPublish to show up there?

Also, could someone kindly tell me what the uses are for the setEntryName() method in the PushPublish instance, and the addPushPublishSession() method in the App Instance? I’ve used them both independently and together as well, but neither of them make any difference to the stream targets page. In fact, the stream gets pushed regardless of calling these methods.

Here is my code:

PushPublishRTMP publisher = new PushPublishRTMP();
publisher.setConnectionFlashVersion(PushPublishRTMP.CURRENTFMLEVERSION);
publisher.setAppInstance(appInstance);
publisher.setSrcStreamName(streamName);
publisher.setHost(hostName);
publisher.setPort(1935);
publisher.setDstStreamName(streamName);
publisher.setDstApplicationName(appName);
publisher.setSendOriginalTimecodes(true);
publisher.setOriginalTimecodeThreshold(0x100000);
publisher.setSendFCPublish(true);
publisher.setSendReleaseStream(true);
publisher.setSendOnMetadata(true);
publisher.setDebugLog(true);
publisher.setDebugPackets(false);
IMediaStream stream = appInstance.getStreams().getStream(streamName);
appInstance.addPushPublishSession(stream, publisher.createPushPublishSession());
publisher.setEntryName(streamName + "_" + Integer.toString((int) Math.ceil(Math.random() * 1000)));
publisher.connect();

Any help is very much and truly appreciated.

Thank you!

Hi,

When pushing a stream using the PushPublish API, you should not see the stream listed in the Manager UI in the Stream Targets section, as the API methods are being run on a lower level. The setEntryName() method is only used internally to identify a stream.

In order to programmatically add Stream Targets that can then be viewed from the Manager UI, I would recommend using the REST API instead. The Manager UI actually makes use of the REST API methods to set these values.

Michelle

Hi,

The addPushPublishSession() call adds the publish session to the list of active push publish sessions. The Push Publish module uses this list to monitor and manage the active sessions.

The latest version of Wowza (4.5.0.01) currently has the IPushPublishManager API to add/remove entries to the PushPublishMap.txt, which would then show up as Stream Targets in the Manager UI.

To get a reference to the current IPushPublishManger, you can use the following example code:

IVHost iVhost = (IVHost)VHostSingleton.getInstance(IVHost.VHOST_DEFAULT);
if (iVhost != null)
{
IPushPublishManager pushPublishManager = iVhost.getPushPublishManager();
if (pushPublishManager != null)
pushPublishManager.saveEntry(String appName, String entryName, HashMap<String,String> hashmap );
}

where the hashmap in the third parameter contains all the key/value pairs you would see in the JSON notation for the entryName in PushPublishMap.txt file.

Michelle

Hi Michelle,

Thank you for your reply. Could you help me understand the use of the addPushPublishSession() method, please?

Thank you in advance.