sistason / rtmp_stream_delayer

Uses ffmpeg and nginx to delay (buffer) an incoming rtmp-stream for an amount of time.
GNU General Public License v2.0
42 stars 12 forks source link

Backup stream not working with rtmp link to same server (other application) #9

Closed Trauni closed 3 years ago

Trauni commented 3 years ago

Hello sir, I`m trying to use another rtmp application of nginx as backup if the first source has an OBS crash or outage.

STREAM_DESTINATION = 'rtmp://148.251.247.165/delay/cf' DELAY = 17 # Seconds SINGLE = False # Set to true to just delay a single stream and exit, no reconnecting/backup-streams BACKUPSTREAM_SHORT = 'rtmp://148.251.247.165/backup/backup' # Show while intermission BACKUPSTREAM_LONG = 'rtmp://148.251.247.165/backup/backup' # Show while longer downtime FFMPEG_EXECUTABLE = "ffmpeg" # Use avconv if you need But it ends up in "Error header information"

Best

Trauni commented 3 years ago

How do I use the backup stream? I tried yt-links, other rtmp links, and so on but if my rtmp stream goes down, nothing happens or will start as a backup

sistason commented 3 years ago

Hey, sorry for not answering you, I kept the mail unread in my inbox...

I just don't have a good answer for you. I didn't really test that feature at the time, since there will be a cut between the streams and it all wasn't really polished anyways. I thought it did work at the time, but maybe it didn't, sry.

the BACKUPSTREAM_SHORT should be set to a url ffmpeg can read from the relay system. It can be a file, rtmp or anything. You can check https://github.com/sistason/rtmp_stream_delayer/blob/master/rtmp_stream_delayer.py#L123 for the command, it's basically ffmpeg -i $BACKUPSTREAM_SHORT.

Maybe you can find out this way if there is an error with the variable, otherwise it will be because your "stream going down" is not recognized as such. You cannot simply say if the stream is finished and should end, of if it crashed... therefore, the feature of the backupstream is really finnicky :/

Trauni commented 3 years ago

Thanks therfore I wont use the backup feature for now.