Skip to content

failed to initialize camera on windows desktop #120267

Closed

Description

@yasar-salim

i have installed Camera Windows Plugin and used the code example provided in the example section. But when i ran the project and clicked create camera button it shows failed to initialize camera error(PlatformException(camera_error, Failed to initialize video preview, null, null)). I am using an external usb camera which is working fine with other applications.

i am attaching the screenshots of the same

camera

failed

prints

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Feb 8, 2023
  2. huycozy commented on Feb 8, 2023

    @huycozy
    Member

    Hi @yasar-salim
    It works as expected from my end as below demo video.

    bandicam.2023-02-08.16-36-03-198.mp4

    Does the issue happen when running with camera windows sample code? If so, please provide the complete output of flutter run -v so that we can verify it.

    Also, please provide the output of flutter doctor -v as well. Thanks!

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 8, 2023
  4. yasar-salim commented on Feb 8, 2023

    @yasar-salim
    Author

    @huycozy yes camera windows sample code. checked now on a laptop working fine with built in camera.

    flutter: PlatformException(camera_error, Failed to initialize video preview, null, null)

    the above error is getting when clicking create camera button on both desktop and laptop(usb camera)

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 8, 2023
  6. huycozy commented on Feb 8, 2023

    @huycozy
    Member

    @yasar-salim Is there any remaining log from stackstrace that you can provide to us? Or does it only have PlatformException?

    Also, can you still interact with the app? Does it have any wrong behavior, like freezing?

  7. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 8, 2023
  8. yasar-salim commented on Feb 8, 2023

    @yasar-salim
    Author

    @huycozy app works perfectly and this is the only error i am getting. I used droid cam as another camera source and i can switch to that and can take picture

  9. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 8, 2023
  10. huycozy commented on Feb 9, 2023

    @huycozy
    Member

    @yasar-salim Unfortunately, my PC has only one external USB camera (as you see from my above demo), it doesn't have a built-in camera so I can not verify this.

    But I see there's an open issue addressing the case you described #103897. It seems to be a similar issue, its log is not exactly the same, though. You can take a look at that issue and check all findings there.

    In case it's different than this issue. Can you share your affected camera specs? (model). Please also provide the complete output of flutter run -v and the pubspec.lock file content (which contains camera_windows version there).

  11. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 9, 2023
  12. github-actions commented on Mar 2, 2023

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  13. github-actions commented on Mar 16, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions