libcimbar icon indicating copy to clipboard operation
libcimbar copied to clipboard

hoping to send on windows and decode on another windows

Open denizsincar29 opened this issue 2 years ago • 18 comments

Hello. Are there any bindings or utilities to make the encoder and decoder on windows? I am completely inexperienced in c++ and would love to try this awesome library out. Thank you.

denizsincar29 avatar May 13 '23 10:05 denizsincar29

Do you know how to use Docker? Perhaps there's an easy way using it.

mihaigalos avatar May 13 '23 13:05 mihaigalos

For sending you can use cimbar_js. The easiest way is to save the cimbar.html file from here and open it in your local web browser.

For decoding there's unfortunately not (currently) a good way to do this. It might be possible to rig something up with the cimbar executable using docker (or WSL...), but I haven't done any testing with that approach, and it's likely to feel a bit hack-y regardless.

One eventual goal for this project would be to have a browser-based decoder (just as there's a browser based sender/encoder), but it doesn't exist yet. :no_mouth:

edit: incorrectly wrote cimbar_recv instead of cimbar above. The hack that comes to mind is to capture video frames from a native windows app, and pass each saved image -- hopefully stored on ramdisk -- to a dockerized cimbar running in stdin mode.

sz3 avatar May 14 '23 04:05 sz3

i didn't know what is docker untill 2 weeks ago. I was just using docker if there was writen in some instructions. Yes, a browser based decoder would be nice

denizsincar29 avatar May 14 '23 09:05 denizsincar29

Yes, a browser based decoder would be nice

Cool. Would you implement it? :)

mihaigalos avatar May 15 '23 16:05 mihaigalos

I am a complete beginner at c++. I do what I can, but in this case I wait for a ready solution :). i know that this is not great, but how will i implement a browser based decoder if i can do only cout hello world...

denizsincar29 avatar May 24 '23 19:05 denizsincar29

I am a complete beginner at c++. I do what I can, but in this case I wait for a ready solution :). i know that this is not great, but how will i implement a browser based decoder if i can do only cout hello world...

Ha, don't worry about it. :slightly_smiling_face:

I'll likely implement that myself, though I don't know how soon it'll be.

sz3 avatar May 25 '23 06:05 sz3

I've dockerized a snapshot of libcimbar (commit b0aae7802b50c67c64fd3e1092b7e3f88aefa98b) a while back. I did it on the run and had some manual steps, hence didn't feel confident contributing it upstream. If you're very stuck, at least you can try installing Docker and running this:

docker run -it --volume //c/Users/myuser/myfolder:/src mihaigalos/libcimbar

Make sure to adapt the path to mount into docker to the files you want to encode/decode.

Then, inside docker you can type this for help:

cimbar --help

Then just encode a file using:

cimbar --encode -i input.txt -o encoded

And decode using:

cimbar  encoded.png -o .

All credits go to @sz3, source attribution is in the docker under /src-libcimbar.

mihaigalos avatar May 25 '23 18:05 mihaigalos

hmmm it decodes only static images? but how about data transfer? i mean like animated qrcodes. isn't cimbar made for this?

denizsincar29 avatar Jun 11 '23 06:06 denizsincar29

hmmm it decodes only static images? but how about data transfer? i mean like animated qrcodes. isn't cimbar made for this?

The cimbar executable operates on single or multiple images (it also accepts filenames from stdin, so you can feed it images as they come in). cimbar_recv is a test executable that operates on video streams, but probably won't work in the docker container.

I would definitely categorize it as a hack, but it should be possible to capture camera frames to a series of images, feed them to a long-lived cimbar instance (running in docker) over stdin, and do decodes that way. I'm not sure if that's worth the trouble or not!

sz3 avatar Jun 11 '23 09:06 sz3

Hello! why we can't just compile cimbar on windows?

denizsincar29 avatar Sep 26 '23 08:09 denizsincar29

Hello! why we can't just compile cimbar on windows?

It's not tested/currently supported, so some work will be necessary to get it to compile/run. But you (or anyone else) is welcome to try it if you want!

I'd guess mingw is probably a safer bet than the MS compiler.

sz3 avatar Sep 27 '23 01:09 sz3

Ok, so I've come up with something that seemed to work for me (with animated barcodes).
First, cimbar --encode <file> -o <prefix>. // Encodes
Second, convert <prefix>_*.png <gifname>.gif // Converts encoded file sequence into animated gif
Third, cimbar_recv -i <gifname>.gif -o . and press Ctrl-C when it says its failing to read from camera (It's written the file already)
Fourth, rename the resulting file to whatever you want.

Disclaimer: I am on Linux, so I don't know if it works on windows, but with docker seems like it might work.
Also, for compiling for windows, maybe try cygwin?

Anonymous3-a avatar Dec 29 '23 16:12 Anonymous3-a