Aggiunge overlay server-side burn-in e stabilizza diretta live.

Tabellone, badge e brand sono ricodificati nel flusso _air via OverlayRelay;
sync punteggio HTTP, volume condiviso rails/sidekiq, qualità 720p migliorata
e badge CONNECTING in ripresa da pausa.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-03 23:55:17 +02:00
parent fd225fbadd
commit ab9cb02083
58 changed files with 2423 additions and 242 deletions

View File

@@ -0,0 +1,18 @@
namespace :stream_overlay do
desc "Avvia path _air e OverlayRelay per sessioni attive (dopo deploy overlay server)"
task start_active: :environment do
sessions = StreamSession.where(status: %w[live connecting reconnecting paused])
mtx = Mediamtx::Client.new
sessions.find_each do |session|
begin
mtx.create_overlay_path(session)
rescue Mediamtx::Client::Error => e
Rails.logger.info("[stream_overlay:start_active] path #{session.id}: #{e.message}")
end
Streams::OverlayRelay.start(session)
puts "Overlay avviato per sessione #{session.id}"
rescue StandardError => e
warn "Sessione #{session.id}: #{e.message}"
end
end
end