17

I have to make an iOS app which plays a live video stream from a camera. I know that the iPhone only supports Live HTTP stream, but unfortunately it comes with a delay of about 6-10 seconds, which is far from my needs - I need a real time view. MJPEG stream is also not an option, because it generates a huge traffic. So what remains is an RTMP stream, but iOS cannot play it natively :(( I've heard of rtmpdump for iPhone, but I couldn't get it working. Has anyone succeeded in playing RTMP video on iOS? Any suggestions on how to do it are greatly appreciated!

Henrik P. Hessel
  • 35,062
  • 17
  • 77
  • 99
cpprulez
  • 896
  • 2
  • 9
  • 21
  • 2
    I don't see how asking for suggestions on how to code, or find code, to do something is off topic. This isn't the only closed question which seems to be non-comprehended, as if only the first sentence was read by the close-voter. Also, it is implicit that you're asking for "code methods to decode" not apps that decode, so reading comprehension seems missing on SO. I have a similar question, and it sucks knowing it might just be closed due to lack of someone's reading skill (it has happened to me a few times in the past). Not to say I'm perfect at describing things, I admit fault on some of – Stephen J Jul 22 '15 at 14:34

2 Answers2

4

I'm pretty sure mediastreamsegmenter can be set up for slightly lower latencies (perhaps as low as 3 seconds).

Any other solution would need an advanced-ish transport, demux and video codec, that can handle RTP-over-HTTP and something at least equal to MPEG-2 video in compression efficiency. Those things are hard to come by for free (I know of only GPL-encumbered ones).

And even those would have latencies of at least 1 second as far as I can tell.

Steven Kramer
  • 8,375
  • 2
  • 34
  • 43
0

I've successfully used rtmpdump for streaming on iOS. You would have to implement the audio/video message decode as the code does not provide that. Also AMF3 is not fully implemented so you might have to deal with that too. For the most part it's just the rtmp.c file. The handleInvoke and handleCtrl methods is where the action is, along with the method that handles the packet (forgot which it is).

ron garay
  • 21
  • 2