Buffer bounded recording segments for stable browser playback

This commit is contained in:
Codex
2026-10-06 23:00:28 +08:00
parent 12556bf10f
commit f7d3fea92f
12 changed files with 187 additions and 26 deletions
+2 -1
View File
@@ -885,7 +885,8 @@ class Handler(BaseHTTPRequestHandler):
started = False
old_timeout = self.connection.gettimeout()
try:
with playback.stream('http://127.0.0.1:' + str(PLAYBACK_PORT) + path, MEDIA_AUTH, duration) as output:
reserve_bytes = int(setting('storage', DEFAULT_STORAGE).get('reserveGB', 8) * 1024**3)
with playback.stream('http://127.0.0.1:' + str(PLAYBACK_PORT) + path, MEDIA_AUTH, duration, reserve_bytes=reserve_bytes) as output:
first = output.read1(65536)
if not first:
raise Problem('录像转换失败,请检查录像是否完整及服务器视频驱动', 503)