Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtsp camera stream 3 seconds delay #106

Open
spiderdab opened this issue Mar 16, 2019 · 5 comments
Open

rtsp camera stream 3 seconds delay #106

spiderdab opened this issue Mar 16, 2019 · 5 comments

Comments

@spiderdab
Copy link

spiderdab commented Mar 16, 2019

Hi, I really don't know where the issue applies, but in Processing 3.5.3, with this library, using this code:

import processing.video.*;
Movie movie;

void setup() {
  //size(1280, 720, P2D);
  size(640, 360, 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=0.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);
}

the video is displayed 3 seconds later, on every resolution, fps or bandwidth i set the camera.
this on LinuxMint 19.1 either with the integrated i915 intel graphic card, and the GeForce GTX 850M.
The strange thing is that on a windows guest, virtualized on the same host, using CMS software (suggested by the cam manufactor) there is no lag.

Any suggestion?
maybe something dealing with buffering?

Thank you.

@pantelisama
Copy link

Hi,

I have exactly the same problem.Have you discovered what happens?

Thank you

@spiderdab
Copy link
Author

Yes, but I don't remember exactly now...
With the great help from Neil C.Smith, Author of the fantastic software PraxisLive, I made rtsp work with a good lag (100 ms).
The problem with processing-video-library, if I remember correctly, is that it missed the rtspsrc command to set all of the rtsp stream options.
Here is the line used into PraxisLive to correctly load the rtsp stream:
rtspsrc latency=0 buffer-mode=0 udp-buffer-size=400000 location="rtsp://192.168.1.10:554/user=admin&password=&channel=1&stream=0.sdp?real_stream" ! rtph264depay ! decodebin ! videocrop top=0 bottom=0
the key was: latency=0 buffer-mode=0.
Probably the udp-buffer line was useless, I really don't remember..

I wish it can be useful to you. In case please, advice me.
Ciao, Davide.

@codeanticode
Copy link
Member

@spiderdab support for custom pipelines is being implemented, and will be fully functional in the upcoming stable release of v2.0

@pantelisama
Copy link

Yes, but I don't remember exactly now...
With the great help from Neil C.Smith, Author of the fantastic software PraxisLive, I made rtsp work with a good lag (100 ms).
The problem with processing-video-library, if I remember correctly, is that it missed the rtspsrc command to set all of the rtsp stream options.
Here is the line used into PraxisLive to correctly load the rtsp stream:
rtspsrc latency=0 buffer-mode=0 udp-buffer-size=400000 location="rtsp://192.168.1.10:554/user=admin&password=&channel=1&stream=0.sdp?real_stream" ! rtph264depay ! decodebin ! videocrop top=0 bottom=0
the key was: latency=0 buffer-mode=0.
Probably the udp-buffer line was useless, I really don't remember..

I wish it can be useful to you. In case please, advice me.
Ciao, Davide.

Hi,

Thanks for the reply.Could you share with us the Praxis live project that worked?

Kind Regards

@spiderdab
Copy link
Author

I've extracted the bare camera-in module that works with my chinese cameras. Unfortunately not every rtsp camera work with the same commands. I succeded with two cameras together on the screen with a good latency.

rtsp_video_in.zip
The cameras I'm working with are these

Let me know if that work.
Davide.

@codeanticode codeanticode removed this from the Version 2.2.2 milestone Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants