fix?
This commit is contained in:
@ -294,9 +294,11 @@ async def stream_video_from_fifo():
|
|||||||
# -c:v copy: copy video codec without re-encoding (use hardware-encoded H.264)
|
# -c:v copy: copy video codec without re-encoding (use hardware-encoded H.264)
|
||||||
# -f hls: output HLS format
|
# -f hls: output HLS format
|
||||||
# -hls_time 1: 1 second per segment (low latency)
|
# -hls_time 1: 1 second per segment (low latency)
|
||||||
# -hls_list_size 5: keep 5 segments in playlist
|
# -hls_list_size 10: keep 10 segments in playlist (more buffer for clients)
|
||||||
|
# -hls_delete_threshold 3: delete segments only after 3 new ones created
|
||||||
# -hls_flags delete_segments+append_list+omit_endlist: live streaming flags
|
# -hls_flags delete_segments+append_list+omit_endlist: live streaming flags
|
||||||
# -hls_segment_type mpegts: use MPEG-TS segments
|
# -hls_segment_type mpegts: use MPEG-TS segments
|
||||||
|
# -hls_segment_filename: use %d for unlimited numbering
|
||||||
# -start_number 0: start segment numbering from 0
|
# -start_number 0: start segment numbering from 0
|
||||||
ffmpeg_process = subprocess.Popen(
|
ffmpeg_process = subprocess.Popen(
|
||||||
['ffmpeg',
|
['ffmpeg',
|
||||||
@ -308,10 +310,11 @@ async def stream_video_from_fifo():
|
|||||||
'-c:v', 'copy',
|
'-c:v', 'copy',
|
||||||
'-f', 'hls',
|
'-f', 'hls',
|
||||||
'-hls_time', '1',
|
'-hls_time', '1',
|
||||||
'-hls_list_size', '5',
|
'-hls_list_size', '10',
|
||||||
|
'-hls_delete_threshold', '3',
|
||||||
'-hls_flags', 'delete_segments+append_list+omit_endlist',
|
'-hls_flags', 'delete_segments+append_list+omit_endlist',
|
||||||
'-hls_segment_type', 'mpegts',
|
'-hls_segment_type', 'mpegts',
|
||||||
'-hls_segment_filename', f'{hls_dir}/segment_%03d.ts',
|
'-hls_segment_filename', f'{hls_dir}/segment_%d.ts',
|
||||||
'-start_number', '0',
|
'-start_number', '0',
|
||||||
f'{hls_dir}/playlist.m3u8'],
|
f'{hls_dir}/playlist.m3u8'],
|
||||||
stdin=subprocess.PIPE,
|
stdin=subprocess.PIPE,
|
||||||
|
|||||||
@ -367,13 +367,14 @@
|
|||||||
|
|
||||||
if (Hls.isSupported()) {
|
if (Hls.isSupported()) {
|
||||||
hls = new Hls({
|
hls = new Hls({
|
||||||
// Low latency configuration
|
// Low latency configuration with increased buffer
|
||||||
lowLatencyMode: true,
|
lowLatencyMode: true,
|
||||||
backBufferLength: 90,
|
backBufferLength: 90,
|
||||||
maxBufferLength: 3,
|
maxBufferLength: 10, // Increased from 3 to 10 seconds
|
||||||
maxBufferSize: 1 * 1024 * 1024, // 1MB
|
maxBufferSize: 3 * 1024 * 1024, // Increased from 1MB to 3MB
|
||||||
liveSyncDurationCount: 1,
|
liveSyncDurationCount: 3, // Keep 3 segments in sync
|
||||||
liveMaxLatencyDurationCount: 2,
|
liveMaxLatencyDurationCount: 5, // Max 5 segments latency before catchup
|
||||||
|
maxMaxBufferLength: 30, // Maximum buffer length
|
||||||
enableWorker: true,
|
enableWorker: true,
|
||||||
debug: false
|
debug: false
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user