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:
@@ -1,7 +1,7 @@
|
|||||||
class StreamEvent < ApplicationRecord
|
class StreamEvent < ApplicationRecord
|
||||||
EVENT_TYPES = %w[
|
EVENT_TYPES = %w[
|
||||||
connected disconnected reconnected quality_changed error paused resumed
|
connected disconnected reconnected quality_changed error paused resumed
|
||||||
started ended network_test pairing
|
started ended network_test pairing youtube_ready
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
belongs_to :stream_session
|
belongs_to :stream_session
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ module Streams
|
|||||||
ffmpeg_pid = Process.spawn(
|
ffmpeg_pid = Process.spawn(
|
||||||
"ffmpeg", "-nostdin", "-hide_banner", "-loglevel", "warning",
|
"ffmpeg", "-nostdin", "-hide_banner", "-loglevel", "warning",
|
||||||
"-fflags", "+genpts+discardcorrupt",
|
"-fflags", "+genpts+discardcorrupt",
|
||||||
|
"-analyzeduration", "10000000", "-probesize", "10000000",
|
||||||
"-rw_timeout", "15000000",
|
"-rw_timeout", "15000000",
|
||||||
"-i", intake,
|
"-i", intake,
|
||||||
"-f", "image2pipe", "-framerate", overlay_fps.to_s, "-i", pipe.to_s,
|
"-f", "image2pipe", "-framerate", overlay_fps.to_s, "-i", pipe.to_s,
|
||||||
@@ -193,9 +194,12 @@ module Streams
|
|||||||
end
|
end
|
||||||
|
|
||||||
def process_alive?(pid)
|
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)
|
Process.kill(0, pid.to_i)
|
||||||
true
|
true
|
||||||
rescue Errno::ESRCH, Errno::EPERM
|
rescue Errno::ESRCH, Errno::EPERM, Errno::ENOENT
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -129,9 +129,12 @@ module Streams
|
|||||||
end
|
end
|
||||||
|
|
||||||
def process_alive?(pid)
|
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)
|
Process.kill(0, pid.to_i)
|
||||||
true
|
true
|
||||||
rescue Errno::ESRCH, Errno::EPERM
|
rescue Errno::ESRCH, Errno::EPERM, Errno::ENOENT
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user