Trouble with Nikon D7000

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trouble with Nikon D7000

Elmout
Hi, 

I want make a photobooth with preview but the capture_preview make error.

I use python-gphoto2 and libgphoto2 2.5.10 and gphoto2 2.5.10

I simplify my code in this : 

context = gp.Context()
camera = gp.Camera()
camera.init(context)
camera_file = gp.check_result(gp.gp_camera_capture_preview(camera, context))
file_data = gp.check_result(gp.gp_file_get_data_and_size(camera_file))

# display image

data = memoryview(file_data)
print(type(data), len(data))
print(data[:10].tolist())
image = Image.open(io.BytesIO(file_data))
image.show()
gp.check_result(gp.gp_camera_exit(camera, context))
context2 = gp.Context()
camera2 = gp.Camera()
camera2.init(context2)
print('Capturing preview image 2')
camera_file2 = gp.gp_camera_capture_preview(camera2, context2)
file_data2 = gp.gp_file_get_data_and_size(camera_file2[1])

# display image

data2 = memoryview(file_data2[1])
print(type(data2), len(data2))
print(data2[:10].tolist())
#image2 = Image.open(io.BytesIO(file_data2[1]))
#image2.show()
gp.gp_camera_exit(camera2, context2)
return 0

But only 1 capture was made and I have the following error : 
WARNING: gphoto2: (gp_port_usb_close [libusb.c:321]) Invalid parameters: 'port && port->pl->dh' is NULL/FALSE.
Checking camera config
Capturing preview image
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving resp failed: PTP Device Busy (0x2019)
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving resp failed: PTP Device Busy (0x2019)
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving resp failed: PTP Device Busy (0x2019)
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving resp failed: PTP Device Busy (0x2019)
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving resp failed: PTP Device Busy (0x2019)
15147
[255, 216, 255, 219, 0, 132, 0, 4, 6, 6]
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c2 receiving resp failed: Change Camera Mode Failed (0xa003)
WARNING: gphoto2: (gp_port_usb_close [libusb.c:321]) Invalid parameters: 'port && port->pl->dh' is NULL/FALSE.
Capturing preview image 2
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x9201 receiving resp failed: PTP Device Busy (0x2019)
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x9203 receiving resp failed: Not in Liveview (0xa00b)
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x9201 receiving resp failed: PTP Device Busy (0x2019)
WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x9203 receiving resp failed: Not in Liveview (0xa00b)

What I am doing wrong ?
Can you help me ?

Thank you !


------------------------------------------------------------------------------

_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with Nikon D7000

Marcus Meissner-4
Hi,

The first phase worked nicely. Then the camera was closed and reopened, but
the camera was busy / did not enter live view mode.

Can you avoid exiting the camera?

Perhaps polling events briefly might help?

Ciao, Marcus
On Sat, Aug 20, 2016 at 04:08:49PM +0200, Sylvain LEROUGE wrote:

> Hi,
>
> I want make a photobooth with preview but the capture_preview make error.
>
> I use python-gphoto2 and libgphoto2 2.5.10 and gphoto2 2.5.10
>
> I simplify my code in this :
>
> context = gp.Context()
> camera = gp.Camera()
> camera.init(context)
> camera_file = gp.check_result(gp.gp_camera_capture_preview(camera, context))
> file_data = gp.check_result(gp.gp_file_get_data_and_size(camera_file))
> # display image
>
> data = memoryview(file_data)
> print(type(data), len(data))
> print(data[:10].tolist())
> image = Image.open(io.BytesIO(file_data))
> image.show()
> gp.check_result(gp.gp_camera_exit(camera, context))
> context2 = gp.Context()
> camera2 = gp.Camera()
> camera2.init(context2)
> print('Capturing preview image 2')
> camera_file2 = gp.gp_camera_capture_preview(camera2, context2)
> file_data2 = gp.gp_file_get_data_and_size(camera_file2[1])
> # display image
>
> data2 = memoryview(file_data2[1])
> print(type(data2), len(data2))
> print(data2[:10].tolist())
> #image2 = Image.open(io.BytesIO(file_data2[1]))
> #image2.show()
> gp.gp_camera_exit(camera2, context2)
> return 0
>
> But only 1 capture was made and I have the following error :
> WARNING: gphoto2: (gp_port_usb_close [libusb.c:321]) Invalid parameters:
> 'port && port->pl->dh' is NULL/FALSE.
> Checking camera config
> Capturing preview image
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving
> resp failed: PTP Device Busy (0x2019)
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving
> resp failed: PTP Device Busy (0x2019)
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving
> resp failed: PTP Device Busy (0x2019)
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving
> resp failed: PTP Device Busy (0x2019)
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c8 receiving
> resp failed: PTP Device Busy (0x2019)
> 15147
> [255, 216, 255, 219, 0, 132, 0, 4, 6, 6]
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x90c2 receiving
> resp failed: Change Camera Mode Failed (0xa003)

> WARNING: gphoto2: (gp_port_usb_close [libusb.c:321]) Invalid parameters:
> 'port && port->pl->dh' is NULL/FALSE.
> Capturing preview image 2
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x9201 receiving
> resp failed: PTP Device Busy (0x2019)
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x9203 receiving
> resp failed: Not in Liveview (0xa00b)
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x9201 receiving
> resp failed: PTP Device Busy (0x2019)
> WARNING: gphoto2: (ptp_usb_getresp [usb.c:438]) PTP_OC 0x9203 receiving
> resp failed: Not in Liveview (0xa00b)
>
> What I am doing wrong ?
> Can you help me ?
>
> Thank you !

> ------------------------------------------------------------------------------

> _______________________________________________
> Gphoto-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gphoto-user


------------------------------------------------------------------------------
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Loading...