jprjr / multistreamer

[discontinued] A webapp for publishing video to multiple streaming services at once.
MIT License
322 stars 94 forks source link

Multistreamer cant resume when OBS disconnects #42

Closed pogzie closed 3 years ago

pogzie commented 6 years ago

I was getting timestamps for more information on the start/end discrepancies between Multistreamer and all the services and halfway through playing/streaming my OBS just gave out an alert that I was disconnected and its trying to reconnect.

All the while I thought that its just gonna be a hiccup and everything would continue on as it should. As I completed my stream, I noticed that the OBS disconnect cut the stream altogether. Is it by design? Or should Multistreamer be at least able to recover on things like this like a network hiccup or some quick OBS failure?

Previously in one service im using, even if OBS disconnects, there would just be a gap on the stream but would still continue on when OBS resumes the stream/reconnects.

To help out further, here are the start timestamps of the videos and services.

YT: Started 23:51:31 (lasted for 00:15:38) FB: Started 23:51:14 (lasted for 00:16:02) Twitch: Started 23:51:30 (lasted for 00:15:46)

Please note that these timestamps are GMT +8. I have gathered the logs but unforunately its in UTC.

I wish I could do the math but I would need to sleep. So the logs in question should be around 15:51 UTC at the very least.

20180319 Multistreamer Logs.zip

jprjr commented 6 years ago

This is something I've had happen a few times, and it is really, really tricky.

So basically, if you get a network hiccup, you've got a few things that can happen:

The RTMP module closing the connection causes the most frustration. When that happens and OBS eventually reconnects, the follow things happen:

I think (though I'm not entirely sure) that this can be controlled a bit with the ping and ping_timeout directives, here: https://github.com/arut/nginx-rtmp-module/wiki/Directives#ping - but the behavior can still get pretty weird.

I'll have to experiment some more. It seems like shorter outages (<= 30 seconds) are fine now that ffmpeg will try restarting a few times.

pogzie commented 6 years ago

OBS was able to recover, but none of the stream was unable. Let me know if you need more logs or info.

jprjr commented 6 years ago

Yeah, I'm not sure what to do on this issue. I created short network hiccups (~10 seconds) and everything recovered fine. Any longer, it seems like no matter what combination of timeout, ping_timeout, etc -- either OBS never succesfully reconnects, or the RTMP module winds up calling "on-done" followed by "on-publish", which ends existing videos and starts new ones. I don't have a good way to detect a dropped connection vs somebody actually clicking "end stream" in OBS.

There's a bit of a work-around on the Facebook module - you can choose a pre-existing live video and uncheck "End live video when stream ends" - I wrote that specifically for a time I did a 24-hour marathon stream on Facebook, so I could disconnect/reconnect.

Implementing similar functionality in the YouTube module wouldn't be too hard. But for both the Facebook and YouTube modules, you'd have to create the event first on Facebook/YouTube, then log into Facebook/YouTube when you want the video to end instead of just ending the stream in OBS.

k1ck3r commented 6 years ago

not sure if this helps you, but the issue can't be reproduced with Xsplit

pogzie commented 6 years ago

This happened again when my network connection got knocked out. My PC (gaming, OBS) is separate from my Multistreamer server. I had to stop/start the stream from OBS.

I think the only info I got was I waited for it if it would recover but after a minute i decided to just restart the OBS stream.

jprjr commented 3 years ago

I've been considering discontinuing this project for some time now. I'm sorry I couldn't solve your issue, but I just don't enjoy working on multistreamer anymore.