Unable to Play RTMP live video stream in ios

孤街醉人 提交于 2019-12-11 10:39:33

问题


I have downloaded sample code using this link:

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

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

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

I used this key:

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

Video does not play.

Does somebody have an idea why?


回答1:


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.

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



来源:https://stackoverflow.com/questions/35655245/unable-to-play-rtmp-live-video-stream-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!