View Single Post
m2cm2c's Avatar
Posts: 100 | Thanked: 240 times | Joined on Feb 2010 @ The South Pole O.o
#1
Hello there,
I've put together a python script using v4l2-ctl that will enable you to change focus and turn on/off the led while filming a video.
the script works while filming video!
this is a video I took while demonstrating the script.
http://www.youtube.com/watch?v=hcSlw0xRfoI

Now with a menu widget!
now you can control the focus and LEDs from the touchscreen ,
or use the keyboard toggle button.

heres how you use the widget:
open the camera cover
Now you can access the lfocus dialog by using the proximity sensor!

or

tap the screen once
tap on the indicator bar
tap the lfocus logo
you can either scroll left and right to set focus or just press on the right side or the left side to get a smoother focus effect.
you can also adjust the leds by tapping the go down button next to the focus bar.

you can add a timer to take photos/videos by clicking the clock icon.

by tapping the go down button one more time you will access the new toggle buttons which will have the following functions:

[Rem.LED]
(remember led state when capturing)
[Stop RLED]
(auto turn off red led when capturing)
[Timer.RLED]
(timer red led blinking)


for the keyboard toggle button:
a green indicator means the keyboard control is off
a red indicator means the keyboard control is on and you should turn it off once you're done.
turning on the keyboard enables focus via zoom buttons automatically and turns off the autofocus ability!
turning on the keyboard now also turns off the red LED when you start recording video.
now you can start a timer to take photos/videos using the disabled autofocus button
to enable the timer gently double click the hardware camera button and choose the period for the timer.


as for the keyboard shortcuts:

q-w led on/off
e-r recording red light on/off
a-s change focus
d fixes the sudden focus that happens sometimes after pressing the camera button,so press d first then adjust the focus with a and s so you don't get a different focus than the one you got with the camera button.


installation and starting:

now you just need to install the latest package and you're ready to go.

Source can be found here


[Announcement]
lfocus is now up in Extras

also this will be my todo list for the upcoming versions:

  • an autofocus option
  • The built in timer should use the red flash to alert the user it's going to take the photo.
  • checkbutton with a default of off or something in the same step that you choose the timer.
  • the buttons "on" and "off" for each flash could be unified in only two "switch" buttons, "red flash status" and "main flash status"
  • the LED stays on when you actually begin recording a video
  • add python-hildon to the dependencies
  • use the proximity sensor, to pop the menu only while camera is active.
  • Might be nice to have a popup on install explaining stuff. added a help file
  • consider optification in the next release.
  • Add a checkbox to the left of the manual focus progress bar which will control the functionality of intercepting the half press.
  • Move the keyboard toggle button to the lfocus dialog.
  • Add a delay to the proximity sensor
  • Add a confirmation box to the rem.led and stop rled buttons
  • ignore proximity sensor when Camera is not on the foreground
  • ignore keyboard when Camera is not on the foreground
  • create a lfocus settings file in /home/user/.config
  • add a popup dialog only when lfocus is started showing the saved setting of the user.



[Edit]
lfocus_0.305-1
I've applied a fix that should make the application work successfully from the shortcut without any password problem
download the latest file and please test it and keep me informed
[Edit]
lfocus_0.305-2
we're now able to toggle the red recording light
[Edit]
lfocus_0.305-3
I've applied another fix for the sudden focus that happens after pressing the camera button, read the instructions at the top of the post for more info.
[Edit]
lfocus_0.305-4
I've added the ability to focus with the zoom buttons, read the instructions at the top of the post for more info
[Edit]
lfocus_0.307-1
I've added a widget that will make you control the led and the focus from the touchscreen
[Edit]
lfocus_0.308-1
I've merged the keyboard script and got rid of the application menu shortcut.
read the information at the beginning of the post for more information.
[Edit]
lfocus_0.309-1
The widget now only shows up when you open the camera cover!
the keyboard toggle now disables autofocus.
[Edit]
lfocus_0.509-1
Added dependencies to the deb package to install required packages (python-hildondesktop hildon-desktop-python-loader python-gtk2 python-dbus)
Toggling the keyboard control now automatically switches off the red LED once you start recording
[Edit]
lfocus_0.514-1
Added a timer to take photos/videos using the disabled autofocus button
read the information at the beginning of the post for more information.
[Edit]
lfocus_0.514-2
Added the timer to the widget to make it easy to take pictures/videos without using hardware buttons.
[Edit]
lfocus_0.519-1
added python-hildon to the dependencies.
[Edit]
lfocus_0.520-1
changed the widget LEDs to toggle buttons and did a small modification with the menu for future realeases.
[Edit]
lfocus_0.527-1
fixed the problem with keyboard led shortcuts not syncing with the buttons
the lfocus dialog can now be turned on by using the proximity sensor instead of tapping the screen and clicking on the logo
added a new row of toggle buttons for (remember led state when capturing)(auto turn off red led when capturing)(timer red led blinking)
please read the instructions at the top of the post for more info.
[Edit]
lfocus_0.528-1
lfocus is now optified.
[Edit]
lfocus_0.528-3
fixed led remember state button and made it always off, so it needs to be turned on by the user only when taking a video
[Edit]
lfocus_0.528-4
fixed stop RLED toggle button and made it always off, so it needs to be turned on by the user only when taking a video
[Edit]
lfocus_0.912-1
fixed typo in description
added a help button to display help for lfocus
moved the keyboard toggle button to the lfocus dialog
proximity now requires holding on for two seconds to activate the lfocus dialog
[Edit]
lfocus_0.913-1
fixed an issue with proximity
[Edit]
lfocus_0.914-1
proximity will only work if the camera is running (not on standby)
Now available in Extras-testing

Last edited by m2cm2c; 2010-09-17 at 10:23. Reason: New Version
 

The Following 152 Users Say Thank You to m2cm2c For This Useful Post:
222, Abemelek, acou, AgentZ, akaSM, Alan_Peery, Alex Atkin UK, anapospastos, AndiThebest, andraeseus1, Apoc, arjunkumar87, avinashsonee, badboyuk, berlinermaxe, bingomion, BlackDiamond, borghal, Brank, brog, cddiede, ceevee, CepiPerez, cheve, ChoMar, Chrome, cjp, clasificado, Cobra, codeMonkey, cpscotti, Crogge, Crugath, Custard! SandS, CutterSlade, cyeung, Dariu5, Darkwolf, dashti, datjomp, Deaconclgi, deter3, Dima202, dmj726, donalfitz, Dousan, eiffel, elie-7, esiravegna, ffalt, frals, ghzroy, grog, Helmuth, hesham, Hoshiro, iKneaDough, Inacurate, ioan, jdr93, John McClane, jsbigs, Kee, kevloral, lcuk, legendsohai, lennartb, locusf, lolloo, LouisLoh, maartenmk, maemo.it, mannakiosk, Marshall Banana, matristain, Metalov, michael196, mikec, mikki-kun, mmlado, mosiomm, mpi, mzanetti, n0ak, nashith, Natan_xy, neboja, neven, nkirk, NOMIOMI, nux, OranAgra, oz87, pettergoldstine, phedders, phortize, Pigro, plaban, Pretoriano, pyromaniac, qalhat, qole, qwerty12, RafaLL92, rahulg247, raily, Rammi, rcull, rebhana, rpgAmazon, sabodjaz, sachin007, santiago, Sash, saveas, SHARP66, shazosbourne, skalogre, slender, Smily, snookh, sophocha, SSLMM, stas123, steve4130, strange1712, t7g, tetris11_, thorbo, TigerTael, titan, tonypercy, torpedo48, torshind, Tstone, uhbhatti88, v13, vaibhavsharma, vdx29, vitamina, vkv.raju, vmayur_23, Wikiwide, xgrind, xiskillo, xopher, yamakasi, yinyang69_vn, yodawg, yogi900, zwer, _invisible_