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

"Stat" drops user count after some time. #159

Open
jbvsmo opened this issue Mar 26, 2013 · 5 comments
Open

"Stat" drops user count after some time. #159

jbvsmo opened this issue Mar 26, 2013 · 5 comments

Comments

@jbvsmo
Copy link

jbvsmo commented Mar 26, 2013

I updated the module to latest version on master, but something happens after an user is connected on rtmp for too much time. This is what normally happens:

  1. The first user starts the player
  2. nginx-rtmp opens an URL to tell a program there's a new user for a certain stream
  3. The program opens a ffmpeg instance that loads data from some server, transcodes the video, and publishes in this same application
  4. The user watches the video and the counter on "stat" is 2 (one viewer + one publisher)

If there are new viewers, my program will not open new ffmpeg instances.

The problem is that, after some time, the counter on "stat" drops to zero! without disconnecting anything nor calling exec_play_done (but the original viewer keeps watching the video and ffmpeg keeps working).

The nginx-rtmp will not acknowledge that ffmpeg is still transmitting data and will not send the available streams to new users.

This is my application:

application rio {
    hls on;
    hls_path /tmp/hls;
    hls_fragment 15s;

    live on;
    exec_play /usr/bin/curl http://localhost:8000/$name/start;
    exec_play_done /usr/bin/curl http://localhost:8000/$name/stop;
}

I think this is not a problem with the "stat" part, but on the "rtmp" part.

@arut
Copy link
Owner

arut commented Mar 26, 2013

How many workers do you have? Stat does not work properly in multi-worker mode.

@jbvsmo
Copy link
Author

jbvsmo commented Mar 26, 2013

Now I'm using 4 workers (I did this change at the same time as upgrading the nginx-rtmp). I had just 1 worker prior to this.

I'll see if going back to 1 user the count will stay right now.

But, why does the module do not send the available stream to new users even if ffmpeg is still transmitting?

@jbvsmo
Copy link
Author

jbvsmo commented Mar 26, 2013

With only one worker, the module works fine. But can't it reliably stream videos using more workers?

@misiek08
Copy link
Contributor

misiek08 commented Apr 1, 2013

I thought about multi workers stat. To make it the easiest way I think you can make separate stat file for each worker. So when now we setup http location with rtmp_stat all then we will use rtmp_stat all 1 where 1 is worker number.

@shany0730
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants