Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turning an iPhone or iPod into a wireless webcam

I'd like to stream video from the camera on an iOS device to a receiver via wifi, in effect turning the device into a wireless webcam. Is there a way to build a small app that captures video input on an iOS app and sends it via an RTSP stream or similar?

As this is an ad hoc experiment, I'm not concerned about App Store guidelines and can jailbreak if necessary.

like image 567
Simon Cave Avatar asked Mar 10 '11 10:03

Simon Cave


People also ask

Can I use my iPhone as a webcam for streaming?

All you really need to use your iPhone as a webcam is the handy EpocCam application that can be found in the Apple App Store. Use your iPhone as a 1080p webcam wirelessly on your streams and save a bundle over buying a webcam.


2 Answers

If I interpret your question correctly you more or less need to solve four problems:

  1. Get the camera feed.
  2. Convert/encode this to the right format.
  3. Stream the data.
  4. Prevent the phone from locking itself and going into deep sleep.

The first one is fairly simple and Apple has as always provided good documentation and examples -> API link. Make sure you check out their example in the end as you will get a CMSampleBufferRef data object back.

For the second and third part, you should check out the CFNetwork framework and specially CFFTPStream for streaming using FTP.

If your are only building this for yourself then you can always turn off the Auto-Lock feature in the settings. If you on the other hand would like to distribute this to other users you could use a trick to play a mute sound every 10 seconds. This is more or less how all the alarm clocks work in the App Store. Here's a tutorial. =)

I hope I helped a little bit at least. Good luck and best regards!

like image 59
ABeanSits Avatar answered Oct 06 '22 15:10

ABeanSits


I'm 70% of the way to doing the same thing. Here's how I did it:

  1. Capture content from video input
  2. Chop video into files for use in HTML Live Streaming.
  3. Spin up a web server on the iPhone and make the video files available.
  4. Connect to the IP address of the phone and viola! you've got live streaming video.

Last time I touched the code I was trying to debug my Live Streaming not working. I'll try and get my source code posted on github this weekend, if you'd like to take a look.

like image 33
kubi Avatar answered Oct 06 '22 15:10

kubi