Skip to content

Commit

Permalink
warn and return false on transition mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Nov 15, 2024
1 parent 5e0b1db commit f4ab018
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Binary file not shown.
4 changes: 3 additions & 1 deletion backend/src/utils/SceneDetect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import cv2
from collections import deque
import sys
from .Util import bytesToImg
from .PySceneDetectUtils import ContentDetector

Expand Down Expand Up @@ -196,7 +197,8 @@ def sceneDetect(self, frame: np.ndarray):
self.frameNum += 1
if len(frameList) > 0:
if self.frameNum != frameList[0] + 1:
print("-------" + f"{self.frameNum}, {frameList[0]}")
print(f"Transition Mismatch {self.frameNum} is not equal to {frameList[0] + 1}, skipping", file=sys.stderr)
return False

return len(frameList) > 0

Expand Down

0 comments on commit f4ab018

Please sign in to comment.