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

Black rectangle instead of photo #14

Open
Tsyshnatiy-zz opened this issue Feb 19, 2015 · 1 comment
Open

Black rectangle instead of photo #14

Tsyshnatiy-zz opened this issue Feb 19, 2015 · 1 comment

Comments

@Tsyshnatiy-zz
Copy link

Hi, guys

I'm trying to use this lib for saving frames into memory.
I've changed only run method of WebcamPreview class

Bitmap bitmap = mWebcamManager.getFrame();
Canvas canvas = mHolder.lockCanvas();
if(canvas != null) {
drawOnCanvas(canvas, bitmap);
mHolder.unlockCanvasAndPost(canvas);
}
FileOutputStream out = null;
try {
out = new FileOutputStream("/storage/sdcard0/DCIM/1.png");
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (out != null) {
out.close();
}
} catch (IOException e) {
e.printStackTrace();
}

}

Also I've removed the cycle, so I get only one frame and save it.
All other things are unchanged.
I've set user to media for webcam (it is on video2, not on video0) and group camera(It was root).
crw------- media camera 81, 2 2015-02-19 22:39 video2

But I have only black rectangle 640*480 instead of the saved frame.
Maybe I've missed something?

@Tsyshnatiy-zz
Copy link
Author

Oh, forget to say - I'm trying to run example for android-webcam library.
Working on android-studio.
I suspect video frames should appear on custom view in the example, but I see nothing.

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

1 participant