我已经下载了 LiveStreamRecord 库,并尝试使用该库给出的示例,它工作正常。现在我想做的是,我想使用 web 服务开始录制特定的流。
我已经编写了 wowza 网络服务,除了录音之外它工作正常。当我输入以下代码开始录制特定流时,它会抛出 NULL POINTER EXCEPTION。代码片段如下所示。请让我知道如何克服这个问题。
代码 :
String streamname="12";
ModuleLiveStreamRecord lsr=new ModuleLiveStreamRecord();
lsr.recordStream(streamname, 1, true, "", true, true, true);
得到的错误。
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)
我试图弄清楚这个问题两天,但找不到哪里出了问题。但 Flash 示例运行良好,没有任何错误。
如果我使用了错误的库,请向我推荐用于此类操作的正确代码示例。
谢谢。