Hello,
Is there a way to put placeholders inside columns ? I am using empty() to display cv2 video streams but I cannot have a kind of 2x2 grid from 4 streams. All images are displayed in there placeholders but they stay stacked one on top of the other ones.
Here’s my code:
import cv2
import numpy as np
import streamlit as st
cap01 = cv2.VideoCapture("rtsp://xxxx:xxxx@192.168.0.xxx:xxx/xx")
ret, frame = cap01.read()
col1, col2 = st.beta_columns([1,1])
camImage01 = st.empty()
camImage02 = st.empty()
if cap01.isOpened():
ret, frame = cap01.read()
else:
ret = False
while ret:
ret, frame = cap01.read()
with col1:
camImage01.image(frame, clamp=True, width=500, channels='BGR')
with col2:
camImage02.image(frame, clamp=True, width=500, channels='BGR')
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap01.release()
cv2.destroyAllWindows()
Thank you for ant idea you might suggest.
Have a nice day,
Pierre-Emmanuel FEGA