RTMPStreamPlayer返回未打开的流

时间:2014-08-08 10:10:39

标签: ios rtmp wowza

我正在使用一个应用程序,该应用程序将使用Wowza Media服务器通过RTMP协议播放或流式传输视频。我可以使用MediaLibDemos将视频从设备流式传输到wowza服务器。流式传输视频时一切正常。

但是,在从Wowza媒体服务器播放视频时,我无法播放该视频。它打印在日志下面,

代码:

2014-08-04 16:31:36.585 RTMPStreamPlayer[3841:60b] ******************************************** connectControl: host = rtmp://58.68.93.211:1935/coder/
2014-08-04 16:31:36.589 RTMPStreamPlayer[3841:4a03] MPMediaDecoder -> playing: try to open the stream rtmp://58.68.93.211:1935/coder//Mobile27 ...
2014-08-04 16:31:36.591 RTMPStreamPlayer[3841:4a03] @@@@@@@@@@@@@@@@@@>>>> MPMediaDecoder -> openStream: (BEGIN)
[flv @ 0x13f4a00] Stream discovered after head already parsed
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[flv @ 0x13f4a00] negative cts, previous timestamps might be wrong
[h264 @ 0xc02200] AVC: nal size 21102622
[h264 @ 0xc02200] missing picture in access unit with size 40
[h264 @ 0xc02200] AVC: nal size 21102622
[h264 @ 0xc02200] missing picture in access unit with size 40
[h264 @ 0xc02200] AVC: nal size 21102622
[h264 @ 0xc02200] missing picture in access unit with size 40
[h264 @ 0xc02200] AVC: nal size 21102622
[h264 @ 0xc02200] missing picture in access unit with size 40
[h264 @ 0xc02200] AVC: nal size 21102622
[h264 @ 0xc02200] missing picture in access unit with size 40
[h264 @ 0xc02200] AVC: nal size 21102622
[h264 @ 0xc02200] missing picture in access unit with size 40
[h264 @ 0xc02200] AVC: nal size 21102622
[h264 @ 0xc02200] missing picture in access unit with size 40
[flv @ 0x13f4a00] Could not find codec parameters for stream 1 (Audio: none, 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
----------------------------------- FORMAT --------------------------------------------------
Input #0, flv, from 'rtmp://58.68.93.211:1935/coder//Mobile27':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuv420p(tv), 320x240 [SAR 1:1 DAR 4:3], 24.42 fps, 24 tbr, 1k tbn, 48 tbc
Stream #0:1: Audio: none, 0 channels
Stream #0:2: Data: none
---------------------------------------------------------------------------------------------
[NULL @ 0xc09600] No codec provided to avcodec_open2()
2014-08-04 16:31:39.785 RTMPStreamPlayer[3841:4a03] MPMediaDecoder -> ERROR avcodec_open2() <audio> : Invalid argument
2014-08-04 16:31:39.786 RTMPStreamPlayer[3841:4a03] MPMediaDecoder -> playing: stream is not opened, wait about 1 sec
2014-08-04 16:31:40.349 RTMPStreamPlayer[3841:60b] ******************************************** connectControl: host = rtmp://58.68.93.211:1935/coder/
2014-08-04 16:31:40.856 RTMPStreamPlayer[3841:4a03] MPMediaDecoder -> playing: try to open the stream (null) ...
2014-08-04 16:31:40.858 RTMPStreamPlayer[3841:4a03] @@@@@@@@@@@@@@@@@@>>>> MPMediaDecoder -> openStream: (BEGIN)
2014-08-04 16:31:40.860 RTMPStreamPlayer[3841:4a03] MPMediaDecoder -> ERROR avformat_open_input() : Protocol not found
2014-08-04 16:31:40.861 RTMPStreamPlayer[3841:4a03] DEALLOC MPMediaDecoder

流式视频在桌面浏览器上通过FlashRTMPPlayer播放得很好。但是,通过iOS的应用程序也支持流rtmp://hsn.mpl.miisolutions.net/hsn-live01/mp4:420p500kB31

我的情况可能有什么问题?有没有人为此工作过?如何解决这个问题?任何帮助赞赏。

先谢谢。

1 个答案:

答案 0 :(得分:0)

最后,我找到了实现这个目标的方法,

我已根据设置说明链接下的Wowza Media System将rtmp协议转换为 HLS 格式,

  1. Reference Link 1

  2. Reference Link 2

  3. 对于Ex:An,RTMP流可以像HLS一样播放,如下所示 -

    rtmp://yoururl:1935/yourappname/video
    

    http://yoururl:1935/yourappname/video/playlist.m3u8
    

    然后,将此网址流式传输到我的MPMoviePlayerController,就像魅力一样。