BlazingFire BlazingFire - 2 years ago 238
Java Question

Fastest approach to send OpenCV Mat from PC to Android through Sockets

I have created an app to stream PC display to Android, and I have successfully created the code to get the PC Screen almost in real time. Now, I want to send this data (which is in Mat) to my Android device.

I have created Socket connections before and I know the basics of how to send data from PC to Android. I have tried saving each frame in

format, then sending it over
, but it's quite slow and not much real time.

My question: What is the fastest approach to send OpenCV Mat from PC to Android in (near) real time?

On a side note: My PC code is written in C++ and Android code in Java. And when I see the to-be-streamed content of PC on my PC it's quite real time.

Answer Source

After lots of trying, I could mostly solve my problem. Here is the code for the MJPEG server - Error while using QTcpSocket. (Mostly everything has been fixed except a small problem).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download