YouTube live immediata: relay sempre attivo e attivazione broadcast.
Il relay parte dal job overlay ogni 2s; scheduledStartTime ~90s invece di 5 min; transition testing/live quando l'ingest RTMP raggiunge YouTube. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -32,6 +32,7 @@ module Streams
|
||||
Process.detach(pid)
|
||||
store_pid(session.id, pid)
|
||||
Rails.logger.info("[YoutubeRelay] started pid=#{pid} session=#{session.id}")
|
||||
schedule_youtube_activate(session)
|
||||
pid
|
||||
rescue Errno::ENOENT => e
|
||||
raise Error, "ffmpeg non disponibile: #{e.message}"
|
||||
@@ -68,6 +69,12 @@ module Streams
|
||||
|
||||
private
|
||||
|
||||
def schedule_youtube_activate(session)
|
||||
return if session.youtube_broadcast_id.blank?
|
||||
|
||||
YoutubeBroadcastActivateJob.set(wait: 8.seconds).perform_later(session.id)
|
||||
end
|
||||
|
||||
def mediamtx_intake_url(session)
|
||||
base = ENV.fetch("MEDIAMTX_INTERNAL_RTMP_URL", "rtmp://mediamtx:1935")
|
||||
"#{base.chomp('/')}/#{session.mediamtx_overlay_path_name}"
|
||||
|
||||
Reference in New Issue
Block a user