我有一个Flash播放器(只有SWF文件,没有来源),我们在内联网项目中使用它来播放RTMP流。 今天我遇到了无法使用此播放器播放的新RTMP网址。同时它很容易使用MediaElements.js buit-in SWF-player。 我想知道,它会是什么?
我只有一个线索:当我使用rtmpdump时,stream只加载--live
标志。但调试输出对我来说是有争议的。由于--live
标志仅调用FCSubscribe,因此服务器回答Method not found (FCSubscribe)
并且现在正在开始流。
rtmpdump
输出。没有--live
标志我得到了这个:
DEBUG: Invoking createStream
DEBUG: RTMP_ClientPacket, received: invoke 29 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result for method call <createStream>
DEBUG: SendPlay, seekTime=0, stopTime=1000, sending play: livestream_3
DEBUG: Invoking play
DEBUG: sending ctrl. type: 0x0003
DEBUG: HandleChangeChunkSize, received: chunk size change to 4096
DEBUG: RTMP_ClientPacket, received: invoke 185 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object begin)
DEBUG: Property: <Name: level, STRING: error>
DEBUG: Property: <Name: code, STRING: NetStream.Play.StreamNotFound>
DEBUG: Property: <Name: description, STRING: Failed to play livestream_3; stream not found.>
DEBUG: Property: <Name: details, STRING: livestream_3>
DEBUG: Property: <Name: clientid, STRING: qAASQnAA>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Play.StreamNotFound
ERROR: Closing connection: NetStream.Play.StreamNotFound
DEBUG: Closing connection.
有了它,我明白了:
DEBUG: Invoking createStream
DEBUG: FCSubscribe: livestream_3
DEBUG: Invoking FCSubscribe
DEBUG: RTMP_ClientPacket, received: invoke 29 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result for method call <createStream>
DEBUG: SendPlay, seekTime=0, stopTime=1000, sending play: livestream_3
DEBUG: Invoking play
DEBUG: sending ctrl. type: 0x0003
DEBUG: RTMP_ClientPacket, received: invoke 119 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object begin)
DEBUG: Property: <Name: level, STRING: error>
DEBUG: Property: <Name: code, STRING: NetConnection.Call.Failed>
DEBUG: Property: <Name: description, STRING: Method not found (FCSubscribe).>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_error>
ERROR: rtmp server sent error
DEBUG: HandleChangeChunkSize, received: chunk size change to 4096
DEBUG: HandleCtrl, received ctrl. type: 0, len: 6
DEBUG: HandleCtrl, Stream Begin 1
DEBUG: RTMP_ClientPacket, received: invoke 166 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object begin)
DEBUG: Property: <Name: level, STRING: status>
DEBUG: Property: <Name: code, STRING: NetStream.Play.Reset>
DEBUG: Property: <Name: description, STRING: Playing and resetting livestream_3.>
DEBUG: Property: <Name: details, STRING: livestream_3>
DEBUG: Property: <Name: clientid, STRING: qAARQnAA>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Play.Reset
DEBUG: RTMP_ClientPacket, received: invoke 160 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object begin)
DEBUG: Property: <Name: level, STRING: status>
DEBUG: Property: <Name: code, STRING: NetStream.Play.Start>
DEBUG: Property: <Name: description, STRING: Started playing livestream_3.>
DEBUG: Property: <Name: details, STRING: livestream_3>
DEBUG: Property: <Name: clientid, STRING: qAARQnAA>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Play.Start
Starting Live Stream
P.S。我不是AS2 / AS3开发人员,因此我不熟悉Flash中所有类似RTMP的内容。
答案 0 :(得分:1)
很抱歉,但简短的回答是,如果没有源代码,您就无法解决此问题。缺少一个函数来处理某些CDN服务器使用的onFCsubscribe
方法。
并非所有流/服务器都会执行此请求,这就是为什么到目前为止您已经幸运的原因。但实际上,编码器应该做得更好,而不是假设所有RTMP流都是相同的。
我回答了类似的问题[链接如下],如果您查看该源代码,您会看到有onFCSubscribe
函数。如果您(或可以提供帮助的人)使用您自己的流链接编译该示例代码,则很可能会有效。
或者您可以联系SWF创建者更新他们的代码并向您发送新的重新编译的SWF。修复程序是上述链接的答案中的简单复制/粘贴。你的并发症是缺乏源文件......