Picture

Hi, I'm Stephen Nicholas.

And this is my blog. I'm a software engineer by trade (but mostly for fun) with a wide variety of experience and interests. Some of which I'll write about here.

QuickeR: Using video QR codes to transfer data

Recently I attended Over the Air, which (to borrow from their website) is:

a great vibe of bean bags, gadgets, knowledge sharing, hacking & lots of good geekery.

Or, to be more specific:

a unique tech-agnostic event for and by the developer community, featuring technical workshops where attendees can roll up their sleeves and tinker with new platforms, operating systems, APIs & SDKs; and tutorial sessions that feature real business cases, new insights and a healthy dollop of inspiration. Attendees are invited to stay overnight so that they can work on ideas, apps and hacks on the fly – to be entered into the various hack-athon competition categories and demo’ed on the second day.

And it was awesome! I met some really cool people, was fantastically well looked after, and this year it was held in Bletchley Park; which is an amazing place and somewhere I’ve always wanted to visit.

One of the more fun parts of the event was the traditional overnight hack; with people seeing what cool things they could cobble together (often involving some of the tech & APIs shown off at the event), which then got shown off the next day, with the best winning prizes.

This is what I came up with:

QuickeR

The basic idea was to transfer data between ‘devices’ using ‘video’ QR codes, i.e. by splitting the data over multiple QR codes, which are then presented one after another as a video. Another device can then capture this video, split it into the separate QR codes, process them and recombine their contents to reproduce the original data.

So, as an example, I took the following four QR codes:

1This 2is 3a 4test

And combined them into the following video (gif):

Note: the numbers are there to denote the order of the elements, as the video will repeat endlessly and we don’t know where it started.

I then created an Android app that could read the video and reconstitute the data:

Now, not to sound too full of myself, but I think is a pretty cool idea and it’s something that I don’t think I’ve seen anywhere before.

The initial use case I came up with was for transferring data between mobile phones, particularly in situations when network connectivity wasn’t available or was unreliable (which was unfortunately the case at Over the Air). However it could work between any device that can display a video and any device that can capture that video and run a bit of software. So for example, you could communicate between a TV and a mobile phone – maybe to download a sample app while the advert is on?

Also, theoretically, it has a moderately high transfer rate (for what it is):

15 FPS x ~2,953 bytes per frame = ~43 KB/s.

Comparable to a modem of old :)

Now, the app as it is today is fairly cludgy, as you’d expect for something thrown together in the space of 5 hours, and so I’m not going to shove the code up here – yet. There’s a load of cool things I want to do first:

  • Add video creation to the app – allowing you to select a file on the device for transfer.
  • Use smarter encoding schemes and maybe data compression.
  • Auto-stop & error checking – by adding information about how many frames should be in the data set.
  • Harden the code – it has a unfortunate tendency to fall over with out of memory errors at the moment :)
  • General UI improvements – creating one for a start.

Who knows, I may even release it as an app on the marketplace.


*P.S. I did get some comments about the name. To be honest, I started with the Q & R and worked backwards from there; however I do argue that it’s quicker than scanning multiple QR codes separately and trying to put the stuff back together yourself.