From 8d3b253bf15e6ccc13c4748a988d2d86fcc05c23 Mon Sep 17 00:00:00 2001 From: Martin Dlouhy Date: Mon, 13 May 2024 10:40:50 +0200 Subject: [PATCH] osgar/tools/lidarview.py - FIXUP H264 copy & paste --- osgar/tools/lidarview.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osgar/tools/lidarview.py b/osgar/tools/lidarview.py index 5eb6f686b..4b2030264 100644 --- a/osgar/tools/lidarview.py +++ b/osgar/tools/lidarview.py @@ -252,10 +252,12 @@ def get_image(data): # I - key frame with open('tmp.h264', 'wb') as f: f.write(data) - elif data.startswith(bytes.fromhex('00000001 0950')): + elif data.startswith(bytes.fromhex('00000001 0930')): # P-frame} with open('tmp.h264', 'ab') as f: f.write(data) + else: + assert 0, f'Unexpected data {data[:20].hex()}' cap = cv2.VideoCapture('tmp.h264') image = None ret = True