And I’m trying to play this stream on a VideoView on my Samsung Galaxy Note 3 Lite. Here the code :
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VideoView vv = (VideoView) findViewById(R.id.videoView);
// Receive RTSP video from Wowza Server
vv.setVideoURI(Uri.parse("rtsp://<Wowza_server_ip_adress>:1935/live/test"));
vv.requestFocus();
vv.start();
}
I managed to read the video and the sound but it makes 3 secondes (or more…) to start and I keep this delay during all the streaming. It is very annoying because I want to develop a call session.
Does anybody know how to reduce this delay ? Is it a Wowza issue ?
You could try (if you haven’t already) setting your Wowza app’s StreamType to live-lowlatency. Note that there will always be some latency in your workflow, via ffmpeg doing the encoding, Wowza doing the re-streaming, your Android app replaying the stream, so 3 seconds may be a pretty reasonable delay. How much delay is involved if you test using the Wowza Test Player in the Engine Manager or playing back using something like VLC? Or alternatively if you create a stream file in Wowza with the source RTSP stream as its content. If the delay is less in those tests then there may be not much more that can be done prior to it reaching the Android device.
I have tried to set the setting StreamType to live-latency. But it changed nothing…
I found the solution : the issue was that the class “VideoView” was buffering during 3 seconds before starting. I found a library (vitamio) which allow me to read video without buffering (or better manage the buffer) : see this page.
On the other side, when I wanted to read video sended from android to the PC, I was used JWPlayer, and there was a delay too. Here the solution is to lower the parameter “bufferlength” in the JavaScript of the JWPlayer. But if this parameters is set to 0, it will not work, put it minimum to 0.1.