CHDKPTP - Send commands during live view - General Discussion and Assistance - CHDK Forum

CHDKPTP - Send commands during live view

  • 5 Replies
  • 4893 Views
CHDKPTP - Send commands during live view
« on: 25 / February / 2016, 15:33:07 »
Advertisements
Dear CHDK-Community,

first of all a big "thank you" for CHDK as well as for chdkptp (reyalp!).

What I'm trying to do is probably trivial but I can't get around some issues:
I try to have chdkptp running in "live view" mode to stream from my SX200is. While live view I want to be able to trigger a "shoot" followed by a file transfer from the just-shooted-image to the PC ("shoot -dl").
What I want is trigger the "shoot" from my own software (just a simple frontend for a self-written non-commercial photo-booth for our wedding). So basically I want to run the chdkptp GUI for displaying the live view and send the commands from my software to chdkptp which in turn sends it to the camera.

The software is running under Windows (just a lazyness as GUI development with VB is so easy here and I'm not much of a GUI guy :-))

My ideas were:
1) Run the interactive mode and the GUI mode together and send the command to the CLI - doesn't work - no interactive mode when using the GUI
2) Use the interactive mode and use lvdumpimg to get a live view - doesn't work as the lvdumpimg (running in an endless loop, piping to ffmpeg or similar) blocks the CLI and I can't send a "shoot" while lvdumpimg is running.
3) Use the CLI mode and capture the live view from the HDMI signal, use a frame grabber and display the live view - doesn't work as live view on HDMI does not work with this camera and the composite output uses the USB port.

Is there any kind of IPC (Interprocess Communication) to control chdkptp while chdkptp shows the GUI with the live stream? Or anyone having another idea for viewing the live image and concurrently sending a command from another software to chdkptp?

Thanks a lot - I appreciate your comments and ideas!

*

Offline reyalp

  • ******
  • 14080
Re: CHDKPTP - Send commands during live view
« Reply #1 on: 25 / February / 2016, 16:02:22 »
3) Use the CLI mode and capture the live view from the HDMI signal, use a frame grabber and display the live view - doesn't work as live view on HDMI does not work with this camera and the composite output uses the USB port.
Assuming your camera supports composite out in shooting mode (many newer/cheaper ones do not, but I suspect sx200 does) it may be possible to construct a splitter: See http://www.achillies.com/CHDK_Files/USB_Splitter.htm

Quote
Is there any kind of IPC (Interprocess Communication) to control chdkptp while chdkptp shows the GUI with the live stream? Or anyone having another idea for viewing the live image and concurrently sending a command from another software to chdkptp?
There isn't currently any built in. It is on my wish list.

You could presumably send windows messages from your VB app to the chdkptp GUI window.

Another alternative would be to modify the chdkptp GUI code to get it's input from somewhere else. A very brute force approach would be to periodically check of the existence of a file, and read it for commands if present. To avoid getting partial content, you could use sequential numbers, e.g. look for cmd0000, after that is read, look for cmd0000. To run periodically, you could use the time systems used for the live view and device polling (or just stick your code in one of those functions)

You could use a similar approach with the cli and lvdumpimg

Alternately, you could write you GUI in IUP. If it's simple, modifying the chdkptp UI might not be too terrible.
Don't forget what the H stands for.

Re: CHDKPTP - Send commands during live view
« Reply #2 on: 25 / February / 2016, 16:07:56 »
What I want is trigger the "shoot" from my own software (just a simple frontend for a self-written non-commercial photo-booth for our wedding). So basically I want to run the chdkptp GUI for displaying the live view and send the commands from my software to chdkptp which in turn sends it to the camera.
I did something very similar and wrote about it here : Re: CHDKPTP based Photoboot

The code on the PC is in C but I don't believe it would be too hard to translate to VB.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: CHDKPTP - Send commands during live view
« Reply #3 on: 26 / February / 2016, 14:41:25 »
Dear reyalp and waterwingz,

thank you very much for your kind answers! I will have a look at your photobooth-project, waterwingz, first. I have a somewhat different requirement (well - my wife told me what it should look like and what it should do :)), but a first reading through your post it reminded me to take better care of the lightning - and - when I understood it right while reading it once, you just switched off the live view, issued the shoot command and then switched live view on again, which is a good idea...

reyalp: Thank you very much for your three pointers (the USB/Video-Splitter, getting the commands from somewhere else, sending windows messages from the VB-app) - gives me three new ideas to have a look at!

Enjoy the weekend!
« Last Edit: 26 / February / 2016, 14:43:31 by freddy40 »


Re: CHDKPTP - Send commands during live view
« Reply #4 on: 26 / February / 2016, 15:05:35 »
when I understood it right while reading it once, you just switched off the live view, issued the shoot command and then switched live view on again, which is a good idea...
Close. I switched off live view (which was really just a continuous sequence of polled "live images") and displayed a "count down" in the screen. 
5 ... 4  ... 3 ... 2 ... 1. 
Then the camera would shoot four shots in a row (with the shot # displayed on the screen).   Once that was one,  a "film strip" of the images was displayed.  After a timeout the system would resume live view mode.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14080
Re: CHDKPTP - Send commands during live view
« Reply #5 on: 26 / February / 2016, 16:31:58 »
@freddy40

FWIW, if you want to post a screenshot or mockup of what the photobooth GUI looks like, I might have a go at implementing it as an optional GUI module. No promises, but if it's straightforward it could be a useful addition to the extras/examples.
Don't forget what the H stands for.

 

Related Topics