|
| 1 | +Camera4Kivy Photo Example |
| 2 | +========================= |
| 3 | + |
| 4 | +*Just Basic Camera Stuff, but you gotta start somewhere.* |
| 5 | + |
| 6 | +# Overview |
| 7 | + |
| 8 | +Four screens showing camera orientation, aspect ratio, and image capture. On Android `orientation = all` is available, on the desktop change the window size to change the window from landscape to portrait to simulate rotating a mobile device. |
| 9 | + |
| 10 | +This example depends on Camera4Kivy. **[Read about Camera4Kivy](https://github.com/Android-for-Python/Camera4Kivy#camera4kivy)** because, depending on the platform you may need to install a [camera provider](https://github.com/Android-for-Python/Camera4Kivy#dependencies). |
| 11 | + |
| 12 | +Available on the [usual platforms](https://github.com/Android-for-Python/Camera4Kivy/#tested-platforms). |
| 13 | + |
| 14 | +# Install |
| 15 | + |
| 16 | +Assuming you have installed a camera provider (if necessary): |
| 17 | + |
| 18 | +## Windows, MacOS, Linux |
| 19 | + |
| 20 | +`pip3 install camera4kivy` |
| 21 | + |
| 22 | +## Android |
| 23 | + |
| 24 | +Camera4Kivy depends on the 'master' version of Buildozer. Currently `1.2.0.dev0` |
| 25 | + |
| 26 | +`pip3 install git+https://github.com/kivy/buildozer.git` |
| 27 | + |
| 28 | +The example includes a camera provider and a buildozer.spec |
| 29 | + |
| 30 | +For any other project, follow the [camerax_provider install instructions](https://github.com/Android-for-Python/Camera4Kivy#candroid-camerax_provider) |
| 31 | + |
| 32 | +And the following **must** be in the buildozer.spec: |
| 33 | + |
| 34 | +`requirements= python3, kivy, camera4kivy` |
| 35 | + |
| 36 | +`android.permissions = CAMERA, RECORD_AUDIO` |
| 37 | + |
| 38 | +`android.api = 30` or greater (min 29) |
| 39 | + |
| 40 | +`p4a.local_recipes = ./camerax_provider/recipes` |
| 41 | + |
| 42 | +`p4a.hook = ./camerax_provider/gradle_options.py` |
| 43 | + |
| 44 | +# Other Stuff |
| 45 | + |
| 46 | +The example demonstrates Preview Widget layout: orientation, aspect ratio, and letterbox handling. Also switching between cameras, image capture, and screenshot capture. On Android only it demonstrates video with audio capture, pinch/spread zoom, and tap focus/exposure. |
| 47 | + |
| 48 | +A prerequisite is a working camera is installed and seen as device '0'. Test this with the platform's camera app before proceeding. Optionally a second camera '1' may be selected in the app. |
| 49 | + |
0 commit comments