Video library rtsp lags too much

Hi, I’m reading a rtsp camera streaming, but I have 3 seconds of delay, which I have to reduce to a maximum of half a second.
This is the code I’m using:

import processing.video.*;
Movie movie;

void setup() {
  size(1280, 720, P2D);
  Movie.supportedProtocols[0] = "rtsp";
  println(Movie.supportedProtocols[0]);
  try {
    movie = new Movie(this, "rtsp://192.168.1.10:554/user=admin&password=1234&channel=1&stream=1.sdp?real_stream");
    movie.play();
  } 
  catch (Exception e) {
    println(e);
  }
}

void movieEvent(Movie m) {
  m.read();
}

void draw() {
  background(0);
  image(movie, 0, 0, width, height);
}

Video library is the latest on github. I’ve looked around on the web, and found only hints on reducing the bandwidth and resolution, but it is already very low.
The same stream, in windows (a virtual machine on the same pc!) with it’s software have just some 100-200ms of delay.

I’m working on linuxmint, with a dual Graphic card, and I have the same 3seconds delay with both of them (Nvidia and Intel).
The rtsp address line is the one given by the manufactor.

The cam is set to send 1280x720 (its min res) at 24 fps (tried down to 5 fps, it’s the same) with minimum bandwidth usage (something around 1 Mb/s of bitrate) on stream=0, and even worse (around 256 Kb/s of bitrate) on stream=1 (it has two channels) but with no difference in lag between the two.

Is there something I can do to reduce that lag? I know there must be a way, cause in windows (virtualized on the same host), with their software it is ok.

thanks.

1 Like

@spiderdab

By any chance, did you solve it?

It’s been a long time… I remember I had to manually modify the video library, but I’m sorry, I don’t remember much…
At the end I did in a different way in C++ and QT.
You can check also into PraxisLive Forum. It has been discussed sometime…

1 Like