From 4f9c3ea08b913600b977ba68f10f625b40dcb7d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tronel?= Date: Thu, 23 Oct 2025 11:12:20 +0200 Subject: [PATCH] Improvement of how we determine the initial timestamp. --- panasonic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panasonic.py b/panasonic.py index 0d69935..dd98068 100755 --- a/panasonic.py +++ b/panasonic.py @@ -154,8 +154,9 @@ def getInitialTSFromBuffer(content, delta=0.1): logger = logging.getLogger(__name__) logger.debug('Determining initial timestamp from content') + length = len(content) with Popen(['ffprobe','/dev/stdin','-loglevel', 'quiet', '-read_intervals', ('0%%+%f' % delta), '-show_entries', 'frame=frame_no,best_effort_timestamp_time', '-of','json'], stdout=PIPE, stdin=PIPE) as ffprobe: - out, _ = ffprobe.communicate(input=content) + out, _ = ffprobe.communicate(input=content[0:min(length,200000)]) frames = json.load(BytesIO(out)) logger.debug('Frames: %s' % frames) if 'frames' in frames: