i'm programming an application (in C++/Qt Designer 4.6 and using some librairies like ffmpeg
and v4l2
) which capture from webcam and i want to send the captured QImage
via IP, so i send it into a QTcpSocket
and i succed in receiving it in my server application but the problem it's too slow, crearly because the QImage
isn't compressed so i'm not getting the wanted result which is live video streaming via IP, my question is how can i compress the QImage
? I think in converting it to the YUV
format but i can't realize it, this is some lines from my code to send the available QImage
:
QImage image;
QByteArray ba;
QBuffer buffer(&ba);
image.save(&buffer, "PNG");
imsocket->write(ba);