Skip to content

Commit 2edfdd6

Browse files
committed
Make video decoding less noisy in trace mode
1 parent 5e78088 commit 2edfdd6

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/flitter/cache.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,8 @@ def read_video_frames(self, obj, position, loop=False, back_and_forth=False, tri
307307
if len(frames) >= 2 and timestamp >= frames[0].pts and (frames[-1] is None or timestamp < frames[-1].pts):
308308
break
309309
if frames and timestamp < frames[0].pts:
310-
logger.trace("Discard {} buffered video frames", len(frames))
311310
frames = []
312311
if len(frames) >= 2 and frames[-1].key_frame and timestamp > 2*frames[-1].pts - frames[0].pts:
313-
logger.trace("Discard {} buffered video frames", len(frames))
314312
frames = []
315313
if not frames:
316314
if decoder is not None:
@@ -322,22 +320,17 @@ def read_video_frames(self, obj, position, loop=False, back_and_forth=False, tri
322320
try:
323321
frame = next(decoder)
324322
if frame.key_frame:
325-
logger.trace("Read video key frame @ {:.2f}s", float(frame.pts * stream.time_base))
326323
for i in range(len(frames)-1, 0, -1):
327324
if frames[i].key_frame:
328325
frames = frames[i:]
329-
logger.trace("Discard {} buffered video frames", i)
330326
break
331-
else:
332-
logger.trace("Read video frame @ {:.2f}s", float(frame.pts * stream.time_base))
333327
count += 1
334328
except StopIteration:
335329
logger.trace("Hit end of video {}", self._path)
336330
decoder = None
337331
frame = None
338332
if len(frames) == MAX_CACHE_VIDEO_FRAMES:
339333
frames.pop(0)
340-
logger.trace("Discard one buffered video frame (hit maximum)")
341334
frames.append(frame)
342335
if len(frames) == 1:
343336
logger.trace("Decoding frames from {:.2f}s", float(frames[0].pts * stream.time_base))

0 commit comments

Comments
 (0)