Search code examples
androidandroid-mediaplayerrtsp

Best way to build a RTSP client on Android


I'm looking for a way to make an RTSP client in Android. I just want to connect an app to an RTSP server and communicate to get stream (as a byte array/buffer, no decoding, no playback, nothing else than get the byte stream). So no all-in-one player suggestion or something else please, just an RTSP access client. I'm surprised that Android supports RTSP (see Supported Media Format), but doesn't provide an API to manage RTSP access (or, I didn't find one??). So here you are my first question:

  • Can I use Android's MediaPlayer API to connect an app to a RTSP server and get the byte received without decoding/playing it?

On the other side, I'm looking for a RTSP library/framework for Android (or in pure Java, but for Android usage). And second surprise: there is nothing! Or... a few things like libstreaming but it's no longer alive. So here is my second question:

  • Is there an RTSP library (or just client library) available?

Third question:

  • Can I use FFmpeg RTSP access to do that? And how? (do I need all FFmpeg dependencies?)

Thanks for advises


Solution

  • FFmpeg or Live555 (used by VLC) are your best choices here. If you are really sure that you don't need to decode use Live555 since it would be more lightweight - have a look at their "openRTSP" example client that is bundled with the source code as an example, that should contain what you need to build an RTSP client.