728x90

I am new to Wowza. is there any rest api available in wowza to change the content path of the streaming and to enable the recording as stream gets started?

I have tried various api but all in vain.Waiting for the answer eagerly.

  • google wowza api java shows some hits, including REST. What is the specific problem? – JimHawkins Jun 9 '16 at 11:14
  • As per my requirement, (i am using wowza gocoder app for streaming), i want that all videos get save/record on the path defined by me. Like for eg. to create a folder daily with the date so that all videos streamed on that date, get record in the corresponding date folder. I don't want to do this using engine manager manually but using api to make it dynamic. PLEASE HELP. Thanks in Advance. – lavleen Jun 10 '16 at 6:53 
  • which programming language do you use? – JimHawkins Jun 10 '16 at 6:58
  • Python. Currently, i change content path and start recording by click red button available in incoming streams using engine manager. But i want it dynamic. Any API available for this. – lavleen Jun 10 '16 at 6:58 
  • I am using Python. – lavleen Jun 10 '16 at 7:52

There are a couple of ways to approach this. Since all you need to do is save your recordings to a folder with a specific naming syntax, you can use the Wowza Java API to create a custom module that moves the recordings. You will need to add a listener to notify you when the recording is completed and ready to be moved. Here is the example source code that does this:

package com.wowza.wms.plugin.test.module;

import java.io.*; 
import java.util.*;

import com.wowza.wms.application.*;
import com.wowza.wms.module.*;
import com.wowza.wms.stream.*;

public class ModuleWriteListener extends ModuleBase
{
    class WriteListener implements IMediaWriterActionNotify
    {
        public void onFLVAddMetadata(IMediaStream stream, Map<String, Object> extraMetadata)
        {
            getLogger().info("ModuleWriteListener.onFLVAddMetadata["+stream.getContextStr()+"]");
        }

        public void onWriteComplete(IMediaStream stream, File file)
        {
            getLogger().info("ModuleWriteListener.onWriteComplete["+stream.getContextStr()+"]: "+file);
        }
    }

    public void onAppStart(IApplicationInstance appInstance)
    {
        appInstance.addMediaWriterListener(new WriteListener());
    }
}

You can also update the storage path of your application using the REST API on a regular basis. You can try something like:

curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testlive -d'
{
  "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testlive",
  "name":"testlive",
   "streamConfig": {
      "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testlive/streamconfiguration",
      "storageDir": "${com.wowza.wms.context.VHostConfigHome}/content"
   }
}'

After changing the setting, you will need to restart the live application to apply the changes. This is not the recommended method, however, since you may update an application's setting while a recording is in process.


+ Recent posts