I have downloaded the LiveStreamRecord library and I have tried to use the example given with the library and it works fine. Now what I want to do is, I want to start the recording of a specific stream using the webservice.
I have written the wowza webservice and it works fine except the recording. When I put the following code to start the recording of a specific stream, It throws NULL POINTER EXCEPTION. The code snippet is given below. Please let me know how to overcome this issue.
Code :
String streamname="12";
ModuleLiveStreamRecord lsr=new ModuleLiveStreamRecord();
lsr.recordStream(streamname, 1, true, "", true, true, true);
The error obtained.
ERROR server comment - invoke(onStreamCreate): java.lang.NullPointerException: com.wowza.wms.plugin.livestreamrecord.ModuleLiveStreamRecord.recordStream(ModuleLiveStreamRecord.java:28)
java.lang.NullPointerException
at com.wowza.wms.plugin.livestreamrecord.ModuleLiveStreamRecord.recordStream(ModuleLiveStreamRecord.java:28)
at com.media.modules.OnlineVideoStream.onStreamCreate(OnlineVideoStream.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.wowza.wms.module.ModuleFunction.invoke(Unknown Source)
at com.wowza.wms.module.ModuleFunctions.a(Unknown Source)
at com.wowza.wms.module.ModuleFunctions.onStreamCreate(Unknown Source)
at com.wowza.wms.stream.MediaStreamMap.getStream(Unknown Source)
at com.wowza.wms.module.ModuleCore.createStream(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.wowza.wms.module.ModuleFunction.invoke(Unknown Source)
at com.wowza.wms.module.ModuleFunctions.invoke(Unknown Source)
at com.wowza.wms.request.RequestProcessFunctions.processFunctions(Unknown Source)
at com.wowza.wms.client.ClientWorker.processNextReq(Unknown Source)
at com.wowza.wms.request.RTMPRequestAdapter.service(Unknown Source)
at com.wowza.wms.server.ServerHandler.a(Unknown Source)
at com.wowza.wms.server.ServerHandler.a(Unknown Source)
at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
at com.wowza.wms.server.ServerHandlerThreadedSession.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I tried to figureout the issue for two days and could not find where it went wrong. But the flash example is working perfectly without any errors.
If I'm using the wrong library please do suggest me the correct code sample to use for this kind of operation.
Thanks.