无法在iOS中播放RTMP实时视频流 [英] Unable to Play RTMP live video stream in ios

查看:538
本文介绍了无法在iOS中播放RTMP实时视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用此链接下载了示例代码:

I have downloaded sample code using this link:

https://github.com/yixia/Vitamio-iOS

我尝试播放RTMP视频流,但没有播放,则显示错误:

I tried to play RTMP video streaming, but it does no play it gives the error:

NAL 1RRE &&&& VMediaPlayer Error: (null)

我使用了这个键:

keys[0] = @"-rtmp_live";
vals[0] = @"-1";
[mMPayer setOptionsWithKeys:keys withValues:vals];

视频无法播放.

有人知道为什么吗?

推荐答案

对于ios上的实时流式传输,您应使用 Apple HLS (Http实时流),您的流数据包上必须有分段.尝试使用媒体服务器进行实时流式传输.媒体服务器提供了.m3u8播放列表,其中包括实时.ts(h264等)格式的流数据.

For live streaming on ios, you should use Apple HLS (Http Live Streaming), you must have segmentation on your streaming packets. Try to use a media server for live streaming. Media server provides .m3u8 playlists that include live .ts (h264 etc) formatted stream data.

例如,您的IP Cam通过RTMP将流数据推送到媒体服务器(FMS等),然后媒体服务器通过HTTP广播它,输出是.m3u8播放列表中的.ts文件序列.并且流url看起来像这样 http://domain.com/mystream.m3u8

For example, your IP Cam push stream data over RTMP to Media Server (FMS etc.), and media server broadcast it over HTTP, output is .ts file sequences in .m3u8 playlist. and stream url will look like this http://domain.com/mystream.m3u8

这篇关于无法在iOS中播放RTMP实时视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