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

chdkptp - alternative ptp client

  • 1106 Replies
  • 517578 Views
*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #600 on: 15 / March / 2014, 21:45:21 »
Advertisements
It apparently means that imagemagick was compiled without JPG support (as shown by "convert -list format" and also "convert -version--no Delegates listed).  Also without PNG support.  Now I'm searching for how to add those.
That sounds right. Quite why anyone would want it jpeg support is a mystery, but assuming your linux has a package system, I would guess it's just a matter of installing libjpeg or a different variant of imagemagick.

Or as mentioned earlier you could use the netpbm tools, they include pnmtojpeg http://netpbm.sourceforge.net/doc/pnmtojpeg.html
Don't forget what the H stands for.

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #601 on: 16 / March / 2014, 09:59:39 »
Thanks for the suggestions, reyalp.  Maybe getting closer.

So I got netpbm on my dockstar with "apt-get netpbm".  "pnmtojpeg -verbose foo.ppm > foo7.jpg" works, giving the stretched image you would expect with 720x240 interpreted as square pixels.

Then I tried to change the jpg to 4x3 with "pnmtojpeg -verbose -density=4x3 foo.ppm > foo7.jpg".  This failed saying the "density" option was unknown.

The help page you linked to says that debian uses a (13+ year old) version, 9.25, which reports as 10.0.  The "density" option was provided in 10.15.  So I downloaded netpbm, did "make", which asked many questions.  Knowing no better, I took the default for each.  Then I ran "make install", which ran for a long time, but finally failed producing no new pmntojpg. 

I have more digging to do for both imagemagick and netpbm.  Why (he asks of no one in particular) is nothing ever as straightforward as one thinks it might be?
« Last Edit: 16 / March / 2014, 10:01:47 by lyzby »

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #602 on: 16 / March / 2014, 11:06:29 »
Conversion to GIF is supported and works.
Code: [Select]
convert /var/www/foo.ppm -verbose  -resize 640x480! /var/www/foo2.gif
/var/www/foo.ppm=>/var/www/foo2.gif PPM 720x240=>640x480 640x480+0+0 8-bit Palette sRGB 241c 166KB 11.470u 0:11.480
Not altogether a happy solution, since 166KB instead of 54K, but I can proceed.

Still haven't found a way to get jpg and png to work on the dockstar.

« Last Edit: 16 / March / 2014, 11:10:50 by lyzby »

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #603 on: 16 / March / 2014, 11:44:11 »
For now, this 2-step process goes from 720x240 ppm to 640x480 jpg.
Code: [Select]
# convert /var/www/foo.ppm -verbose  -resize 640x480! /var/www/fooz.ppm
/var/www/foo.ppm=>/var/www/fooz.ppm PPM 720x240=>640x480 640x480+0+0 8-bit sRGB 922KB 1.860u 0:02.220
# pnmtojpeg -verbose /var/www/fooz.ppm > /var/www/fooz.jpg
pnmtojpeg: Input file has format P6.
It has 480 rows of 640 columns of pixels with max sample value of 255.
pnmtojpeg: No scan script is being used
First a resize to 640x480 ppm with "convert", then to jpg with "pnmtojpg".


*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #604 on: 16 / March / 2014, 15:40:35 »
For now, this 2-step process goes from 720x240 ppm to 640x480 jpg.
Note you might want to use 720x540, to keep the horizontal resolution unchanged (though in the actual viewport, this only refers to brightness values, since it's YUV411)

Thinking about this, there is probably a way to go directly from the YUV data to jpeg, without going through RGB first.

What distro do you use on the docstar?  I would really expect there is some way to get a version of imagemagick with jpeg support. Debian appears to offer a fork of imagemagick call "graphicsmagick". In the debian description I'm looking at, it explicitly says it supports jpeg. Imagemagick is also there, and claims jpeg support.
Don't forget what the H stands for.

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #605 on: 16 / March / 2014, 16:07:58 »
I'm using squeeze on the dockstar.  I did "apt-get install graphicsmagick"

gm convert /var/www/foo.ppm /var/www/fooz2.jpg

Works, but with a stretched image.  So far, non of the "-size" or "-resize" options I've tried have worked.

Re: alternative ptp client
« Reply #606 on: 22 / March / 2014, 22:58:15 »
I'm running PTP v2.6 (camera S100). When I click on [shoot] there's always a delay until the picture is taken. I want to minimize the delay. I tried to click [shoot half] before shoot. It doesn't seem to make any difference.
My question, can I fix all the settings first and then next click will only take the picture, i.e. with minimal delay.
Maybe using the console commands? Which I've never used before  :-)

Thanks in advance,
Phuoc

*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #607 on: 22 / March / 2014, 23:17:36 »
I'm running PTP v2.6 (camera S100). When I click on [shoot] there's always a delay until the picture is taken. I want to minimize the delay. I tried to click [shoot half] before shoot. It doesn't seem to make any difference.
Yes shoot_half just presses and releases. The shoot button presses half shoot, waits for everythign to be ready, and then presses full shoot.

Quote
My question, can I fix all the settings first and then next click will only take the picture, i.e. with minimal delay.
Maybe using the console commands? Which I've never used before  :-)
Yes
Code: [Select]
.press('shoot_half') ; m=read_usb_msg(-1) if m == 's' then click('shoot_full') end
Will hold down the shoot_half button and wait indefinitely for a message. You can then use
Code: [Select]
putm s
to take the shot, or putm with anything else to cancel.

If you want to take multiple shots quickly, you can use the rsint command discussed earlier, but it current does not work in the gui.

Also, you asked earlier in the thread about mirroring the live view. It turns out this is possible, see http://chdk.setepontos.com/index.php?topic=6231.msg110737#msg110737
Don't forget what the H stands for.


*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #608 on: 23 / March / 2014, 09:30:54 »
I'm using squeeze on the dockstar.  I did "apt-get install graphicsmagick"

gm convert /var/www/foo.ppm /var/www/fooz2.jpg

Works, but with a stretched image.  So far, non of the "-size" or "-resize" options I've tried have worked.
The following works to resize.  The "!" tells it to absolutely use the dimensions given.  Omitting that means you will still have a stretched image.

chdkptp -c -e"lvdumpimg -vp=/var/www/foo10.ppm"
gm convert -verbose -geometry 768x512! /var/www/foo10.ppm /var/www/foo10g.jpg

(Regarding imagemagick, even after following the process to install "delegates" for jpg and png (not clearly documented that I could tell), I couldn't get imagemagick to report that they were available--so I'm giving up on that.)
« Last Edit: 23 / March / 2014, 09:34:26 by lyzby »

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #609 on: 23 / March / 2014, 09:32:53 »
(Mistakenly submitted)
« Last Edit: 23 / March / 2014, 09:35:41 by lyzby »

 

Related Topics