简体   繁体   English

通过套接字将OpenCV Mat从PC发送到Android的最快方法

[英]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. 我已经创建了一个应用程序,用于将PC显示器流式传输到Android,并且我已经成功创建了几乎实时获取PC屏幕的代码。 Now, I want to send this data (which is in Mat ) to my Android device. 现在,我想将此数据(在Mat中 )发送到我的Android设备。

I have created Socket connections before and I know the basics of how to send data from PC to Android. 我之前已经创建了Socket连接,并且我了解如何将数据从PC发送到Android的基础知识。 I have tried saving each frame in png format, then sending it over Sockets , but it's quite slow and not much real time. 我试过将每个帧保存为png格式,然后通过Sockets发送,但这很慢,而且实时性不高。

My question: What is the fastest approach to send OpenCV Mat from PC to Android in (near) real time? 我的问题:将OpenCV Mat从PC实时发送到Android(最快)的最快方法是什么?

On a side note: My PC code is written in C++ and Android code in Java. 附带说明:我的PC代码是用C ++编写的,而Android代码是用Java编写的。 And when I see the to-be-streamed content of PC on my PC it's quite real time. 当我在PC上看到PC的流媒体内容时,它是实时的。

After lots of trying, I could mostly solve my problem. 经过大量的尝试,我基本上可以解决我的问题。 Here is the code for the MJPEG server - Error while using QTcpSocket . 这是MJPEG服务器的代码- 使用QTcpSocket时出错 (Mostly everything has been fixed except a small problem). (除一个小问题外,大多数事情都已解决)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM