-
Notifications
You must be signed in to change notification settings - Fork 45
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
External camera support (along with front and back cameras) #20
Comments
Hi, Glad you like the project :) This is a huge work and we are not sure that that the native iOS and Android library we used does support external camera and we are not even sure that iOS and Android phone support to connect a third camera. I am curious though. How is the third camera connected? USB or Wi-Fi? What type of camera it is? |
HI @ThibaultBee Thanks for reverting! For the last part of your comment - Its just another web camera connected via OTG to the android phone. I'm able to use the camera on dedicated apps for this use case. One for example - USB Camera App I'm unsure of iOS but android does support more cameras than the native device cameras. For example - take a look at this flutter package for RTMP streaming (i used is previously in our app but it doesn't seem to be well maintained and has bugs, this is when I moved to yours, and it's been a fruitful switch). The package has a method that returns a list of all cameras (front, back, external). Probably it can be a starting point in building out this support. Will look into it. I'll look into creating a PR if I find success in trying it out. Thanks! |
Hi @ThibaultBee Here's an update from my research so far - Along with LENS_FACING_BACK & LENS_FACING_FRONT we also have - This gives us access to external cameras. For this, changes are required on your StreamPack package, which only exposes getFrontCameras and getBackCameras on LENS_FACING_FRONT & LENS_FACING_BACK respectively. If it can expose a new method getExternalCameras() based on LENS_FACING_EXTERNAL, that will do the work. I have created a fork for myself of the StreamPack package but I'm stuck at importing the fork into the flutter package (instead of the original StreamPack package). Will you entertain a PR on StreamPack? I've added one single method getExternalCameras(). Thanks! |
Nice ;) Yes, I can accept PR on StreamPack as well. |
woudl be great to also have influence on the initial orientation of the selected camera. if I switch from landscape-back to front the orientation is portrait in default. If I switch back to the back camera it is still portrait even thought it has been landscape before. |
@tibfox sorry I miss your message. As your issue is not related, please open a new issue. @abbas2501 If you use |
Any updates related to the external camera connection tried CameraPosition.other but still, it returned an exception failed to set the camera position, and the empty list in returned but the camera is connected with the phone through OTG. I was able to connect the external camera to Android native but was not able to send an external video source so it could start streaming through that external source. |
External cameras are supported via camera2 API but this have never been tested because I don't have a phone that I am not sure an Android device support external cameras via camera2. There is feature flag to check if your device supports this feature: Could you test something like that:
Then, run:
|
Thanks for the amazing package! I have a use case where I need to use a third camera (a webcam) connected to my phone (alongside the front and back cameras).
Describe the solution you'd like
Ability to switch between three cameras (or more in a loop) using the switch camera button.
The text was updated successfully, but these errors were encountered: