简体   繁体   中英

live streaming from wifi h.264 camera directly to iPhone

I have a standard WiFi h.264 camera that I use as a baby monitor which, in technical terms, means I need it to be as realtime as possible. My initial goal was to encode the stream from the camera as such that the native iPhone hardware decoder can be used so that the result is a direct, clean, sharp, and realtime video from my camera onto my iPhone. I really want to avoid using FFMPEG since its a software decoder, which is slower then a hardware decoder.

I am finidng that the iPhone will not take anything from the camera's stream unless I use HLS as a middleman server. I am desperatly trying to avoid introducing a server inbetween the camera and the iphone, since it means more work, more bandwidth, and more latency on the video.

So my question is: What do I need to do in order to get a direct h.264 stream from my WiFi camera to show up on my iPhone using its hardware decoding? I am currently using base profile. If you need any more details, please let me know.

Again, your help means a lot since I have been beating myself up on this for over 6 months now.

/* Edit (January 24, 2012) */

I'm leaving this answer for historic record, but I have a better answer now..

/* End Edit */ Depending on your brand of camera, the IP Vision app from the Apple App Store should work just fine to establish a direct connection.

See here: http://itunes.apple.com/us/app/ip-vision/id300593485?mt=8

There will of course be some latency, but I can tell you from 15 years experience in surveillance, that latency is just a fact of life.

Most IP cameras offer a reasonable degree of control over bitrate.

If you can sacrifice quality for speed, try getting a bitrate of around 32kbps. With H.264 compression, this will be around 1-2 FPS at QVGA resolution.

As for latency in the app, I cannot offer you any specific advice, but the app is free, and if it provides improved results than you win!

EDIT: Doe not work with stock iOS or Android 4.0. May have some use for the web, so I will leave this for others.

Can you get an RTSP stream from your camera?

Here is a list of IP cameras and their RTSP streams: http://www.soleratec.com/rtsp/

If you can make a web page, you can use this code to embed your RTSP stream. It works on iOS, and is fairly universal:

<div class="box">
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
 codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
 width="320" height="240" id="vlc" events="True">
<param name="Src" value="rtsp://76.23.103.200:1935/live/camera.stream" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="True" />
<embed id="vlcEmb"  type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="320" height="240"
 target="rtsp://76.23.103.200:1935/live/camera.stream" ></embed>
</OBJECT>
</div>

Style your box as required. For an iPhone 4, screen width is going to be 320px, and for a typical IP camera, you probably have a 3:4 aspect ratio, so you want a screen height of 240px, just as listed above. Style the containing div any way you want. I recommend to center it, in case you call the web page in a tablet, laptop, PC, etc. Just makes it easier to see.

Example CSS .box { margin: 0 auto; width: 320px; height: 240px; }

NOTE: The scope of this answer does NOT address any security concerns. Just like anything on the web, if you put it out there unsecured, anyone can get a hold of it.

Re-addressing your latency issues, this method will result in about a 3 second latency while streaming at 32kbps. May be a bit longer on a 3G wireless network. As I mentioned, latency is a fact of life with video. Even very expensive solutions will have 1-2 seconds of lag.

I hope this helps you some. If you don't have a website, just make a free Wordpress site and stick this code into a static page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM