We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63eb824 commit 4fe154eCopy full SHA for 4fe154e
1 file changed
supervision/utils/video.py
@@ -329,9 +329,14 @@ def writer_thread(video_sink: VideoSink) -> None:
329
read_item = frame_read_queue.get(timeout=1)
330
if read_item is None:
331
break
332
- # If we timeout waiting for a frame, assume the reader thread failed
+ # If we timeout waiting for a frame, only assume failure if the reader
333
+ # thread is no longer alive. Otherwise, keep waiting as the reader
334
+ # may simply be slow (for example, due to a slow source).
335
except Empty:
- break
336
+ if not reader_worker.is_alive():
337
+ break
338
+ # Reader is still alive; continue waiting for frames.
339
+ continue
340
reader_worker.join()
341
writer_worker.join()
342
progress_bar.close()
0 commit comments