Active Topics

 


Reply
Thread Tools
Posts: 81 | Thanked: 45 times | Joined on Dec 2009
#1
Hi all,

I have written a new application gmeasure that allows measuring distances in photographs. It is available in source from:

https://github.com/dov/gmeasure

I would very much appreciate with help on the following issues:

* Creation of infrastructure for a debian package.
* An icon.
* Currently the package compiles with scons, but perhaps it would make sense to translate it into autoconf.
* How do I programitically take an image snapshot, i.e. show a live video of the camera, and then snap it when the camera button is pressed?

Any other comments are welcome!
Thanks!
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#2
Originally Posted by dov View Post
* How do I programitically take an image snapshot, i.e. show a live video of the camera, and then snap it when the camera button is pressed?
gstreamer + camerabin
or gdigicam if you need a higher level api.

Here is some python code which uses gstreamer and camerabin.
It should be easy t o translate this to c:

PHP Code:

import gst
bin 
gst.element_factory_make("camerabin")
bin.set_property("videoenc"gst.element_factory_make("dspmp4venc"))
bin.set_property("videomux"gst.element_factory_make("hantromp4mux"))
bin.set_property("audioenc"gst.element_factory_make("nokiaaacenc"))
bin.set_state(gst.STATE_PLAYING)
bin.set_property("filename""test.mp4")
bin.set_property("mode",1)
#starts recording
bin.emit("user-start")

# wait some time

# stops recording
bin.emit("user-stop")
bin.set_state(gst.STATE_PAUSED)
bin.set_state(gst.STATE_NULL
(this takes a video not an image but the overall workflow
is the same)

Using the camera button is difficult. If you have the stock camera-ui,
everytime you push the camerabutton and the lenscover
is open, it will launch the stock camera-ui.
Better use a GUI-button in your UI
 

The Following User Says Thank You to nicolai For This Useful Post:
Posts: 81 | Thanked: 45 times | Joined on Dec 2009
#3
Thanks again for your help, Nicolai.

I did some progress with camerabin, but then I got stuck. Here is what happened:

1. On the desktop I can view video from the videotest and I can save it in a file by doing:

PHP Code:
g_object_set(camerabin,"filename","foo.jpg",NULL);
g_signal_emit_by_name(camerabin"capture-start"); 
2. On the N900 I see the livevideo when I use the default video-source. But "capture-start" does not work. No image is recorded. Why? How can I debug this?

Another related question, is it possible to focus the camera through camerabin, or does that require gdigicam?
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#4
"user-start" not "capture-start" even for capturing.
This is what gdigicam-camerabin does:
Code:
g_object_set (bin, "filename", helper->file_path, NULL);
TSTAMP (before-gst-capture);
g_signal_emit_by_name (bin, "user-start", 0);
g_signal_emit_by_name (bin, "user-stop", 0);

Nicolai
 
Posts: 81 | Thanked: 45 times | Joined on Dec 2009
#5
Thanks! I'll test that tonight.

Regarding focusing, do you know how to focus the camera?
 
Reply


 
Forum Jump


All times are GMT. The time now is 18:23.