Thanks for the nice post and code. Re-writing just the header is OK ... so we have a backup plan in case srsa can't pull off the elegant solution.
Per my edit above, exiftool probably re-writes the whole image.
In case I have to fall back on your solution, how would that work with the new USB direct file transfer with CHDK 1.2? Does direct transfer implement file auto-numbering ? If so, that should be easy.
It can use the camera image number. Writing using some other name generated by your code (for example, based on date/time) would be easy.
) The BBB has one USB2. if I plug the camera there, can I run a version of CHDKPTP locally on its Linux, ie a Linux version?
chdkptp runs OK on raspberry pi, so it should be possible to build and run it on similar systems. However, at this point I have not put much effort optimizing it for low spec systems.
) If so, is there a way I would be able to see *just* the liveview on a PC via the LAN with a stripped down lua app on the PC? .. that is .. talk to the core BBB CHDKPTP by sending it text commands from my PC via the LAN into its conceptual "command line input" but view remotely on my PC? Sort of like CHDKPTP that has been split into a client-server ? Is some kind of arrangement like this possible? Do you understand my question ?
I understand the question, and there is currently no support for anything like this. You can of course run a remote display like X or vnc, but performance will suffer badly.
I have toyed with some idea that could support something like this. The most obvious would be to just tunnel the PTP calls over a network.
However, my time is limited and there are a lot of higher priority issues, so it's unlikely I'll implement anything like this soon.
) In that scenario, I'd need the option to save image files either to PC over the LAN, or to an SD card on the BBB. Would that be possible to do?
If you mount a network file system or sd card, chdkptp will not know the difference.