Search code examples
androidffmpeggstreamerrtsplive555

Using Gstreamer or ffmpeg to create rtsp client on Android


I want to stream a rtsp stream on android and I finally have come to conclusion that I can't use android API's MediaPlayer,Videoview etc because latency is big issue for me. I need an latency of <500 ms. Now I am planning to use Gstreamer or ffmpeg to create an android rtsp client. I just have few doubts

  1. Will the Gstreamer or ffmpeg client be able to provide latency <500ms. I read there are some parameters which I can tweak to get very low latency. Just want to confirm. I have very good network bandwidth. The frame size is generally 1920X1080.

  2. I read Gstreamer is one made one level above ffmpeg and uses ffmpeg codecs to work. I want to know which one is easier to work with for creating an android client. Working on Gstreamer or workig directly on ffmpeg.

  3. If I use Gstreamer android client, Will I have to use the Gstreamer server as well to stream the data? Currently I am using Live555 RTSP server to stream data


Solution

  • I can't speak about ffmpeg, but for GStreamer:

    1) Yes, you can get latencies much lower than 500ms with GStreamer as an RTSP client. See the latency property on rtspsrc (which e.g. can be accessed via the setup-source signal if you use playbin... and you should). By default this is set to 2000 miliseconds (which is a safe default) but if you network is fast enough you can set this much lower.

    2) That depends on your experience with both APIs. For myself a GStreamer application would be much easier, and you can find a few samples on the internet: https://coaxion.net/blog/2014/08/gstreamer-playback-api/ http://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/tree/gst-sdk/tutorials (the android tutorials)

    3) You can use any standard conformant RTSP server, both should work. GStreamer's has a very simple but powerful API, and is included with the GStreamer binaries for Android that you can get here: http://gstreamer.freedesktop.org/data/pkg/android/1.4.3/