Repository navigation
-
Goroutine Memory Leak Fix: Replaced the buffered channel and background goroutine reading FFmpeg stdout with a direct streaming loop to prevent memory and CPU leaks when clients disconnect.
-
HTTP Chunk Flushing (Local): Implemented
http.Flusherfor the local capture card route to immediately deliver video chunks, bypassing Go's default buffering and eliminating stream jitter. -
Keyframe and GOP Optimization: Forced a 1-second Group of Pictures (GOP) interval using
-gand-keyint_minso Channels DVR receives keyframes instantly without waiting 4-5 seconds to begin decoding. -
Dynamic Muxrate Adjustment: Removed the rigid
-muxrate 10Margument that was wasting bandwidth with null packet padding and causing stream drops during high-motion scenes. -
MPEG-TS Header Broadcasts: Added
-pat_period 0.1and-mpegts_flags +resend_headersto frequently broadcast PAT/PMT program tables, allowing Channels DVR to lock onto the stream immediately. -
HTTP Chunk Flushing (Network Proxy): Applied the same
http.Flusherlogic to the network encoder proxy loop to deliver packets instantly while preserving the user-definedblackoutMssplash screen delay.