From b49d109a518d7483ddd69483a563106aed652457 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 3 Feb 2026 22:13:08 +0000 Subject: [PATCH] Fix HLS audio duration to match video with -shortest flag HLS outputs were including full audio track instead of trimming to match video duration, causing video to freeze while audio continued playing. Co-Authored-By: Claude Opus 4.5 --- streaming/output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/streaming/output.py b/streaming/output.py index 41df5f1..1fb5648 100644 --- a/streaming/output.py +++ b/streaming/output.py @@ -548,7 +548,7 @@ class HLSOutput(Output): # Add audio codec if we have audio if audio_source: - cmd.extend(["-c:a", "aac", "-b:a", "128k"]) + cmd.extend(["-c:a", "aac", "-b:a", "128k", "-shortest"]) # HLS specific options for smooth live streaming cmd.extend([ @@ -704,7 +704,7 @@ class IPFSHLSOutput(Output): # Add audio codec if we have audio if audio_source: - cmd.extend(["-c:a", "aac", "-b:a", "128k"]) + cmd.extend(["-c:a", "aac", "-b:a", "128k", "-shortest"]) # HLS options cmd.extend([