Fix overlay _air: probesize su intake RTMP e rilevamento zombie
Senza analyzeduration/probesize l'overlay non pubblicava su _air; YouTube restava in attesa. Esclusi processi ffmpeg zombie da running?. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,6 +30,7 @@ module Streams
|
||||
ffmpeg_pid = Process.spawn(
|
||||
"ffmpeg", "-nostdin", "-hide_banner", "-loglevel", "warning",
|
||||
"-fflags", "+genpts+discardcorrupt",
|
||||
"-analyzeduration", "10000000", "-probesize", "10000000",
|
||||
"-rw_timeout", "15000000",
|
||||
"-i", intake,
|
||||
"-f", "image2pipe", "-framerate", overlay_fps.to_s, "-i", pipe.to_s,
|
||||
@@ -193,9 +194,12 @@ module Streams
|
||||
end
|
||||
|
||||
def process_alive?(pid)
|
||||
stat = File.read("/proc/#{pid.to_i}/stat")
|
||||
return false if stat.split[2] == "Z"
|
||||
|
||||
Process.kill(0, pid.to_i)
|
||||
true
|
||||
rescue Errno::ESRCH, Errno::EPERM
|
||||
rescue Errno::ESRCH, Errno::EPERM, Errno::ENOENT
|
||||
false
|
||||
end
|
||||
|
||||
|
||||
@@ -129,9 +129,12 @@ module Streams
|
||||
end
|
||||
|
||||
def process_alive?(pid)
|
||||
stat = File.read("/proc/#{pid.to_i}/stat")
|
||||
return false if stat.split[2] == "Z"
|
||||
|
||||
Process.kill(0, pid.to_i)
|
||||
true
|
||||
rescue Errno::ESRCH, Errno::EPERM
|
||||
rescue Errno::ESRCH, Errno::EPERM, Errno::ENOENT
|
||||
false
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user