diff --git a/services/playout/src/playout-manager.js b/services/playout/src/playout-manager.js index 989c767..c846483 100644 --- a/services/playout/src/playout-manager.js +++ b/services/playout/src/playout-manager.js @@ -230,12 +230,19 @@ export class PlayoutManager { // logs "sliding 0.00 / MISSED", never loads a fragment, and the monitor // stays black even though the stream decodes cleanly server-side. A // standalone ffmpeg honours -force_key_frames, so every GOP (and thus - // every HLS segment) is exactly 2.0s. fps=30 forces CFR; scale to 720p - // keeps the confidence monitor cheap. - '-vf', 'fps=30,scale=-2:720,format=yuv420p', - '-c:v', 'libx264', '-preset', 'veryfast', '-tune', 'zerolatency', - '-b:v', '1500k', '-maxrate', '2M', '-bufsize', '4M', - '-g', '60', '-keyint_min', '60', '-sc_threshold', '0', + // every HLS segment) is exactly 2.0s. + // + // This is a CONFIDENCE MONITOR, kept deliberately tiny: 360p / 20fps / + // ultrafast. The sidecar has no NVENC, so this is a CPU libx264 encode + // running ALONGSIDE CasparCG's mixer + its own STREAM consumer. At 720p30 + // the re-encode couldn't sustain real time, the UDP input overran, and the + // HLS output stalled (playlist froze → monitor black). 360p20 ultrafast is + // a fraction of the cost and keeps up comfortably. fps=20 forces CFR; + // -g 40 = 2.0s GOP at 20fps. + '-vf', 'fps=20,scale=-2:360,format=yuv420p', + '-c:v', 'libx264', '-preset', 'ultrafast', '-tune', 'zerolatency', + '-b:v', '600k', '-maxrate', '800k', '-bufsize', '1200k', + '-g', '40', '-keyint_min', '40', '-sc_threshold', '0', '-force_key_frames', 'expr:gte(t,n_forced*2)', '-f', 'hls', '-hls_time', '2',