4

The majority of sim accounts are public dynamic. Most if not all cellular providers do not allow incoming connections to public dynamic ip addresses. (3g anyway, maybe not 4g/LTE) The issue of connecting is not one of dynamic ips, but rather blocked incoming ports.

So, if I wanted to stream video from an android phone on demand (based on information gleaned from this conversation (Streaming video from Android camera to server)), what would be the chain of events to properly intitiate a connection.

My idea of this (roughly):

  1. app on android phone initiates and keeps open some sort of connection to media server (wowza or something).
  2. At some point when server wants video from phone, it uses the open connection to request a video stream.
  3. Android phone pushes rtsp stream to server.

Is this correct, and if so, what type of connection should i use as the permanent control connection. Also, is it possible to push rtsp or would i have to do something else?

Thanks!

Community
  • 1
  • 1
michael
  • 2,577
  • 5
  • 39
  • 62
  • I think using SDP announce might help... but I am not sure if that only helps with discovering the device or helping handle the actual push connection. – michael Jan 02 '12 at 20:53
  • http://bit.ly/wEXwJk IP webcam is a good example of what I want to achieve including the problem of initiating a connection with the phone. You must initiate connections from the phone. – michael Jan 04 '12 at 00:08

1 Answers1

-1

I know this is an old question but if anybody else is searching for something similar the following is now available:

http://developer.android.com/guide/google/gcm/index.html

This essentially allows a message to be sent from a server to an app on an Android device (it replaces C2DM which did a similar thing).

Update

Google GCM has now being replaced in turn by Google Firebase Cloud Messaging:

Using a could based app messaging service like this, the steps would be:

  • Add a message subscription service to your app (e.g. Firebase)
  • The App registers with the cloud messaging service when it starts up
  • When the server wants video from the phone (as noted in the questions above) the server sends a message to the app
  • The app opens a connections to the streaming server and starts to stream video to the server.

Note: there is a comment below about how this approach does not allow an incoming connection from the server to the Android phone.

This, in fact, is not how streaming from a phone typically works. The phone actually makes an 'outgoing' connection to a streaming server which it then streams the video to. Other devices wanting to see the video then stream it form here.

There are several reasons why this is the preferred approach, one of the key ones being that supporting a quality streaming service that will play back on most common devices, browsers, OS's etc requires transcoding the video into multiple bit rates, and even encodings in some cases, and packaging and serving in the appropriate streaming packaging format. Doing all this on the mobile device would be very compute and storage intensive.

Mick
  • 24,231
  • 1
  • 54
  • 120
  • answers the question for android, which i think can be used as a base for other phones. Thanks! – michael Oct 17 '12 at 15:22
  • @michael, I'm not quite getting how it answers the question for android. So GCM allows a message to be sent from the server to the android, but how does it allow an incoming connection from the server to the android? – Felix Mar 10 '13 at 01:38
  • @nissemand derp, you are right. I don't know why I gave this the check. I have yet to revisit this. I suspect strategies in websockets could transfer over to this. – michael Mar 10 '13 at 18:42
  • @michael, dang it, I hoped that GCM would be the solution :) So far I haven't figured out how GCM will help with connections. – Felix Mar 10 '13 at 21:58
  • @nissemand, I started (and then took a break, and now have started again) to look at using a third party to facilitate handshaking. It would be a generic client to client system probably similar to bittorrent hand shaking. Phones are challenging because of how restrictive telcos are in their subscriber unit firewall policies. – michael Mar 11 '13 at 05:22
  • Hi, the question above was asking, I believe, "what type of connection should I use as the permanent control connection". The Google cloud messaging service in the link in this answer effectively does that for you. In other words you can simply have your app sitting waiting for control messages, and you don't have to do any of the plumbing to keep the control connection alive. Is this not what you were asking? If it is I will edit the answer to make this clearer – Mick Mar 13 '13 at 17:18