1 | initial version |
oh i was somehow assuming, that you were writing a little webserver-program in c++ on your own, that's where the sockets (sock) come in. http://beej.us/guide/bgnet/ has some nice hints on that. the general flow:
listen on that port
int outlen = img.width * img.height * img.nChannels; // bytecount char head[512]; // make space for the header sprintf(head,"--mjpegstream\r\nContent-Type: image/jpeg\r\nContent-Length: %lu\r\n\r\n",outlen); write(sock,head,strlen(head)); write(sock,(char*)(&outbuf[0]),outlen);