Improve FFmpeg startup speed and stream resilience

This commit is contained in:
Trevor Mears
2026-01-01 11:52:47 -08:00
parent ec9a6bcc23
commit 9fb8df7255
2 changed files with 15 additions and 4 deletions
+5 -2
View File
@@ -25,8 +25,11 @@ router.get('/', (req, res) => {
const args = [
'-hide_banner',
'-loglevel', 'warning',
// Error resilience: discard corrupt packets, generate timestamps, ignore DTS
'-fflags', '+genpts+discardcorrupt+igndts',
// Low-latency startup: reduce probe/analyze time for faster first bytes
'-probesize', '32768',
'-analyzeduration', '0',
// Error resilience: discard corrupt packets, generate timestamps, ignore DTS, no buffering
'-fflags', '+genpts+discardcorrupt+igndts+nobuffer',
// Ignore errors in stream and continue
'-err_detect', 'ignore_err',
// Limit max demux delay to prevent buffering issues with bad timestamps