Fix freeze YouTube al cambio punteggio: PNG atomica e relay stabile

rsvg scrive su .tmp poi rename; il feeder ignora PNG parziali.
YouTube relay: no doppio avvio, reconnect RTMP; overlay restart solo dopo 3 miss.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-04 09:07:06 +02:00
parent fde1213ca5
commit 4c7be615f1
4 changed files with 31 additions and 4 deletions

View File

@@ -12,6 +12,8 @@ module Streams
return if session.stream_key.blank?
return if session.terminal?
return pid_for(session.id).to_i if running?(session.id)
stop(session) if pid_for(session.id).present?
log_path = log_file(session)
@@ -80,6 +82,7 @@ module Streams
"-fflags", "+genpts+discardcorrupt", "-use_wallclock_as_timestamps", "1",
"-analyzeduration", "10000000", "-probesize", "10000000",
"-rw_timeout", "15000000",
"-reconnect", "1", "-reconnect_at_eof", "1", "-reconnect_streamed", "1", "-reconnect_delay_max", "5",
"-i", intake,
"-f", "lavfi", "-i", "anullsrc=channel_layout=mono:sample_rate=48000",
"-map", "0:v:0", "-map", "1:a:0",