【问题标题】:Python - gphoto2: how to capture image Canon 5D Mark IVPython - gphoto2:如何捕捉佳能 5D Mark IV 的图像
【发布时间】:2019-04-19 23:13:51
【问题描述】:

我正在使用 gphoto2 从相机中捕捉照片

到目前为止,我可以使用命令行成功拍摄照片

command = ["sudo","gphoto2","--set-config","manualfocusdrive=6","--set-config","capturetarget=1","--capture-image"]
call(command)

但是,我无法使用 python 代码(来自example)拍摄照片

错误:

> WARNING: gphoto2: (gp_port_usb_close [libusb.c:325]) Invalid
> parameters: 'port && port->pl->dh' is NULL/FALSE. Capturing image
> Camera file path: //capt0000.jpg ('Copying image to',
> '/tmp/capt0000.jpg') Error: no "view" rule for type "image/jpeg"
> passed its test case
>        (for more information, add "--debug=1" on the command line) /usr/bin/xdg-open: 771: /usr/bin/xdg-open: www-browser: not found
> /usr/bin/xdg-open: 771: /usr/bin/xdg-open: links2: not found
> /usr/bin/xdg-open: 771: /usr/bin/xdg-open: elinks: not found
> /usr/bin/xdg-open: 771: /usr/bin/xdg-open: links: not found
> /usr/bin/xdg-open: 771: /usr/bin/xdg-open: lynx: not found
> /usr/bin/xdg-open: 771: /usr/bin/xdg-open: w3m: not found xdg-open: no
> method available for opening '/tmp/capt0000.jpg' WARNING: gphoto2:
> (ptp_usb_getresp [usb.c:482]) PTP_OC 0x911c receiving resp failed: PTP
> Device Busy (0x2019) WARNING: gphoto2:
> (camera_unprepare_canon_eos_capture [config.c:557])
> 'ptp_canon_eos_resetuilock (params)' failed: PTP Device Busy (0x2019)
> WARNING: gphoto2: (gp_port_usb_close [libusb.c:325]) Invalid
> parameters: 'port && port->pl->dh' is NULL/FALSE.

感谢任何建议。我对这个 gphoto2 很陌生。

【问题讨论】:

    标签: python libgphoto2


    【解决方案1】:

    脚本失败,因为“xdg-open”找不到照片查看器。您应该在“/tmp/capt0000.jpg”中有一张捕获的照片。

    警告消息是典型的 libgphoto2 冗长,可以忽略。

    【讨论】:

    • 这意味着 capt0000.jpg 没有存储在目录 /tmp/ 中。我需要配置任何使其工作吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-04
    • 1970-01-01
    • 2019-10-24
    • 1970-01-01
    • 2011-07-10
    • 1970-01-01
    相关资源
    最近更新 更多