jnissi / camcam Goto Github PK
View Code? Open in Web Editor NEWCamcam camera for Pinephone Phosh
License: MIT License
Camcam camera for Pinephone Phosh
License: MIT License
Provide a camera switch button and switch between cameras when pressed.
Capture debayer is just stupid averaging per rgb channel over the entire image. Almost passable in bright daylight, horrible blots of noise in dark.
This is a solved problem, so selecting and implementing a better algorithm might be in order. Then again I want to play around with the code as well to see what I can whip up. 🤷
Starting the preview takes almost 10 seconds. I've come to understand this is because of the autofocus initialization in the back sensor driver.
I managed to get the preview start down to ~300ms by unlinking the back camera and linking the front camera before asking for the v4l device. For some reason this only worked until the next reboot and now asking for the back camera on preview start takes ~9s. But at least I now know a vast improvement is possible.
Currently there is no easy installation package for any Pinephone distribution.
Given the shape of the app currently I don't yet want anyone who doesn't know how to cross-compile Rust for aarch64 to touch it with a ten foot pole.
When I get #3 done and #8 and #6 fixed I might consider packaging for Manjaro.
Trying to capture an image after the phone is rebooted seems to crash the app. It seems like setting the capture interval to 1/15 before setting the capture resolution (5Mpix) fails and setting the resolution fails because it's not supported on 1/30 interval.
For some reason starting and closing Megapixels once fixes this and the captures work again until reboot. Probably needs setting some control on the subdevice to some non-default value.
To save everyone some time, I'll put this here from the start.
I'll track general code cleanup with this ticket.
At least rotation (orientation) exif info would be nice. Would probably show the images in image viewers the right way up.
This needs a little bit of thought.
For cross compilation, install cargo cross
, build a docker image for the cross compilation with instructions from cross-rs/cross#517 and richardanaya/pinephone-gtk-rs-starter#4
I needed these on top of Ubuntu 20.04 cargo cross image:
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install --assume-yes libgtk-3-dev:arm64 x11proto-dev:arm64 libssl-dev:arm64 libasound2-dev:arm64 libpulse-dev:arm64 -o APT::Immediate-Configure=0 && \
apt-get install -y clang libclang-3.9-dev libc6-dev-i386 gcc-aarch64-linux-gnu && \
apt-get clean -y
ENV PKG_CONFIG_LIBDIR=/usr/local/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig/
ENV PKG_CONFIG_ALLOW_CROSS=1
When the docker image is built change the image name in Cross.toml
and do
cross build --target aarch64-unknown-linux-gnu --release
and copy target/aarch64-unknown-linux-gnu/release/camcam to the phone.
App works pretty well when orientation is locked to portrait, but when not locked the preview is all over the place and UI layout breaks in other interesting ways.
This seems to be consistent with Megapixels problem n.o 38 https://todo.sr.ht/~martijnbraam/Megapixels/38 , so might be a driver bug. Captured image/preview is blue and stretched when first starting the app after a reboot of the phone. Kill the app and try again and the image is normal.
🤣 I was happy with one image file overwritten over and over again while testing, but that isn't exactly good UX on a camera app.
Maybe generate something like Camcam-yyyy-MM-dd-HH-mm-ss.jpg
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.