Re: Live view on Canon EOS M50
Antonio Cuni <[email protected]> Sun, 17 May 2020 21:05:44 +0200
| Newsgroups | gmane.comp.multimedia.gphoto.user |
|---|---|
| Message-ID | <CAHPg78zD6gsBMQqCbBdWF1dC=5=LCrKuVjQ9kyT72TR3vcPreA@mail.gmail.com> |
Hello Marcus,
thanks to your input, I am making some progress.
> We have decoded more values for "output" in the meantime (in libgphoto2
2.5.23 or later):
>
> { N_("Off"), 0, 0 }, /*On 5DM3, LCD/TFT is off, mirror
down and optical view finder enabled */
> { N_("TFT"), 1, 0 },
> { N_("PC"), 2, 0 },
> { N_("TFT + PC"), 3, 0 },
> { N_("MOBILE"), 4, 0 },
> { N_("TFT + MOBILE"), 5, 0 },
> { N_("PC + MOBILE"), 6, 0 },
> { N_("TFT + PC + MOBILE"), 7, 0 },
> { N_("MOBILE2"), 8, 0 },
> { N_("TFT + MOBILE2"), 9, 0 },
> { N_("PC + MOBILE2"), 10, 0 },
> { N_("TFT + PC + MOBILE2"), 11, 0 },
This is interesting: do you know what "MOBILE" and "MOBILE2" actually mean?
Anyway, I compiled gphoto2 (ae708e6) and libgphoto2 (ed6a19059) from git:
$ LD_LIBRARY_PATH=/usr/local/lib/ gphoto2 --version
gphoto2 2.5.23.1
[...]
This version of gphoto2 is using the following software versions and
options:
gphoto2 2.5.23.1 gcc, popt(m), exif, cdk, no aa, jpeg,
readline
libgphoto2 2.5.24.1 standard camlibs (SKIPPING lumix), gcc,
ltdl, EXIF
libgphoto2_port 0.12.0 iolibs: disk ptpip serial usb usbdiskdirect
usbscsi, gcc, ltdl, EXIF, USB, serial without locking
The first weird thing which I noticed is that now gphoto is VERY slow at
establishing a connection with my camera (via usb): before it took 0.16
seconds, now it takes 24 seconds 😱:
$ time gphoto2 --auto-detect # stock ubuntu
Model Port
----------------------------------------------------------
Canon EOS M50 usb:005,014
0.07user 0.08system 0:00.16elapsed 97%CPU (0avgtext+0avgdata
13416maxresident)k
0inputs+0outputs (0major+3315minor)pagefaults 0swaps
$ LD_LIBRARY_PATH=/usr/local/lib/ time gphoto2 --auto-detect # compiled
from git
Model Port
----------------------------------------------------------
Canon EOS M50 usb:005,014
0.05user 0.07system 0:24.08elapsed 0%CPU (0avgtext+0avgdata
11288maxresident)k
280inputs+0outputs (4major+2637minor)pagefaults 0swaps
I can see this ~25s delay with every gphoto2 command which connects to the
camera, including --config, --capture-movie, etc.. I have no idea what
causes it.
Then, I tried various values of "output" on this command line, as you
suggested, but none of them seems to work:
gphoto2 --capture-preview --set-config output="TFT + MOBILE2"
--capture-movie --stdout
gphoto2 --capture-preview --set-config output="TFT + PC"
--capture-movie --stdout
But I didn't manage to make it working, the LCD continues to turn off.
On reading the source, capture-preview/capture-movie was currently always
> setting
> it back to 2 (PC), if it was not 2 (PC).
I tried to look at recent git commits but I didn't find anything related to
that. Is it possible that you forgot to push?
Anyway, I dug a bit in the code and I think I found the relevant line: is
it this one?
https://github.com/gphoto/libgphoto2/blob/master/camlibs/ptp2/library.c#L3043
I tried to change the hard-coded "2" into "3" (which should mean "TFT +
PC"), and it actually worked!
Now I can see the preview both on the LCD and on my PC, and I can even
change the settings from the camera during the preview; however, as soon as
I take a picture gphoto2 stops/crashes, but maybe this is expected? (Well,
I suppose the stop could be expected, but the segfault not :)):
$ LD_LIBRARY_PATH=/usr/local/lib/ gphoto2 --capture-movie --stdout |
~/pypy/misc/gphoto2-liveview-example/gphoto2-liveview-example
Capturing preview frames as movie to 'stdout'. Press Ctrl-C to abort.
#... worked well for a while, then I released the shutter
ERROR: Movie capture error... Exiting.
Movie capture finished (971 frames)
Segmentation fault
In case it might be useful to anybody, there is the patch which I applied:
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index f7bd5b172..605c82069 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -3038,9 +3038,9 @@ camera_capture_preview (Camera *camera, CameraFile
*file, GPContext *context)
ptp_free_devicepropdesc (&dpd);
/* do not set it everytime, it will cause delays */
ret = ptp_canon_eos_getdevicepropdesc (params,
PTP_DPC_CANON_EOS_EVFOutputDevice, &dpd);
- if ((ret == PTP_RC_OK) && (dpd.CurrentValue.u32 !=
2)) {
+ if ((ret == PTP_RC_OK) && (dpd.CurrentValue.u32 !=
3)) { // XXX antocuni
/* 2 means PC, 1 means TFT */
- val.u32 = 2;
+ val.u32 = 3; // XXX antocuni
C_PTP_MSG (ptp_canon_eos_setdevicepropvalue
(params, PTP_DPC_CANON_EOS_EVFOutputDevice, &val, PTP_DTC_UINT32),
"setval of evf outputmode to 2
failed (curval is %d)!", dpd.CurrentValue.u32);
}
ciao,
Antonio
_______________________________________________
Gphoto-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gphoto-user