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

chdkptp - alternative ptp client

  • 1106 Replies
  • 518218 Views
*

Offline nafraf

  • *****
  • 1308
Re: alternative ptp client
« Reply #590 on: 15 / March / 2014, 06:06:28 »
Advertisements
Can you post the output with cli_verbose=2 ?
A495 100f 3378 trunk

Code: [Select]
con 4> rs -jpg /tmp
rs_init
rs_shoot
get data 1
rc file /tmp/IMG_0007.jpg 1
rc chunk get /tmp/IMG_0007.jpg 1 0
rc chunk size:1004032 offset:nil last:true
WARNING: timed out waiting for shot script
script wait time 30.3081
ERROR: uninit a script is already running
First chunk, but last=true?

*

Offline srsa_4c

  • ******
  • 4451
Re: alternative ptp client
« Reply #591 on: 15 / March / 2014, 08:46:11 »
First chunk, but last=true?
Same thing happens on the a3200 (r47), but the image has to be really detailed to trigger it. I have some logging to do...

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #592 on: 15 / March / 2014, 13:33:11 »
I'm having trouble with the new ppm download, or rather, with converting it to something viewable.

I downloaded and compiled the latest chdkptp version, and also imagemagick.

If I run: /usr/src/chdkptp/lua# ../chdkptp -c -e"lvdumpimg -vp=/var/www/foo.ppm"
I get:
connected: Canon PowerShot SX120 IS, max packet size 512
/var/www/foo.ppm

If I then go to /var/www, and run "convert foo.ppm foo.jpg", I get the foo.jpg file, but can't view it in the webserver.  If I "wget" it to my windows PC and try to open it, I get "Windows Photo Viewer can't open this picture because the file appears to be damaged, corrupted, or too large".

I also tried "convert foo.ppm -resize 640x480! foo2.jpg" and "convert foo.ppm -resize 640x480! foo2.png" without success.

The verbose option yields the following: convert -verbose foo.ppm foo.jpg
foo.ppm PPM 720x240 720x240+0+0 8-bit sRGB 518KB 0.020u 0:00.019
foo.ppm=>foo.jpg PPM 720x240 720x240+0+0 8-bit sRGB 518KB 0.040u 0:00.100


Any suggestions?


« Last Edit: 15 / March / 2014, 13:37:41 by lyzby »

Re: alternative ptp client
« Reply #593 on: 15 / March / 2014, 13:45:03 »
I made some tests with A495, if Image Quality = Fine, remote capture does not work.  Please check if that makes difference.

Additionally, if you are willing to test a new version, I can send you a version where CHDK is loaded in ARAM.

Thanks a lot
At least it works in Normal quality mode.


I have the same behavior than you


Code: [Select]
Mode L - Quality Normal -> OK

connected: Canon PowerShot A490, max packet size 512
con> set cli_verbose=2
con> rs -jpg
rs_init
rs_shoot
get data 1
rc file IMG_0670.jpg 1
rc chunk get IMG_0670.jpg 1 0
rc chunk size:16384 offset:nil last:false
rc chunk get IMG_0670.jpg 1 1
rc chunk size:643584 offset:nil last:false
rc chunk get IMG_0670.jpg 1 2
rc chunk size:720957 offset:nil last:true
script wait time 2.0625
con 8>

Mode L - Quality Fine -> BUG

connected: Canon PowerShot A490, max packet size 512
con> set cli_verbose=2
con> rec
con 1> rs -jpg
rs_init
rs_shoot
get data 1
rc file IMG_0673.jpg 1
rc chunk get IMG_0673.jpg 1 0
rc chunk size:1004032 offset:nil last:true
script wait time 30.1563
con 4>

Mode L - Quality Fine - DNG -> OK but need reset at each shoot

connected: Canon PowerShot A490, max packet size 512
con> rec
con 1> set cli_verbose=2
con 1> rs -dng
rs_init
rs_shoot
get data 1
rc chunk get 4 0
rc chunk size:1320 offset:nil last:true
rc file IMG_0683.dng 2
rc chunk get IMG_0683.dng 2
rc chunk size:15467760 offset:nil last:true
dng 3720x2772x12
creating thumb: 128x96
script wait time 2.0625
con 4>


The dng is fully transfered and correctly converted by dcraw but the camera need to be reset
at each shoot (memory card error)

The jpg contains probably garbage (The jpeg header is not there)

I think it's a chdk side problem, for jpg files greater than about 1.5mo (buffer overflow ?)
As nafraf says, the last flag should not be true and the first chunk is always 1 004 032...
 


