Skip to content

rtsp camera stream 3 seconds delay  #106

Open

Description

@spiderdab

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.

Activity

  1. pantelisama commented on Aug 1, 2019

    @pantelisama

    Hi,

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

    Thank you

  2. spiderdab commented on Aug 1, 2019

    @spiderdab
    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.

  3. codeanticode commented on Aug 25, 2019

    @codeanticode
    Contributor

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

  4. pantelisama commented on Sep 10, 2019

    @pantelisama

    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

  5. spiderdab commented on Sep 10, 2019

    @spiderdab
    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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions