Reply
Thread Tools
Posts: 30 | Thanked: 3 times | Joined on Apr 2010
#21
Hi all,
Probably its not relevant but I am working on a project related to this. I have an application that allows users to take picture and upload it immediately. Using gstreamer works just fine but it does not have flash and one annoying thing is that before I can take picture, I have to open the lens cover and it automatically open the default software of N900, I have to close it and use my own. I wonder is there any way to disable that auto-open software and use flash in gstreamer??
Another alternative is that I can use the default software to take picture and listen to changes in 'camera' folder to get the taken picture to use in my application.
Any idea?

Last edited by lamle; 2010-04-25 at 14:32.
 

The Following User Says Thank You to lamle For This Useful Post:
Posts: 30 | Thanked: 3 times | Joined on Apr 2010
#22
Actually that the default camera software automatically opens creates lots of troubles for user, he has to close it first and open the intended software again. Anyway to disable it temporary when we open a particular software??
 

The Following User Says Thank You to lamle For This Useful Post:
Posts: 391 | Thanked: 908 times | Joined on Aug 2011 @ suncity
#23
Hi Community!

I had some time to learn programming on my own; I like it, and I made a little script that I wanted to share. Please keep in mind, that I’m not a programmer at all, this is just my hobby.

I know that there are time lapse apps for n900, but I wanted to make my own, so I wrote a little script in python. Keep in mind, that this app represents my personal needs; but hey, you can modify the source code in any level, in any detail! I know that the code is probably not that beautiful, but this is my first bigger app with UI.

The program itself:
1. It has a capturing window where you can take pictures with the desired settings; and
2. a converter window, where you can make the time lapse movie. It is working with any jpg pictures in any directory, so if you copy that part of the code to another file, you can make a standalone converter app.

1. The capturing window:

On the left side you can specify the capturing, on the right side there is the viewfinder.
The buttons from left to right, top to bottom:
- “Select device”: you can specify whether you would like to use the front camera or the back camera.
- “Counter”: you can specify the number of picture you would like to be taken. If this is not set, the capturing goes “forever”. When capturing, it is also counting the number of pictures that were taken, eg. if 3 is set as max, then 3 / 1, 3 / 2, etc. If max reached, it stops.
- “Viewfinder”: you can turn the viewfinder on or off. IMPORTANT!!! if you would like to turn the viewfinder off, you have to click the button (it will say “Viewing stopped”), and then turn mplayer off in the terminal manually (press “q”). You can add an extra button to do this of course.
- “Automatic”: this captures the images within the predefined time intervals you specified with “Select framerate” button. If a maximum number was set with counter, then it stops when that number is reached; if not, then it goes “forever”. Of course you can stop it with hitting the button again; then it stops capturing.
The pictures are taken with the resolution of 640x480 (front camera) and 800x480 (back camera). You can edit this in the source code or make another button for it to be able to specify any other resolution. But keep in mind that taking pictures in higher resolutions is taking more time.
To make the viewing and capturing possible, the viewfinder is turning off when picture is taken, and then it turns on again.
First I added a countdown button to know when it is taking the pictures, but it is efficient only when the pictures are taken with another method, but for that method the viewfinder had to be off all the time, so I removed it.
Now the countdown button is not set, because I found that there is sometimes a +- 1 second difference to the time interval, maybe because of the tracker.
- “Select framerate”: you can specify the time interval (seconds) of picture-taking. Minimum is 4, maximum is 30 seconds, but you can extend it in the source code, or simply replace the picker button with entry widget.
Due to the capturing method you won’t be able to set the minimum lower, because the commands have to be executed (turn the viewfinder off, take the picture, and turn the viewfinder on) and this needs time…
There is the other capturing method I wrote first though; in that way you would be able to capture pictures in every 1, 2, or 3 seconds too, but in that way the viewfinder have to be off completely.
- “Manual”: you can capture pictures by hand, just click the button. The counting of taken pictures is working too.
- “Save as…”: you can specify the folder and the filename of the pictures. The pictures are saved in time format, so the specified filename will be showed before the time tag. Eg. If the filename is “test”, then the name of the saved file will be “test20141217_101543.jpg”
- “PyTimelapseMaker”: opens another window with the video maker.

2. Converter window:

The buttons from left to right, top to bottom:
- “Select folder”: you can specify the folder where the jpg files are. Keep in mind that all of the jpg files will be in the movie. If the folder doesn’t contain any jpg files, a message will be shown.
- “Save as”: you can specify folder and filename. The saved movie will be in avi format, no matter of the name you specify (eg. test.mp4). If you would like to use another format, you have to edit the source code (the converter command).
- “Select framerate”: you can specify the frame rate of the movie; 1 picture is the minimum, 30 pictures are the maximum (per second of course).
- “Select scale”: you can specify whether you would like to use 400x240 or 800x480. You can edit this too in the source code if you would like to extend it. But keep in mind that if the pictures are in low resolution, they won’t be better if you choose higher resolution…
- “Convert”: when everything is set, it creates the movie. There is no progress bar, the button will be “on” during the conversion. When its “light” turns off, the conversion is done.
- “Playback”: you can watch the last movie made. There is no option to select any movie, you have to use a player for that, but the last movie can be watched. If you would like to be able to choose any movie, you have to edit the source code and connect that option to the button.

As you can see, this is quite simple; I just wanted to have a user interface for the commands, so I wouldn’t have to write everything in the terminal every time.

To use the app, you have to install a mplayer that contains mencoder; so you have to compile one yourself, or use the one I’m using. Also you have to install gstreamer-tools to have gst-launch.

Please test it and feel free to tell me your impressions about it.

Cheers,
jm
Attached Images
  
Attached Files
File Type: zip pytimelapse.zip (2.9 KB, 77 views)

Last edited by justmemory; 2014-12-18 at 08:07.
 

The Following 5 Users Say Thank You to justmemory For This Useful Post:
nokiabot's Avatar
Posts: 1,974 | Thanked: 1,834 times | Joined on Mar 2013 @ india
#24
Nice but why not a new thread insted as the avove post would get burried soon ?
 

The Following 2 Users Say Thank You to nokiabot For This Useful Post:
Posts: 391 | Thanked: 908 times | Joined on Aug 2011 @ suncity
#25
Originally Posted by nokiabot View Post
Nice but why not a new thread insted as the avove post would get burried soon ?
yes, I was thinking about a thread, but I was too shy... I thought this is not a big deal, not a real application or something, just a script...

EDIT: I was thinking and nokiabot was right so I opened a thread for this; and a little bit more perhaps. Please go there.

Last edited by justmemory; 2014-12-18 at 08:49.
 

The Following 4 Users Say Thank You to justmemory For This Useful Post:
jellyroll's Avatar
Posts: 435 | Thanked: 684 times | Joined on Apr 2012 @ Netherlands 020
#26
Originally Posted by lamle View Post
Hi all,
Probably its not relevant but I am working on a project related to this. I have an application that allows users to take picture and upload it immediately. Using gstreamer works just fine but it does not have flash and one annoying thing is that before I can take picture, I have to open the lens cover and it automatically open the default software of N900, I have to close it and use my own. I wonder is there any way to disable that auto-open software and use flash in gstreamer??
Another alternative is that I can use the default software to take picture and listen to changes in 'camera' folder to get the taken picture to use in my application.
Any idea?
It's possible to disable 'auto-open software' or load a custom script by opening the lens cover.
Just take look at the wiki phone controle page or use the camera lens launcher plugin as an example.
 
Reply


 
Forum Jump


All times are GMT. The time now is 02:16.