Share an IP camera feed (RTSP?)
I have an IP camera and I would like to share its feed.
It can output an RTSP feed as well as simple JPEG images.
I am looking for a way to take that single feed and serve it to multiple viewer开发者_JAVA百科s.
In reality there may only be a few at any given time, so were not looking at 1,000's at once.
I also want to do this with no hardware on my end, just the camera, outputting its feed.
Is there a service on the internet that can take that feed and serve it out to multiple people in some way?
Maybe the way to do it, is to transcode that RTSP to something more palatable to browsers, is that an option?
Again, no hardware on my end, I don't want racks of computers (even 1) sitting at my end of things.
First you need is to receive the RTSP stream from the camera. There are some open source libraries that can be used like Live555. Then you need to convert the stream to a protocol that can be played by the browsers. This can be HTTP Live Streaming (HLS) or Dynamic Adaptive Streaming over HTTP (MPEG-DASH). These streams can be played by using HTML5 video if Media Source Extensions (MSE) is supported. Older browsers does not supports MSE so you need a fallback player (e.g. Adobe Flash based player with HLS or MPEG-DASH support).
There are some cloud based service that provides complete solution for broadcasting your IP camera. I tested IPCamLive.com and it's working fine for me.
The best thing that I liked in IPCamLive is that this service provides a simple HTML snippet for embedding the camera so I only pasted this snippet into my web page. Another good thing is that this service supports ONVIF protocol that can help you to find the proper RTSP URL of your camera stream.
Whats the camera model? If it supports RTSP and JPEG, you only need to forward ports 80 for JPEG and 554 for RTSP from the router to a local IP address of the camera. And also, you should have static IP, or register your dynamic address at dyndns.org and get a DNS name for it.
Then if users want to see RTSP stream from that camera they can open it from a RTSP url referring to the WAN IP address of the router the camera is on.
For the AXIS camera and the setup from above:
rtsp://84.55.1.2/axis-media/media.3gp
That will route to the 10.10.10.1:554
which is the IP camera.
You can do the less work, if the camera supports UPnP. Then just turn it on, and you will get what address users have to put in their URL and the port to add.
Now, if you want to display this in browsers, you probably want to get the MOTION JPEG if it is supported, or get JPEG periodically...
Use a Media Server...
The media server aggregates the connection so the device does not have to be forward facing.
There are a few...
Mine is @ http://net7mma.codeplex.com/
There is a codeproject article for my library @ http://www.codeproject.com/Articles/507218/Managed-Media-Aggregation-using-Rtsp-and-Rtp
It supports non - rtp sources such as the HTTP Jpeg and MJpeg variations you specify, in addition it also supports creating RTP MJPEG from jpeg pictures on the fly.
You also have the option of using Restart Intervals and sending only the Minimum Coded Units (MCUs) which have changed and thus you will decrease the amount of data sent and get bandwidth which is more or less closer to MPEG.
It works with VLC, QuickTime, (S)MPlayer and various other players.
It's main purpose is aggregation like you require and it also supports recording to rtpdump format.
It works in Mono or .Net and currently targets 4.5.2 because some encoding and decoding support is planned also.
精彩评论