We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b9a9cf commit 074f542Copy full SHA for 074f542
1 file changed
examples/local_video/publisher.py
@@ -276,10 +276,16 @@ async def publish_track_with_fallback(
276
def burn_timestamp(frame_bgr, timestamp_us: int) -> None:
277
text = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(timestamp_us / 1_000_000))
278
text = f"{text}.{(timestamp_us // 1_000) % 1000:03d}"
279
+ (_, text_height), baseline = cv2.getTextSize(
280
+ text,
281
+ cv2.FONT_HERSHEY_SIMPLEX,
282
+ 0.9,
283
+ 2,
284
+ )
285
cv2.putText(
286
frame_bgr,
287
text,
- (20, 40),
288
+ (20, frame_bgr.shape[0] - baseline - 20),
289
cv2.FONT_HERSHEY_SIMPLEX,
290
0.9,
291
(255, 255, 255),
0 commit comments