问题
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