Search code examples
ffmpegstreamingrtsplatencywowza

3 seconds latency while streaming with Wowza Server


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

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

Code:

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 is 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?


Solution

  • I managed to solve it using the vitamio library. Instead of a VideoView, I implement the custom MediaPlayer (see the sample "MediaPlayerDemo_Video.java"). The delay is less than 1 sec. So the streaming from my Wowza Server to the android phone work well.