Fix Process.spawn: redirect log ffmpeg fuori dallo splat

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-04 08:46:02 +02:00
parent 02ff1de0f6
commit 841e99c775

View File

@@ -21,7 +21,8 @@ module Streams
# YouTube richiede FLV H.264/AAC stabili; -c copy lascia spesso streamStatus=inactive.
pid = Process.spawn(
*youtube_ffmpeg_args(intake, output, log_path),
*youtube_ffmpeg_args(intake, output),
%i[out err] => log_path,
pgroup: true
)
Process.detach(pid)
@@ -70,7 +71,7 @@ module Streams
# Non usare ffprobe su RTMP live: si blocca e impedisce l'avvio del relay (Sidekiq in hang).
# Audio: traccia AAC da anullsrc (YouTube la richiede); il mic del telefono resta su _air/HLS.
def youtube_ffmpeg_args(intake, output, log_path)
def youtube_ffmpeg_args(intake, output)
[
"ffmpeg", "-nostdin", "-hide_banner", "-loglevel", "warning",
"-fflags", "+genpts+discardcorrupt", "-use_wallclock_as_timestamps", "1",
@@ -82,8 +83,7 @@ module Streams
"-pix_fmt", "yuv420p", "-r", "30", "-g", "30", "-keyint_min", "30", "-sc_threshold", "0",
"-b:v", "4000k", "-maxrate", "4000k", "-bufsize", "8000k",
"-c:a", "aac", "-b:a", "128k", "-ar", "48000", "-ac", "1",
"-f", "flv", output,
%i[out err] => log_path
"-f", "flv", output
]
end