how to send a live stream in opencv
Hi. I try to send a live stream from videocapture directly. But it appear error : message too long Do i need process the stream before sending? I hope someone can do me a favor . THX in advance. here is my testing code: import cv2 from socket import *
cap = cv2.VideoCapture(0)
sock = socket(AF_INET, SOCK_DGRAM)
while (cap.isOpend()): t, frame = cap.read() ser.sendto(frame, addr)
cap.release() cv2.destoryAllWindows()
duplicate of your last question. close the other one ?
eh... what do you mean?
better to have only 1 question with the same topic here, else it gets pretty confusing, no ?
Got it ! so could you anwser my question PLS
@wzj Check out the answer here might be helpful.
wzj, there's no simple answer.
thank you so much
sure that will work. just the strings are a bad idea. if you can flatten the numpy frame into one long 1d array, then socket.write(bytearray( frame1d ) )
eh... http://stackoverflow.com/questions/20820602/image-send-via-tcp it use string to transmission. There is some code that I do not really understand sock.send( str(len(stringData)).ljust(16)); why need do this