Added more aggressive timestamp handling for ad stitched streams
This commit is contained in:
@@ -25,10 +25,12 @@ router.get('/', (req, res) => {
|
|||||||
const args = [
|
const args = [
|
||||||
'-hide_banner',
|
'-hide_banner',
|
||||||
'-loglevel', 'warning',
|
'-loglevel', 'warning',
|
||||||
// Error resilience: discard corrupt packets, generate timestamps
|
// Error resilience: discard corrupt packets, generate timestamps, ignore DTS
|
||||||
'-fflags', '+genpts+discardcorrupt+igndts',
|
'-fflags', '+genpts+discardcorrupt+igndts',
|
||||||
// Ignore errors in stream and continue
|
// Ignore errors in stream and continue
|
||||||
'-err_detect', 'ignore_err',
|
'-err_detect', 'ignore_err',
|
||||||
|
// Limit max demux delay to prevent buffering issues with bad timestamps
|
||||||
|
'-max_delay', '5000000',
|
||||||
// Reconnect settings for network drops (useful for live streams)
|
// Reconnect settings for network drops (useful for live streams)
|
||||||
'-reconnect', '1',
|
'-reconnect', '1',
|
||||||
'-reconnect_streamed', '1',
|
'-reconnect_streamed', '1',
|
||||||
@@ -41,6 +43,9 @@ router.get('/', (req, res) => {
|
|||||||
'-ar', '48000',
|
'-ar', '48000',
|
||||||
'-b:a', '256k', // Increased for surround sound
|
'-b:a', '256k', // Increased for surround sound
|
||||||
'-af', 'aresample=48000:async=1',
|
'-af', 'aresample=48000:async=1',
|
||||||
|
// Handle timestamp discontinuities at output
|
||||||
|
'-vsync', 'passthrough',
|
||||||
|
'-max_muxing_queue_size', '1024',
|
||||||
// Fragmented MP4 for streaming (browser-compatible)
|
// Fragmented MP4 for streaming (browser-compatible)
|
||||||
'-f', 'mp4',
|
'-f', 'mp4',
|
||||||
'-movflags', 'frag_keyframe+empty_moov+default_base_moof',
|
'-movflags', 'frag_keyframe+empty_moov+default_base_moof',
|
||||||
|
|||||||
Reference in New Issue
Block a user