live view -> Capture in time
Tilman <[email protected]>
| Newsgroups | gmane.comp.multimedia.gphoto.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Guys,
i need your help.
I try to make live view for few second and capture a picture just in time,
at the end.
My Problem. The camera (canon Eos 550d) need round about 2 seconds to
capture.
Have anyone ideas how can i implement it?
Thanks for your help!
My code:
-------
class camera(object):
def __init__(self):
logging.basicConfig(format='%(levelname)s:%(name)s:%(message)s',
level=logging.WARNING)
gp.check_result(gp.use_python_logging())
self.camera = gp.check_result(gp.gp_camera_new())
gp.check_result(gp.gp_camera_init(self.camera))
def get_camera(self):
return self.kamera
def capture(self):
bild_path = gp.check_result(gp.gp_camera_capture(self.camera,
gp.GP_CAPTURE_IMAGE))
kamera_file = gp.check_result(
gp.gp_camera_file_get(self.kamera, bild_path.folder,
bild_path.name, gp.GP_FILE_TYPE_NORMAL))
target = os.path.join('/tmp', bild_path.name)
gp.check_result(gp.gp_file_save(kamera_file, target))
# print(str(target))
return Image.open(target)
def statuscamera(self):
return True
def startLiveView(self):
self.camera_file =
gp.check_result(gp.gp_camera_capture_preview(self.camera))
file_data =
gp.check_result(gp.gp_file_get_data_and_size(self.camera_file))
# display image
data = memoryview(file_data)
image = Image.open(io.BytesIO(file_data))
# self.lastPicture=image
return image
def killStream(self):
gp.gp_camera_exit(self.camera)
cameraObject = camera()
i=10
while i<1:
cameraObject.startLiveView()
i=i-1
cameraObject.capture()
--
Sent from: http://gphoto-software.10949.n7.nabble.com/gphoto-user-f3.html
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot