chdkptp - alternative ptp client - page 63 - General Discussion and Assistance - CHDK Forum

chdkptp - alternative ptp client

  • 1106 Replies
  • 534374 Views
*

Offline reyalp

  • ******
  • 14098
Re: alternative ptp client
« Reply #620 on: 08 / April / 2014, 22:35:48 »
Advertisements
The new readline support is really useful, one doesn't have to mess with the clipboard any more.
Yes, I feel kinda bad for putting it off all these years  :-[
Quote
I'm wondering if it would be somehow possible to not request liveview data until the previous frame has arrived? The linux GUI still jams when the requested framerate is larger than what's physically possible.
I have a workaround in mind for this, just skip frames if the last frame took longer than the target frame time.

Of course it would be better if we could do the USB download while rendering the previous frame, but that's a bigger project.

On a somewhat related note, if you build the current svn with Lua 5.2, the live view continues to update while script is running, e.g. you can do
=sleep(1000)
the UI including the live view doesn't freeze until the script finishes.
Actual PTP calls (like a file download) still freeze the UI until they complete, but CLI commands that wait for script or messages yield back to the GUI. PTP commands issued by the GUI without going through the CLI system don't currently use this, but they will

This also works with rsint, but unfortunately (at least on d10) it doesn't do what you'd want. On the camera, the last image taken is shown on screen while waiting for the next shot (the same way regular continuous shooting shows you the image), but it doesn't appear on the live view. I guess the "review" buffer is different.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14098
Re: alternative ptp client
« Reply #621 on: 13 / April / 2014, 18:49:23 »
I have a workaround in mind for this, just skip frames if the last frame took longer than the target frame time.
I have implemented this in chdkptp r527. It's controlled by a "set" pref gui_live_dropframes, which defaults to true when the OS isn't windows. Windows seems to handle this situation OK as is.

Note that you will get less than the max frame rate if your target rate is too high. The "Dropped" counter in the live stats will show you if this is happening.

I suspect that letting the main GUI loop run briefly might be sufficient, rather than skipping a whole frame update, but I'm not sure how to do that and this is a lot better than locking up the UI.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: alternative ptp client
« Reply #622 on: 13 / April / 2014, 19:07:42 »
I have implemented this in chdkptp r527.
Tried it, it's working, thanks.

*

Offline reyalp

  • ******
  • 14098
Re: alternative ptp client
« Reply #623 on: 20 / April / 2014, 23:01:31 »
I've uploaded snapshot build r537 to the files area https://www.assembla.com/spaces/chdkptp/documents

All the binaries are now built with lua 5.2. They are statically linked, so you don't need to install Lua 5.2 on your system. If you have custom Lua code, it may need to be updated to be compatible, see http://www.lua.org/manual/5.2/manual.html#8 All the compile time compatibility settings are enabled, so most code will run as is.

Support for Lua 5.1 will be removed fairly near future.

The above all refers to chdkptp client side lua of course, camera side Lua remains 5.1.

Major changes
* rsint is now a standard command, and works from the GUI.
* GUI in Linux now limits frame rate to keep the UI from hanging. Live view using X over ssh from a raspberry pi on wifi is now fairly usable :haha
* The GUI now has a dropdown for camera selection. You can connect to multiple cameras and switch between them using the drop down. The UI and CLI operate on whichever camera you have selected. The dropdown keeps an up to date list of all available devices (by bus:device name only at the moment)
* The GUI now automatically updates the connection status if the camera goes away, or is connected using Lua API calls.
* The autoupdate of the camera list and connection status is controlled by gui_dev_check_interval, set it to 0 if you want to disable this behavior.

Don't forget what the H stands for.


Re: alternative ptp client
« Reply #624 on: 23 / April / 2014, 19:58:52 »
I've uploaded snapshot build r537 to the files area https://www.assembla.com/spaces/chdkptp/documents
Thank you for the update, I'm still hoping to see the the shortcut key and mirrored preview features soon   :)

*

Offline reyalp

  • ******
  • 14098
Re: alternative ptp client
« Reply #625 on: 24 / April / 2014, 00:05:56 »
I've uploaded snapshot build r537 to the files area https://www.assembla.com/spaces/chdkptp/documents
Thank you for the update, I'm still hoping to see the the shortcut key and mirrored preview features soon   :)
As I mentioned earlier, you can get mirrored preview using CD coordinate transform functions:
http://chdk.setepontos.com/index.php?topic=6231.msg110737#msg110737
Don't forget what the H stands for.

Re: alternative ptp client
« Reply #626 on: 24 / April / 2014, 01:49:52 »
As I mentioned earlier, you can get mirrored preview using CD coordinate transform functions:
http://chdk.setepontos.com/index.php?topic=6231.msg110737#msg110737
I did read that post. But I didn't understand. Ok, I'll have a closer look again, thanks.

*

Offline tpont

  • **
  • 81
Re: alternative ptp client
« Reply #627 on: 24 / April / 2014, 10:40:02 »
With rsint we can set a folder for saving a series of photos
Code: [Select]
rsint C:\a which for each subsequent "s" command outputs something like C:\a\IMG_3066.jpg , C:\a\IMG_3067.jpg , C:\a\IMG_3068.jpg ...

And we can set the name of a single image:
Code: [Select]
rsint C:\a\namewhich outputs to C:\a\name.jpg for each "s" command (overwriting the previous image)

But it would be useful to set a file name pattern with a number part that increments for each subsequent photo. Something like
Code: [Select]
rsint C:\a\{d4}Rwhere {d4} sets a four digit increment and which would output
C:\a\0001R.jpg  ,  C:\a\0002R.jpg  ,  C:\a\0003R.jpg  ,  ...

(I know I can use the sequence "rsint filepath1" and "l" and "rsint filepath2" and "l" and so on but that makes the whole cycle for each photo slower)


*

Offline reyalp

  • ******
  • 14098
Re: alternative ptp client
« Reply #628 on: 24 / April / 2014, 16:30:22 »
As I mentioned earlier, you can get mirrored preview using CD coordinate transform functions:
http://chdk.setepontos.com/index.php?topic=6231.msg110737#msg110737
I did read that post. But I didn't understand. Ok, I'll have a closer look again, thanks.
Essentially, enter this in the console (all one line), after switching to the live view tab
Code: [Select]
!width=gui.live.icnv.dccnv:GetSize();gui.live.icnv.dccnv:TransformScale(-1,1);gui.live.icnv.dccnv:TransformTranslate(-width,0)
To un-mirror the display, use
Code: [Select]
!gui.live.icnv.dccnv:Transform(nil)

Unfortunately, you can't easily make this happen at startup, because _chdkptpguirc is run before the live view is initialized.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14098
Re: alternative ptp client
« Reply #629 on: 24 / April / 2014, 16:36:36 »
But it would be useful to set a file name pattern with a number part that increments for each subsequent photo. Something like
Code: [Select]
rsint C:\a\{d4}Rwhere {d4} sets a four digit increment and which would output
C:\a\0001R.jpg  ,  C:\a\0002R.jpg  ,  C:\a\0003R.jpg  ,  ...
I plan to add support for the same kind of substitution patterns used in lvdumpimg, but I haven't got to it yet.

Quote
(I know I can use the sequence "rsint filepath1" and "l" and "rsint filepath2" and "l" and so on but that makes the whole cycle for each photo slower)
If you are triggering the s commands from another program, and can track the number yourself, you could just issue a path command between each shot instead of using l and calling rsint again. Like:

Code: [Select]
con 1> rsint
rsint> path file00
rsint> s
rc file file00.jpg 1
rsint> path file01
rsint> s
rc file file01.jpg 1
rsint> path file02
rsint> l
rc file file02.jpg 1
The path command takes negligible time.

(edit: remove incorrect =)
« Last Edit: 24 / April / 2014, 21:25:07 by reyalp »
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal