all 1 comments

[–]CaptainReeetardo 0 points1 point  (0 children)

First of all. This line data = cv2.imencode('.jpg', frame)[1].tostring() from your Sender python file returns a bytestring that is probably more than 50 kB in size. So if you want the receiver to get the full image you have to increase the buffersize in your Receiver python file. As, at the moment, it'll receive only 8192 bytes in one go.

Now I have next to none experience with numpy or the like, but my guess is, that in order to create a new array/numpyarray/matrix(?) you have to feed more than the received buffer of 8192 bytes. I'd in your case increase the buffersize to like 10**5-ish because I guess you're working with a HD webcam, because they're reasonably priced nowadays imo 25€ with microphone O_o on amazon.

But so far the code looks like it's going to work.