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.
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.
'LINUX' 카테고리의 다른 글
Curl in C usage (0) | 2018.06.24 |
---|---|
Dynamic Library and Static Library (0) | 2018.06.24 |
Wowza Streaming Engine II (0) | 2018.06.15 |
How to manage live applications by using the Wowza Streaming Engine REST API (0) | 2018.06.15 |
How to access reference documentation for the Wowza Streaming Engine REST API (0) | 2018.06.15 |
wowza api java
shows some hits, including REST. What is the specific problem? – JimHawkins Jun 9 '16 at 11:14