Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Streaming live camera video from iOS (iPhone/iPad) to remote PC / server

I've been searching for a while on stackoverflow and around the web for a solution to my video-streaming problem. I need to stream live video being captured from the camera (no high-quality required) from an iOS device to a remote PC in one way, i.e., the iOS device will be sending a video stream to the server/PC but not the opposite.

What appears after some googling and documentation browsing is that there are two main major standards/protocols that can be used:

  • Apple's HTTP Live Streaming (HLS)
  • Adobe's RTMP

Again, my requirement is that the iPhone/iPad will be streaming the video. From what appears on Apple's website, I understand that HLS is to be used from an encoding perspective server-side, and a decoding perspective iOS side. As of RTMP, most libraries that allow iOS streaming have commercial licenses and closed code or require you to go through their P2P infrastructure (for instance angl.tv or tokbox.com/opentok/quick-start). As of HLS, no encoding libraries seem to exist iOS side.

So my questions are:

  • Do you know of any SDK/Library preferably open and free that I could integrate to stream captured video from within my app?
  • If no, do you think developing a custom library would be a risky jungle-crossing endeavour? My guess is to go through AVFoundation and capture camera frames, compress them frame by frame and send them over HTTP. Does that sound crazy performance and bandwidth wise? Note that in that case I would need an HLS or RTMP encoder either ways.

I thank you very much in advance dear friends.

Mehdi.

like image 438
Medi The Jedi Avatar asked Mar 08 '14 00:03

Medi The Jedi


People also ask

Can I live stream from my iPhone to my computer?

Swipe up from the bottom of your iPhone to open the Control Center. Then tap AirPlay on the Control Center. Or choose Screen Mirroring. Tap the name of your PC and X-Mirage.

Can you stream live from an iPad?

Live stream an app using iOS ReplayKit Open the app you want to stream. Open the Menu for live streaming, and select YouTube. Follow the steps to set up your stream. Tap Go Live.


1 Answers

I have developed such a library, and you can find it at github.com/jgh-/VideoCore

I am updating this answer because I have created a simplified iOS API that will allow you to easily setup a Camera/Mic RTMP session. You can find it at https://github.com/jgh-/VideoCore/blob/master/api/iOS/VCSimpleSession.h.

Additionally, VideoCore is now available in CocoaPods.

like image 149
jgh Avatar answered Oct 01 '22 05:10

jgh