Open gregoryking opened 10 years ago
have a similiar problem. couldnt solved it yet. rtmp module is killing my source connection about every 19-20 hours
Simple
while true do
"your command here"
done;
Should do the thing.
not using raspberry pi, i have my own transcoding software (libav based), seems like rtmp module disconnects source after 14-15gb of received data. i have applied fmle byte reset branch testing again
I've compiled a build of nginx-rtmp-module (1.1.4) on nginx 1.4.1 with debug flag set. Seems to run much the same as before and this is the debug message I am getting in the nginx error log when streaming stops:
2014/06/13 18:52:56 [info] 24006#0: *1 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2014/06/13 18:52:56 [info] 24006#0: *1 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2014/06/13 18:52:56 [info] 24006#0: *1 recv() failed (104: Connection reset by peer), client: 127.0.0.1, server: 0.0.0.0:1935
2014/06/13 18:52:56 [info] 24006#0: *1 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
I'm guessing that ustream may be dropping the connection and nginx-rtmp not restarting after a failure. Should it be restarting? This is only a guess. As a dirty hack I'm considering watching the ffmpeg logs for "Deleting stream..." messages and rebooting nginx on observing them.
fmle byte reset branch solved my problem. I had 25 hours uptime without disconnection (before, it was 19 hours max) and about 17GB input (btw; i was using nginx mainline, i recompiled the stable version).
Looks like the remote end closes the connection. That can happen if an rtmp endpoint does not reply with an acknowledgement packet when a certain amount of bytes are received. I had this issue with fmle, however it's fixed long ago.
I'm having a problem whereby a stream published to ustream.tv terminates and does not restart again automatically. When I restart nginx, the stream resumes publishing no problem. Streams are staying up 1 to 2 days before dying.
Within my nginx.conf I am calling a shell script as follows:
And the relevant ffmpeg line from my script is publishing from a webcam to both a local RTMP stream and ustream:
This is the message I receive in my ffmepg log after the stream stops:
So why is my stream not restarting publishing automatically? And is it reaching some sort of limit that forces the publishing to be terminated?
Apologies if this question better belongs in a forum....I couldn't find one.
Greg