ffmpeg timout from 5 to 15s; diarization lag does not stay = 0 at the beginning
This commit is contained in:
parent
d304011aac
commit
b37d3cafb3
1 changed files with 2 additions and 3 deletions
|
|
@ -120,8 +120,7 @@ class SharedState:
|
||||||
remaining_time_transcription = max(0, round(current_time - self.beg_loop - self.end_buffer, 2))
|
remaining_time_transcription = max(0, round(current_time - self.beg_loop - self.end_buffer, 2))
|
||||||
|
|
||||||
# Calculate remaining time for diarization
|
# Calculate remaining time for diarization
|
||||||
if self.end_attributed_speaker > 0:
|
remaining_time_diarization = max(0, round(max(self.end_buffer, self.tokens[-1].end if self.tokens else 0) - self.end_attributed_speaker, 2))
|
||||||
remaining_time_diarization = max(0, round(max(self.end_buffer, self.tokens[-1].end if self.tokens else 0) - self.end_attributed_speaker, 2))
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"tokens": self.tokens.copy(),
|
"tokens": self.tokens.copy(),
|
||||||
|
|
@ -420,7 +419,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
||||||
loop.run_in_executor(
|
loop.run_in_executor(
|
||||||
None, ffmpeg_process.stdout.read, ffmpeg_buffer_from_duration
|
None, ffmpeg_process.stdout.read, ffmpeg_buffer_from_duration
|
||||||
),
|
),
|
||||||
timeout=5.0
|
timeout=15.0
|
||||||
)
|
)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
logger.warning("FFmpeg read timeout. Restarting...")
|
logger.warning("FFmpeg read timeout. Restarting...")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue