samedi 29 août 2015

What's the quickest way to stream binary data from web server to browser?

I'm working on realtime book scanning software that operates at 30 pages per minute. One of challenges is to stream book scans to the browser very fast as they happen. Each scanned page is about 2MB and we can't quite send it real time to browser, so we downscale the image and first send a preview of about 100K, and then progressively send higher quality images. This gives an impression to user it's loading continuously and everyone is happy.

Biggest challenge is how to stream binary data most effectively without going through a lot of unnecessary steps.

Right now I send string encoded image through a websocket but that takes two extra steps - first encoding image to string on book scanning machine (it runs linux), then decoding it on client side. Does anyone know if I can send binary data somehow with websockets? (we also have to support IE9+)

What other ways I could send binary data from linux book scanning machine to browser? Are there other communication protocols? (I apologize as don't know every protocol. I'm learning and any help appreciated.)




Aucun commentaire:

Enregistrer un commentaire