8

There is obviously a way to do this because so many applications are already doing it - NetCamViewer and iCamviewer to name just one.

I have searched and searched, but I'm not finding anything of value that gives a hint as to how this is done. I'm reaching out hoping that someone will give me a clue.

I'm trying to connect to an video security camera (Y-CAM), which supports the RTSP protocol, and display the video from my iPhone/iPad application. The camera has an IP address and I can view the video from a web browser and from Quicktime running on my Mac. The problem is that RSTP is not supported on iOS so even trying to connect using Safari on an iPad doesn't work.

I've read that some are trying to use Live5555, but I haven't seen an article that describes if it has been done successfully and how.

An alternative is to capture the RTSP stream on a server, convert it to an HTTP Live stream and then connect to the HTTP Live stream from iOS. Unfortunately, this hasn't proved as easy as it sounds.

I'd prefer to go directly to the camera like other applications I've seen do. the RTSP to Live is a fall back if I have to.

Any hints are greatly appreciated. Thanks!

4 Answers 4

11

This is wrong :) or not necessary (An alternative is to capture the RTSP stream on a server, convert it to an HTTP Live stream and then connect to the HTTP Live stream from iOS. Unfortunately, this hasn't proved as easy as it sounds.)

You should use ffmpeg library, as this library can connect any streaming server (supporting rtsp, mms, tcp, udp ,rtmp ...) and then draw pictures to the screen.. (for drawing you can use opengles or uiimage also works)

First of all, use avformat_open_input to connect to your ip address then use avcodec_find_decoder & avcodec_open2 to find codecs and to open them (you should call them for both audio & video)

Then, in a while loop read packets from server by using av_read_frame method When you get frame, if it is audio then sent it to AudioUnit or AudioQueue, if it is video, then convert it from yuv to rgb format by using sws_scale method and draw the picture to the screen.

That's all.

look at this wrapper also (http://www.videostreamsdk.com), it's written on ffmpeg library and supports iOS

0

You really need to search stack overflow before posting , this question has been asked many times. Yes live 555 sort of works and some of us have gotten it to work..

There are other players too, including ours http://www.streammore.tv/

2
  • Hello Michelle, how we can use streammore.tv... is there any SDK for this...
    – vulvaji
    Feb 27, 2013 at 5:13
  • yes there is , contact information is on the site you quoted, plus the links to our open source github repository. Mar 1, 2013 at 14:31
0

You can find an open source FFMepg Decoder for iOS (and somes samples) on GitHub : https://github.com/mooncatventures-group

Sample use of this library : http://sol3.typepad.com/exotic_particles/

0

There are two general technology to display RTSP video on iOS Safari:

  • RTSP / HLS (H.264+AAC)
  • RTSP / Websocket (H.264+AAC ==> MPEG+G.711 or H.264+?)

For HLS you can consider Wowza server. For Websocket playback in iOS Safari you can use WCS4 server.

Main idea for websocket playback is direct HTML5 rendering to HTML page Canvas element and audio context. In the case of MPEG playback video decoding will be done on iOS Safari side using plain JavaScript.

Another option - install a WebRTC plugin with getUserMedia support and play this stream via WebRTC. Anyway you will need a server side RTSP-WebRTC transcoder in such case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.