Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributing #7

Closed
sledesm opened this issue Sep 12, 2017 · 9 comments
Closed

Contributing #7

sledesm opened this issue Sep 12, 2017 · 9 comments

Comments

@sledesm
Copy link
Contributor

sledesm commented Sep 12, 2017

How could I contribute to this project?
I have made a simple example which allows to stream the camera frames into pngs very quickly. there are other applications online, but they are either bulky or very slow.

@jean343
Copy link
Owner

jean343 commented Sep 12, 2017

Thanks so much for the feedback!
I always like examples, and I would like to add it. Either make a fork and send me a pull request, or write the code somewhere and I will add it.
Did you use the Camera and ImageWriter?

JP

@sledesm
Copy link
Contributor Author

sledesm commented Sep 13, 2017

I used Camera and ImageEncoder. I do not know about ImageWriter.

@jean343
Copy link
Owner

jean343 commented Sep 13, 2017

I saw your request, getting my PI from my pile and I will try!

@sledesm
Copy link
Contributor Author

sledesm commented Sep 13, 2017

I just added another commit, to solve the problem of the buffer length on the stream. Here is a code snippet from the sample application that I am building

    var ws = require('stream').Writable();
    var recBuffer = null;
    ws._write = function (chunk, enc, next) {
        var nextPart = chunk;
        if (chunk.onBufferDone) {
            if (chunk.usedLength !== undefined && chunk.usedLength < chunk.length) {
                // console.log("Getting buffer to smaller size")
                nextPart = chunk.slice(0, chunk.usedLength);
            }
            if (!recBuffer) {
                recBuffer = nextPart;
            } else {
                recBuffer = concat([recBuffer, nextPart]);
            }
            riseCore.emit("omx-camera-frame", recBuffer);
            recBuffer = null;
            chunk.onBufferDone();
        } else {
            if (recBuffer) {
                recBuffer = Buffer.concat([recBuffer, chunk]);
            } else
                recBuffer = Buffer.from(chunk);
        }
        next();
    };

@jean343
Copy link
Owner

jean343 commented Sep 13, 2017

I merged it, however it does not work for me, _write isn't called.

@sledesm
Copy link
Contributor Author

sledesm commented Sep 13, 2017 via email

@sledesm
Copy link
Contributor Author

sledesm commented Sep 14, 2017 via email

@jean343
Copy link
Owner

jean343 commented Sep 14, 2017

I did not get it to work, I get an invalid parameter exception... It might be a problem with my PI.
Your stats are pretty impressive, PIes are cool!

No problem, I just did push 1.6.1

JP

@jean343 jean343 closed this as completed Sep 14, 2017
@sledesm
Copy link
Contributor Author

sledesm commented Sep 14, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants