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

Example of dual USB cameras? #1646

Open
xiaohua717 opened this issue Nov 21, 2024 · 2 comments
Open

Example of dual USB cameras? #1646

xiaohua717 opened this issue Nov 21, 2024 · 2 comments

Comments

@xiaohua717
Copy link

How does OpenGLView render the image of two USB cameras? I have instantiated two CameraRender in MainRender, but only one has a screen and the other is black. I don't know how to render the texId of the first CameraRender in the second CameraRender. Can you provide some guidance?

@pedroSG94
Copy link
Owner

I'm not sure about your needs. How do you expect the preview?

  • 50% screen for each camera?
  • First camera 100% screen and the second over the first camera with a lower size?

The main problem is that MainRender is designed to support only one input and multiple output but you can use a filter to provide a second input and modify the result as you need.
For example you can use SurfaceFilterRender that allow an input and then mix both input (MainRender and SurfaceFilterRender into an input).

Currently SurfaceFilterRender is designed to do this:

First camera 100% screen and the second over the first camera with a lower size

But you can modify the fragment shader to do it as you want.

@xiaohua717
Copy link
Author

Thank you for your reply.
The effect I want is the first method, where each camera occupies half of the screen. The second method is also the effect I want, which has been provided to the third camera for use.
The method I am currently using:
The first CameraRender draw method GLES20.viewPort (0,0, width/2, height);
The second CameraRender draw method GLES20.viewPort (width/2,0, width/2, height);
However, it is not yet clear how to make the texId of the first CameraRender effective in the second one.

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