I want to send two or more images simultaneously from Kafka Producer. Is it possibile?
After created a KafkaProducer object kafka_producer
and after got frames from two webcam and converted them into bytes using cv2.imencode
and tobytes()
, I've tried this:
buffer_frame1 = cv2.imencode('jpg', frame1)
buffer_frame2 = cv2.imencode('jpg', frame2)
kafka_producer.send(topic, buffer_frame1.tobytes())
kafka_producer.send(topic, buffer_frame2.tobytes())
I haven't yet implement a KafkaConsumer, but I want to know if this work, and if it don't why and how can I send multiple images simultaneously.
Thanks!