[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus manipulation during live streaming video #62

Open
mfk-smart opened this issue Jun 5, 2016 · 5 comments
Open

Focus manipulation during live streaming video #62

mfk-smart opened this issue Jun 5, 2016 · 5 comments
Assignees

Comments

@mfk-smart
Copy link

Hi,

I can stream live image from my EOS camera with the following command :
gphoto2 --capture-movie --stdout | ffmpeg -i pipe:0 http://localhost:8080/feed1.ffm

Also I can do focus manipulation with the following command :
gphoto2 --set-config-index manualfocusdrive=6

Is it technically possible to do these both at the same time in Python or C by using gphoto2?

Thanks!
mfk

@rlamarche
Copy link

Hi,

I'm using libgphoto2 directly in C and by patching libgphoto2 I'm able to get live view while the camera is focusing.
I'm using a Nikon D800.

I had to patch libgphoto2 because there is an explicit "sleep" in the libgphoto2 code when you ask autofocus. I suspect that not all camera send the liveview while focusing. But in my case, it works.

@rlamarche
Copy link

here the code I updated : https://github.com/gphoto/libgphoto2/blob/master/camlibs/ptp2/config.c#L5123
It seems to be Nikon specific code.

@msmeissn msmeissn self-assigned this Aug 28, 2016
@msmeissn
Copy link
Contributor

@mfk-smart technically you can only have 1 ptp session open with the device at any point in time as there is just one usb session concept (and it uses incrementing sequence numbers, so a new one will either not work, or abort the first). So for specific work in parallel you would need a single program that handles both.

@rlamarche the sleep was there to get the result of the focusing and if the camera returns busy it might not allow other operations ... it seems it does allow some operations, so the code might need to be revisitied

@rlamarche
Copy link

Thank you for the explanation @msmeissn . Indeed I'm able to get liveview while focusing, but I don't know if any other operation is possible. Moreover I've only a Nikon D800 to test. That's why I keep it as a patch for the moment.

@smheidrich
Copy link

Hmm so this is still not possible using only gphoto2's CLI application? Does anyone know an application built on top of libgphoto2 (as mentioned by @rlamarche) that allows to send commands (not just autofocus but in general) to the camera while streaming video?
If not, would it be possible to implement this in gphoto2's CLI application, e.g. by having it listen for additional commands on a UNIX socket while streaming video? Or something like that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants