Re: Getting a hook from shell mode to do motion detection?

Alan Corey <[email protected]>
Newsgroups gmane.comp.multimedia.gphoto.user
Message-ID <CAOh3dDaZ9AR2MB6V2WptGm7ZWBikL0a2v3SvQh2yhCdwUSCoow@mail.gmail.com>
Tried it again, I may have had the lens cover closed or not been in
manual mode the first time.  I do get one preview file.  I get a
confirmation request on over writing the preview file when I did it
from the command line. I was going to come up with a lock file or
semaphore arrangement and rename the previous preview file to avoid
that.

Reading UPDATE_REF 3600  // sec, -1 => never update reference (int)
Reading RESAMPLE 320     // width, -1 => no resample (int)
Reading THRESHOLD_BR 10  // brightness % change to trigger global movement (int)
Reading THRESHOLD_PX 10  // brightness % change to trigger pixel movement (int)
Reading MOVING_PIX_PER 5 // % of pixels with gray level change greater
than threshold to trigger local movement (int)
Reading FPS -2           // fps of live view, < 0 for <1 fps (-2 =>
0.5 fps) (int)
Reading NSHOTS 3         // number of shots to take after detecting
movement (int)
Reading MAX_SHOTS 1000   // maximum number of shots to take (int)
Reading EXTENSION .jpg   // extension in lowercase for the new relevant images
Reading RENAME true      // true to rename shots to 'shot_xxx.jpg',
false otherwise
Reading SERVER null      // server to uppload images
Reading USER null        // user login name
Reading PASSW null       // user password
Reading REMOTE_DIR null  // remote dir inside the server to store the
images (or null)
Reading MASK             // image mask to detect movement (- =>
masked, + => detect movement here). Any size, must be last element in
config file
Using gphoto 2.5.15 (libgphoto2 2.5.16)
Detected cameras:
Canon Powershot S70 (PTP mode) usb:001,021
Executing command: gphoto2 --camera "Canon Powershot S70 (PTP mode)"
--port usb:001,021      --get-config /main/imgsettings/iso
Executing command: gphoto2 --camera "Canon Powershot S70 (PTP mode)"
--port usb:001,021      --get-config /main/settings/capturetarget
Executing command: gphoto2 --camera "Canon Powershot S70 (PTP mode)"
--port usb:001,021      --get-config /main/imgsettings/imageformat
Executing command: gphoto2 --camera "Canon Powershot S70 (PTP mode)"
--port usb:001,021      --get-config
/main/capturesettings/shutterspeed
Executing command: gphoto2 --camera "Canon Powershot S70 (PTP mode)"
--port usb:001,021      --get-config
Possible values of ISO
50
100
200
400
Auto
Possible values of SHUTTER_SPEED
auto
bulb
bulb
30
25
20
20
15
13
10
10
8
6
6
5
4
3.2
3
2.5
2
1.6
1.5
1.3
1
0.8
0.7
0.6
0.5
0.4
0.3
0.3
1/4
1/5
1/6
1/6
1/8
1/10
1/10
1/13
1/15
1/20
1/20
1/25
1/30
1/40
1/45
1/50
1/60
1/80
1/90
1/100
1/125
1/160
1/180
1/200
1/250
1/320
1/350
1/400
1/500
1/640
1/750
1/800
1/1000
1/1250
1/1500
1/1600
1/2000
1/2500
1/3000
1/3200
1/4000
1/5000
1/6000
1/6400
1/8000
Possible values of APERTURE
implicit auto
auto
1
1.1
1.2
1.2
1.4
1.6
1.8
1.8
2
2.2
2.5
2.5
2.8
3.2
3.5
3.5
4
4.5
4.5
5
5.6
6.3
6.7
7.1
8
9
9.5
10
11
13
13
14
16
18
19
20
22
25
27
29
32
36
38
40
45
51
54
57
64
72
76
81
91
Possible values of RESOLUTION
JPEG
CRW
Possible values of CAPTURE_TARGET
Internal RAM
Memory card
Possible values of FOCUS
Possible values of VIEWFINDER
Possible values of ZOOM
1
5
Possible values of ZOOM_POSITION
Possible values of BULB
Possible values of FOCAL_LENGTH
Possible values of BATTERY_LEVEL
Possible values of NIKON_QUALITY
normal
fine
superfine
Starting live view
Entering shell (from dir /usr/src/misc/alonso/intruderDetector/): /bin/bash
Executing shell command: gphoto2 --camera "Canon Powershot S70 (PTP
mode)" --port usb:001,021      --quiet --shell

Executing shell command: set-config =1

Executing shell command: capture-preview

java.lang.NullPointerException
	at jparsec.io.device.implementation.GPhotoCamera$live.run(GPhotoCamera.java:1341)
	at java.lang.Thread.run(Thread.java:748)
Executing shell command: set-config =0

Finishing shell


On 1/5/18, Alan Corey <[email protected]> wrote:
> Interesting, I hadn't thought about Java, but I'm on a Raspberry Pi so
> the ARM chip might be reasonably fast at it.
>
> I tried it on the S70 and it looks like at some outer level it detects
> it, then says it can't initialize.  I tried it on my Nikon D5200 but
> I'm having trouble with my Nikon cable and it didn't work at all.
>
> Nice idea making the mask as characters, I wasn't sure how I was going
> to handle that.  I'm still stuck in double pointer hell but I haven't
> worked on it in a few days.
>
> upstairs# sh exec.sh
> Reading UPDATE_REF 3600  // sec, -1 => never update reference (int)
> Reading RESAMPLE 320     // width, -1 => no resample (int)
> Reading THRESHOLD_BR 10  // brightness % change to trigger global movement
> (int)
> Reading THRESHOLD_PX 10  // brightness % change to trigger pixel movement
> (int)
> Reading MOVING_PIX_PER 5 // % of pixels with gray level change greater
> than threshold to trigger local movement (int)
> Reading FPS -2           // fps of live view, < 0 for <1 fps (-2 =>
> 0.5 fps) (int)
> Reading NSHOTS 3         // number of shots to take after detecting
> movement (int)
> Reading MAX_SHOTS 1000   // maximum number of shots to take (int)
> Reading EXTENSION .jpg   // extension in lowercase for the new relevant
> images
> Reading RENAME true      // true to rename shots to 'shot_xxx.jpg',
> false otherwise
> Reading SERVER null      // server to uppload images
> Reading USER null        // user login name
> Reading PASSW null       // user password
> Reading REMOTE_DIR null  // remote dir inside the server to store the
> images (or null)
> Reading MASK             // image mask to detect movement (- =>
> masked, + => detect movement here). Any size, must be last element in
> config file
> Using gphoto 2.5.15 (libgphoto2 2.5.16)
> Detected cameras:
> Canon Powershot S70 (PTP mode) usb:001,019
> Exception in jparsec.io.device.implementation.GPhotoCamera.: The
> camera cannot be found or initialized properly.
> Please check you have gphoto2 installed, and it is in manual (M) mode.
> Turn it off/on and check again.
> jparsec.util.JPARSECException: The camera cannot be found or
> initialized properly.
> Please check you have gphoto2 installed, and it is in manual (M) mode.
> Turn it off/on and check again.
>         at
> jparsec.io.device.implementation.GPhotoCamera.<init>(GPhotoCamera.java:296)
>         at
> research.other.GPhotoMoveDetection.main(GPhotoMoveDetection.java:141)
>
>
> On 1/5/18, Tomás Alonso <[email protected]> wrote:
>> I wrote a simple, very preliminar program in Java to shot/analize
>> previews,
>>
>> detect movement and trigger shots. It has some config options to adapt it
>> to
>>
>> different cases, including to set a mask, but no GUI. I tested it
>> yesterday
>> a
>> few minutes at home with a Canon 40D and worked fine, although the
>> change from preview to shot mode and back is slow and can be improved.
>> The default values I use seems to work fine but they probably need to be
>> changed for other cases.
>>
>> In my 40D I need to set the camera to manual mode, and in manual mode I
>> set the shutter speed, iso and other properties to the adequate values to
>> get good shots. The program, at startup, reads those properties and then
>> run gphoto reseting the same values (it is by design since the gphoto
>> control
>> code is inside a main library I use for astrophoto, and the default values
>> I
>>
>> set there are very different), something that works at least with the
>> 40D.
>> There is an option to uppload the images to a server, but I didn't test
>> it.
>>
>> May work for your camera, even in some Nikons. Feel free to download and
>> try it, zip file with source (inside the .jar files) at:
>>
>> http://conga.oan.es/%7Ealonso/intruderDetector.zip
>>
>> Regards,
>> Tomas.
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gphoto-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/gphoto-user
>>
>
>
> --
> -------------
> No, I won't  call it "climate change", do you have a "reality problem"? -
> AB1JX
> Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach
>


-- 
-------------
No, I won't  call it "climate change", do you have a "reality problem"? - AB1JX
Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gphoto-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.