I am working on a project, I want to write packets on to an RTMP container.
-
What I have achieved is:
- To start an app which listens for RTMP requests using RED5. Lets say rtmp://localhost/myapp
- I could open IContainer with IContainerFormat’s output format give as (“flv”, “rtmp://localhost/myapp/test”, null)
-
Whats going wrong is :
- I want to write packets on to this RTMP channel that is opened for me.
- Issue is FFMPEG starts giving error 32. A bit of search related to this error showed that this is happens usually because there is a lag between client – server data consumption. But I really was not able to solve this issue. I have searched a lot but everyone is crying about the same issue. The error i get is :
- I want to write packets on to this RTMP channel that is opened for me.
12:57:20.242 [Thread-0] ERROR org.ffmpeg – WriteN, RTMP send error 32 (129 bytes)
12:57:20.246 [Thread-0] ERROR org.ffmpeg – WriteN, RTMP send error 32 (45 bytes)
12:57:20.246 [Thread-0] ERROR org.ffmpeg – WriteN, RTMP send error 9 (42 bytes)
And this is the error i receive on Red5 Server
[INFO] [NioProcessor-1] org.red5.server.stream.ClientBroadcastStream - Provider connect
[INFO] [NioProcessor-1] org.red5.server.stream.ClientBroadcastStream - Stream start
[INFO] [NioProcessor-1] org.red5.server.stream.ClientBroadcastStream - Provider connect
[ERROR] [NioProcessor-1] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Error decoding buffer
org.red5.server.net.protocol.ProtocolException: Error during decoding
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decode(RTMPProtocolDecoder.java:203) [red5.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeBuffer(RTMPProtocolDecoder.java:122) [red5.jar:na]
at org.red5.server.net.rtmp.codec.RTMPMinaProtocolDecoder.decode(RTMPMinaProtocolDecoder.java:61) [red5.jar:na]
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:225) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969) [mina-core-2.0.0-RC1.jar:na]
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.0-RC1.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_07]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_07]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_07]
Caused by: java.lang.IllegalArgumentException: null
at java.nio.Buffer.limit(Unknown Source) [na:1.7.0_07]
at org.red5.io.amf.Input.bufferToString(Input.java:275) [red5.jar:na]
at org.red5.io.amf.Input.getString(Input.java:258) [red5.jar:na]
at org.red5.io.amf.Input.readPropertyName(Input.java:565) [red5.jar:na]
at org.red5.io.amf.Input.readKeyValues(Input.java:351) [red5.jar:na]
at org.red5.io.amf.Input.readSimpleObject(Input.java:501) [red5.jar:na]
at org.red5.io.amf.Input.readObject(Input.java:537) [red5.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeStreamMetadata(RTMPProtocolDecoder.java:978) [red5.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeMessage(RTMPProtocolDecoder.java:564) [red5.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodePacket(RTMPProtocolDecoder.java:385) [red5.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decode(RTMPProtocolDecoder.java:190) [red5.jar:na]
... 18 common frames omitted
[WARN] [NioProcessor-1] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Closing connection because decoding failed: RTMPMinaConnection from 127.0.0.1 : 44814 to localhost (in: 3569 out 3521 )
[INFO] [NioProcessor-1] org.red5.server.stream.ClientBroadcastStream - Close
[INFO] [NioProcessor-1] org.red5.server.stream.ClientBroadcastStream - Provider disconnect
[INFO] [NioProcessor-1] org.red5.server.stream.ClientBroadcastStream - Provider disconnect
[INFO] [NioProcessor-1] org.red5.server.net.rtmp.RTMPHandler - Connecting to: [Scope@5f524524 Depth = 2, Path = '/default/myapp', Name = 'test']
[INFO] [NioProcessor-1] org.red5.server.net.rtmp.RTMPHandler - Remembering client buffer on stream: 300
[ERROR] [NioProcessor-1] org.red5.server.service.ServiceInvoker - Method FCSubscribe with parameters [teststream] not found in org.red5.core.Application@b9e19da
[WARN] [NioProcessor-1] org.red5.server.stream.PlayEngine - Subscribe to teststream provider failed
I am new to media streaming, so not sure if I am missing something.
Thanks in advance.
I don’t think that there is a different chance then debugging the Java Source code of RTMPProtocolDecoder.
But I don’t know what Red5 version you are using.
RTMPProtocolDecoder.java:203
=> In the latest version of Red5/Sources your exception is in line 147:
http://code.google.com/p/red5/source/browse/java/server/trunk/src/org/red5/server/net/rtmp/codec/RTMPProtocolDecoder.java#147
And also added with some comments. I guess first thing you would need to do is to update to latest red5. Based on that you can then debug and ask for more help.