Re: alternative ptp client
« Reply #594 on: 15 / March / 2014, 13:59:57 »
I have used rs -jpg many times with the A490 firmware 100f and currently use that camera with the command rsint. CHDK version a490-100f-1.3.0-3343-full_BETA, chdkptp version 492. Camera settings quality: fine and continuous mode.

I'll try this particular build.

Are you in higher resolution ? (L)
What are the sizes of the jpg ?

*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #595 on: 15 / March / 2014, 15:36:00 »
First chunk, but last=true?
This sounds like it could match multiple invocations of filewrite, where the first "session" only has one chunk.

You should be able to see if this happens by blinking an led in filewrite_main_hook, and shooting normally without remotecap, using the settings that cause the problem.  You could also just increment a counter and display it with misc debug vals.

Regarding the failure at high quality, this may depend on the scene as well, since the amount of detail will affect the file size.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #596 on: 15 / March / 2014, 15:47:52 »
Any suggestions?
Not really, it would be very surprising if imagemagick didn't produce a valid jpeg. The files I converted worked in windows photo viewer. If the PPM wasn't valid, imagemagick shoould complain, but ppm is such stupidly simple format that is very unlikely. It's possible the jpeg is being corrupted in download, you should use md5 or something to verify that what you downloaded is identical to what is on the server.

You should also be able to view the ppm directly in many programs, irfanview for example.
Don't forget what the H stands for.

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #597 on: 15 / March / 2014, 19:24:12 »
Any suggestions?
Not really, it would be very surprising if imagemagick didn't produce a valid jpeg. The files I converted worked in windows photo viewer. If the PPM wasn't valid, imagemagick shoould complain, but ppm is such stupidly simple format that is very unlikely. It's possible the jpeg is being corrupted in download, you should use md5 or something to verify that what you downloaded is identical to what is on the server.

You should also be able to view the ppm directly in many programs, irfanview for example.
I copied the ppm file to my PC, installed imagemagick, and ran the conversion there.  It worked, so the problem is with my dockstar installation.  There are no complaints running it on the dockstar, but the file produced is 900+K instead of 42K on the PC--same for jpg or png (54K with conversion to 640x480).  Bummer.  I guess I need to go to the ImageMagick site and ask for solutions there.

On the PC:
imconvert -verbose foo.ppm -resize 640x480!  foo4a.jpg
foo.ppm PPM 720x240 720x240+0+0 8-bit sRGB 518KB 0.000u 0:00.003
foo.ppm=>foo4a.jpg PPM 720x240=>640x480 640x480+0+0 8-bit sRGB 54.2KB 0.125u 0:00.137


*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #598 on: 15 / March / 2014, 19:48:50 »
I copied the ppm file to my PC, installed imagemagick, and ran the conversion there.  It worked, so the problem is with my dockstar installation.  There are no complaints running it on the dockstar, but the file produced is 900+K instead of 42K on the PC--same for jpg or png (54K with conversion to 640x480).  Bummer.  I guess I need to go to the ImageMagick site and ask for solutions there.
Hmm, 900+K might mean it's outputting it in the wrong format. Inspecting the file (with imagemagic "identify", the "file" command or a hex editor) might provide some clues. Perhaps you need to force the output format rather than just giving an extension. Prefixing the output path with the format should do this, like
$ convert foo.ppm jpeg:foo.derp
$ identify foo.derp
foo.derp JPEG 720x240 720x240+0+0 8-bit DirectClass 49.3KB 0.016u 0:00.000

You might also try netpbm tools instead. They should be very portable.

Don't forget what the H stands for.

*

Offline lyzby

  • **
  • 52
Re: alternative ptp client
« Reply #599 on: 15 / March / 2014, 21:34:22 »
Perhaps you need to force the output format rather than just giving an extension. Prefixing the output path with the format should do this
Well.  That was revealing.
Code: [Select]
convert /var/www/foo.ppm -verbose jpeg:/var/www/foo.derp
/var/www/foo.ppm=>jpeg:/var/www/foo.derp PPM 720x240 720x240+0+0 8-bit sRGB 518KB 0.050u 0:00.049
convert: no encode delegate for this image format `jpeg:/var/www/foo.derp' @ warning/constitute.c/WriteImage/1224.
convert: unable to open image `jpeg:/var/www/foo.derp': No such file or directory @ error/blob.c/OpenBlob/2643.
So, "no encode delegate for this image format".  Whatever that means.

...

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.

« Last Edit: 16 / March / 2014, 08:57:00 by lyzby »

 

Related Topics