1

I need to a multi viewer in my app, each view in a gridlayout must show a video from a camera that streaming over rtsp.

I try using Android VideoView and MediaPlayer, but results does not satisfy me, I have much latency for starting video, and compatibility problems using Lg L9 phone (see my question here )

I search a lot for 3rd party sdk , and I found Vitamio, but it not support multi-views in same activity (there is a bug). Another commercial sdk is Nexstreaming but not works on rtsp protocol. I not found nothing else. Do you know others ?

Using NDK could be another way to do it, so I seen for Gstreamer (tutorial) but it seems too complicated. Another way could be FFMPEG, but I have not found a definitive guide for it.

Any help ?

Community
  • 1
  • 1
tulkas85
  • 1,103
  • 1
  • 17
  • 43
  • Havy you tried to use GStreamer anyway? Was it working better than default way to play videos? – Piotr Feb 24 '14 at 22:54

1 Answers1

1

VideoView and MediaPlayer are based on the hardware decoders, specific for different devices, manufacturers, platforms. They are optimized to deliver best playback experience (e.g. 1080p), but are rather crippled when more than one instance must be active concurrently. I have never seen an Android device that could open more than 4 "OMX handles". But there is even no guarantee that two will work. And these frameworks are not built to fallback to software decoders when the HW resource is exhausted.

Luckily, contemporary devices have enough generic computational power to fill the whole screen with decoded video streams (e.g. four 270p streams for a 960 x 540 display). Gstreamer uses ffmpeg to decode the streams, but this library is probably more suited fro your purposes because it wraps up the necessary functionality, and you can ignore the minor impleentation details.

I believe that you will be better served with an OpenGL presentation layer, because this way you can offload color conversion to GPU with a shader that takes YUV 4.2.0 planar image (as produced by the decoder), and displays an RGB 24 bpp texture.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • So, what is easy way for a newbie of video stream for do it ? – tulkas85 Jan 29 '14 at 11:14
  • Have you tried to multiply video sinks in the [video player tutorial](http://docs.gstreamer.com/display/GstSDK/Android+tutorial+3%3A+Video)? As I said, you may find the performance improved significantly if you use GPU for yuv to rgb conversion and scaling. [This discussion](http://forum.openframeworks.cc/t/gstreamer-and-opengl/4789) suggests that the idea is not completely strange to GStreamer paradigm. – Alex Cohn Jan 29 '14 at 16:09