any way to send `BufferedImage` over websocket eff...
# ktor
a
any way to send
BufferedImage
over websocket efficiently 1 tried to deserilize the constructor using GSON because it has nested object resulting the https://stackoverflow.com/questions/43301580/gson-cant-serialize-bufferedimages 2 tried kotlinx serilization , doesn't work since
BufferedImage
has no
@Serilizable
annotation 3 tried converting buffered image -> float array -> to string(using joinToString) kind of worked but its super slow and unresponsive 4 tried converting buffered image -> bytearray using
ByteArrayOutputStream
and
ImageIO.write()
has made significant improvement but still unusable I don't think the
IO
method would be any efficient but if there's any way to send the whole
BufferedImage
object or deserilizing it without using IO would be take less time
a
Could you please clarify why the solution 4 is unusable?
a
Thanks @Aleksei Tirman [JB] for the response It's because one is it take like minutes to process the The idea is to send continuous frame from the webcam -> ktor server -> ktor client first 3 frames even if we don't take such phenomenon in an account there's one major problems and it was after those frames are loaded it would smooth out but also the loaded frame are a minute apart than the frame that was sent by the server
a
Is it possible to read raw data (without
BufferedImage
) from the webcam to send it over a Websocket connection?
a
There was variable which return
ByteBuffer
but was empty