photocon

Rating: 
5
Your rating: None Average: 5 (6 votes)

Console tool for SFOS to take a picture with front or back camera.

Get help with --help or -h.

 

Example to take a picture with the front camera:

photocon cam=2

Pictures get saved as:

/home/nemo/Pictures/IMG_xxxxxxxx.jpg

Take a focused picture with back(primary) camera, Version 0.0.2 (3.1.0.12):

photocon cam=1 --focus

Take an one minute video:

photocon cam=1 path=/home/nemo/Videos/test.mp4 time=60 --video

To take a series of 10 photos with a delay of 2 seconds

photocon cam=1 delay=2 count=10

To take a series of 5 photos as fast as possible to a custom path with other resolution

photocon cam=1 count=5 path=/tmp/picname res=800x480

Screenshots: 
Application versions: 
AttachmentSizeDate
File photocon-0.0.1-1.armv7hl.rpm14.49 KB21/10/2019 - 23:55
File photocon-0.0.2-1.armv7hl.rpm14.16 KB22/10/2019 - 23:05
File photocon-0.0.3-1.armv7hl.rpm17.09 KB27/10/2019 - 22:00
File photocon-0.1.0-1.armv7hl.rpm23.85 KB07/04/2021 - 17:15
File photocon-0.1.1-1.armv7hl.rpm24.74 KB12/09/2021 - 18:22
File photocon-0.1.1-1.i486.rpm27.96 KB12/09/2021 - 18:22
File photocon-0.1.1-1.aarch64.rpm25.04 KB12/09/2021 - 18:22
File photocon-0.1.2-1.armv7hl.rpm25.63 KB16/09/2021 - 21:05
File photocon-0.1.2-1.i486.rpm28.92 KB16/09/2021 - 21:05
File photocon-0.1.2-1.aarch64.rpm25.93 KB16/09/2021 - 21:05
Changelog: 

* Thu Sep 16 2021 Halftux 0.1.2-1
- added supported resolution option
- made delay default to 0
- fixed custom path when focused
- fixed custom path with delay
- compiled with 3.4.0.24

* Sun Sep 12 2021 Halftux 0.1.1-1
- added custom image path
- compiled with 3.4.0.24

* Tue Apr 06 2021 Halftux 0.1.0-1
- added video mode
- added photo series (delay/count)
- compiled with 3.4.0.24

* Sun Oct 27 2019 Halftux 0.0.3-1
- added info mode
- added flash option
- added Focus:Failed to std out
- compiled with 3.1.0.12

* Tue Oct 22 2019 Halftux 0.0.2-1
- changed to primary and secondary
- manual focus switch
- compiled with 3.1.0.12

* Mon Oct 21 2019 Halftux 0.0.1-1
- Initial release
- compiled with 2.2.1.18

Comments

arsh0r's picture

Thanks. Now I have a use for my old devices that are stuck at android4. I used it to "broadcast" (from differen angles) a LAN party for the ones joining via VPN.

halftux's picture

Nice I am glad that it could be of help for you. But you could also think about using gstreamer gst-launch to create a network stream from the camera. Just an idea. Happy gaming.

arsh0r's picture

Nice, Thanks. Is scaling of the images also possible? Calling Imagemagick after taking an image takes additional time. After all the cameras of SailfishOS devices aren't that good after all.

halftux's picture

Yes it is possible. Made a new version there you could specify different resolutions with res=800x480.

The supported resolutions for a specific camera could be found by running "photocon cam=1 -i" for example.

arsh0r's picture

Could you make the output path for images configurable via commandline, please? I wanted them to be saved at /tmp to upload them via script. Or did you publish the source code somewhere?

halftux's picture

Now you could add for example path=/tmp/photo it will automatically add .jpg. When you have a series it will add the count number too.

sashikknox's picture

Nice tool, not test it.yet, but.good idea!

ezameht's picture

Thank you so much for the Update!

halftux's picture

You are welcome.

ekari's picture

Hey, thanks for this! Seems to be working fine on my XperiaXA2 with SailfishOS 3.4.0.24. It outputs some warnings, but images are captured ok.

halftux's picture

No problem, thanks for reporting.

ezameht's picture

Is there a way to automatically take a picture every x seconds?
And are there any plans for a videocon-app?
Thanks again for photocon!

szopin's picture

You could use 'watch -n (seconds) photocon' for this and just run the photocon repeatedly this way, or does it expect user input?

halftux's picture

There is no user input. This should work you could only run into problems below one second, when the delay is not long enough to take a picture.

Or something like focusing once and then take many pictures as fast as possible would not work.

halftux's picture

At the moment this option is not available, will think about it for next release.

A videocon app is not planned, when I am bored and have time I could give a try, but don't count on it.

You are welcome and thx for feedback.

ezameht's picture

The console shows an error, but the picture is taken:

,---
| Sailfish OS 3.1.0.11 (Seitseminen)
'---
[nemo@Sailfish ~]$ photocon flash=off --focus
[W] unknown:0 - Starting camera without viewfinder available

(photocon:17007): GStreamer-CRITICAL **: 19:30:21.116: Registering meta implementation 'NemoGstBufferOrientationMeta' without init function
[D] unknown:0 - Focusing...
Captured:/home/nemo/Pictures/IMG_00000003.jpg

halftux's picture

Yes the error is normal. I am guessing it is because the camera is started without a viewfinder and the application has no orientation gestreamer throws an error. I think qcamera was not to be meant to be used in a none gui application. I wanted to make a dummy viewfinder which is not shown, but for SFOS there are no multimedawidgets.

ezameht's picture

thanks! Works great.

halftux's picture

Thats nice btw on which device and which OS version?

ezameht's picture

XA2 Plus on 3.1.0.11

ezameht's picture

How to disable flash?

halftux's picture

It looks like you don't have the latest version installed :p.

Please download the new uploaded version 0.0.3 and there you could disable the flash by setting the option "flash=off".

Mick's picture

Getting same results with this update.
Maybe it's because I'm using Sony Xperia X. I'll give it a go with my Jolla 1 sometime.

halftux's picture

Yeah would be nice to know if front camera is working. For me Jolla 1 on 3.1.0.11 only back camera is working, but also stock camera software can't open front camera (maybe hardware fault).

And Jolla C on 3.0.0.8 everything is working as it should.

Mick's picture

Gave it a test on 3.1.0.11, but getting varied results and terminal displays:-

[nemo@Sailfish ~]$ photocon cam=1
[W] unknown:0 - Starting camera without viewfinder av
ailable

(photocon:18722): GStreamer-CRITICAL **: 23:20:30.218
: Registering meta implementation 'NemoGstBufferOrien
tationMeta' without init function
[D] unknown:0 - Focusing...
[nemo@Sailfish ~]$.

halftux's picture

Thanks for report. Tried with Jolla on 3.0.3.10 compiled with newer sdk and it is also not working. Don't know which version will break/change qcamera and atm I have no fix.

halftux's picture

Released a new version at least the primary camera should work for SF>3.