# 3 secondes latency with wowza server

**URL:** <https://community.wowza.com/t/3-secondes-latency-with-wowza-server/45326>\
**Category:** Wowza Streaming Engine\
**Created:** [May 18, 2015, 11:10am UTC](https://community.wowza.com/t/3-secondes-latency-with-wowza-server/45326 "2015-05-18T11:10:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leopold\_Guerin](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@Leopold\_Guerin](https://community.wowza.com/u/Leopold_Guerin)\
**Post date:** [May 18, 2015, 11:10am UTC](https://community.wowza.com/t/3-secondes-latency-with-wowza-server/45326/1 "2015-05-18T11:10:16Z")

</div>

Hi,

I’m trying to develop a live streaming application with RTSP protocol.

On the PC with the Wowza Server, I execute the following command :

```auto
ffmpeg -f dshow -i video="Name_Of_My_Cam":audio="Name_Of_My_Microphone" -vcodec h263p -f rtsp -muxdelay 0.1 rtsp://<Wowza_server_ip_adress>:1935/live/test

```

And I’m trying to play this stream on a VideoView on my Samsung Galaxy Note 3 Lite. Here the code :

```auto
    @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 ?

Thank you for helping me.

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [May 18, 2015, 3:35pm UTC](https://community.wowza.com/t/3-secondes-latency-with-wowza-server/45326/2 "2015-05-18T15:35:35Z")

</div>

Hi,

You could try (if you haven’t already) setting your Wowza app’s StreamType to [live-lowlatency](https://www.wowza.com/docs/how-to-set-up-low-latency-applications-in-wowza-streaming-engine-for-rtmp-streaming). 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.

Paul

---

<div class="post-metadata">

**Author:** ![Zoran](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/zoran/32/385_2.png) [@Zoran](https://community.wowza.com/u/Zoran)\
**Post date:** [May 20, 2015, 1:03pm UTC](https://community.wowza.com/t/3-secondes-latency-with-wowza-server/45326/3 "2015-05-20T13:03:37Z")

</div>

Hi,

As a reference, there are also some useful information in the “[How to achieve the lowest latency from capture to playback](https://www.wowza.com/docs/how-to-set-up-low-latency-applications-in-wowza-streaming-engine-for-rtmp-streaming)” forum article.

Zoran

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [May 19, 2015, 3:58pm UTC](https://community.wowza.com/t/3-secondes-latency-with-wowza-server/45326/4 "2015-05-19T15:58:04Z")

</div>

Hi Leopold,

Thank you for reporting your findings. I’m sure this will be helpful for others also.

Paul

---

<div class="post-metadata">

**Author:** ![Leopold\_Guerin](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@Leopold\_Guerin](https://community.wowza.com/u/Leopold_Guerin)\
**Post date:** [May 19, 2015, 11:54am UTC](https://community.wowza.com/t/3-secondes-latency-with-wowza-server/45326/5 "2015-05-19T11:54:55Z")

</div>

Hi,

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.

I hope it will help

Regards,

Leopold
