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

chdkptp - alternative ptp client

  • 1106 Replies
  • 518217 Views
Re: alternative ptp client
« Reply #670 on: 05 / July / 2014, 11:20:09 »
Advertisements
sounds like the frame rate will be much lower, cause it dumps them to the disk where they have to be picked up. Beside that the delay will be much higher. All suggested processings would add a higher delay and/or lower frame rates for the resulting stream. So it seems like the better approach would be to try adding chdk-ptp support to gphoto2.

Re: alternative ptp client
« Reply #671 on: 05 / July / 2014, 11:26:32 »
As I recall there is a PTP client written in Delphi by one of the young Germans (not the nasty one who normally frequents here).

The client supported a webcam mode.

Re: alternative ptp client
« Reply #672 on: 05 / July / 2014, 11:31:09 »
The client was written by 'rudi', try searching for it.

Re: alternative ptp client
« Reply #673 on: 05 / July / 2014, 18:50:17 »
I guess were talking about ptpcamgui? it's for windows only, isn't it? I am looking for a Linux solution which could be runrun on a raspberry pie f.e.


*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #674 on: 06 / July / 2014, 02:20:22 »
Screen capture is not an Option for me, it adds too much overhead. Do you think you could add it to the wish list?
It's already on my wishlist, but so are a lot of other things and at the moment I don't have much time to work on any of it.

Quote
So it seems like the better approach would be to try adding chdk-ptp support to gphoto2.
Unlikely this would be easier than adding some kind of streaming support chdkptp, the CHDK live view protocol is quite unique due to the way it is hacked into the firmware. It is not related to Canon's built in live view.

I guess were talking about ptpcamgui? it's for windows only, isn't it? I am looking for a Linux solution which could be runrun on a raspberry pie f.e.
AFAIK PTPCamGui doesn't support live view at all, so I'm really not sure what Microfunguy is referring to.
Don't forget what the H stands for.

Re: alternative ptp client
« Reply #675 on: 06 / July / 2014, 03:49:10 »
Quote
There is definitely a build that refers to a webcam driver, I will try to find it on one of my USB drives later today.

It is CHDKCAM by EWAVR (Zosim Mikhaylov).

Here is part of the code :-

Code: [Select]
void __fastcall TMainForm::OnWebCamSwitch(bool on)
{
 static bool OverlayState=true;
 if (on)
 {
  try
  {
   if (!VCam) VCam = CoVCamSDK::Create();
  }
  catch(...)
  {
   Application->MessageBox("Cannot connect to driver.\rWebcam driver is not installed?","Error!",MB_OK|MB_ICONERROR);
   WebcamCheckBox->Checked=false;
   return;
  }
  if (!VCam) { WebcamCheckBox->Checked=false; return; }
  if (HiResCheckBox->Checked)  VCam.ChangeDefaultVideoSize(4);
   else  VCam.ChangeDefaultVideoSize(2);
  HiResCheckBox->Enabled=false;
  OverlayState=OverlayCheckBox->Checked;
  OverlayCheckBox->Checked=false;
 }
 if (!on)
 {
  HiResCheckBox->Enabled=true;
  OverlayCheckBox->Checked=OverlayState;
 }
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::WebcamCheckBoxClick(TObject *Sender)
{
 OnWebCamSwitch(WebcamCheckBox->Checked);
}
//---------------------------------------------------------------------------

I do not have all of the files, never did.

It needs some research to see if anything else can be unearthed.


mod edit:
misattributed quote
« Last Edit: 07 / July / 2014, 23:51:54 by reyalp »

*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #676 on: 06 / July / 2014, 04:01:28 »
OK, in svn rev 606, I added some code to lvdumpimg which may enable to you to stream the output.

If the vp filespec starts with !, it is treated as a command to pipe to. If the command includes spaces, it will need to be quoted.

lvdumpimg -count=50 -wait=33 -vp=!"ffmpeg -y -vcodec pgm -f image2pipe -i - -vcodec mpeg4 test.avi"

Created a valid 50 frame AVI for me on my raspberry pi. Presumably, something like the stuff on https://trac.ffmpeg.org/wiki/StreamingGuide would let you stream it instead.

Note in practice you would want to scale the output to the correct aspect ratio, and it's not clear to me how ffmpeg will handle the very unstable frame rate of the input.

I don't think you will be able to encode at very high framerates unless there is support somewhere to do it on the pi gpu.

The changes only affect the lua files, so if you are using a pre-built binary, you can just replace the lua files with the ones from svn.

edit:
Also, there is no way to control chdkptp while this is running. You can kill it with control+c but that's it.
« Last Edit: 06 / July / 2014, 04:03:26 by reyalp »
Don't forget what the H stands for.

Re: alternative ptp client
« Reply #677 on: 06 / July / 2014, 04:25:00 »
Thanks, i will get a canon camera and give it a try and report my result.

Will chdkptp quit when there's an error like the camera has been switched off?


*

Offline reyalp

  • ******
  • 14082
Re: alternative ptp client
« Reply #678 on: 06 / July / 2014, 14:05:19 »
Thanks, i will get a canon camera and give it a try and report my result.
If you mean buy one, keep in mind this is a very rough hack. There is no guarantee it will work for your application.

I fiddled with some of the streaming options described in that link and didn't get it to work last night, but it was very late and my knowledge of ffmpeg and video streaming in general is pretty limited.
Quote
Will chdkptp quit when there's an error like the camera has been switched off?
Haven't tried it, but it should. The last frame sent to ffmpeg is likely to be invalid in this case, but I suspect it will handle it OK.

Assuming this works, it should be fairly easy to modify the lvdumpimg main loop so it checks some kind of control file.

It's also worth noting lvdumpimg takes the YUV411 viewport data and converts it to RGB to write as a ppm to ffmpeg. Sending some kind of YUV would probably be more efficient, because the final video will almost certainly be YUV. However, I don't know of an image format that would let you send YUV411 directly.

edit:
Also, currently only works for the viewport, it there is no support for piping the UI overlay. It would be complicated to get them in the same stream.
« Last Edit: 06 / July / 2014, 14:07:39 by reyalp »
Don't forget what the H stands for.

Re: alternative ptp client
« Reply #679 on: 07 / July / 2014, 15:08:43 »
There is definitely a build that refers to a webcam driver, I will try to find it on one of my USB drives later today.

It is CHDKCAM by EWAVR (Zosim Mikhaylov).

Here is part of the code :-

Code: [Select]
void __fastcall TMainForm::OnWebCamSwitch(bool on)
{
 static bool OverlayState=true;
 if (on)
 {
  try
  {
   if (!VCam) VCam = CoVCamSDK::Create();
  }
  catch(...)
  {
   Application->MessageBox("Cannot connect to driver.\rWebcam driver is not installed?","Error!",MB_OK|MB_ICONERROR);
   WebcamCheckBox->Checked=false;
   return;
  }
  if (!VCam) { WebcamCheckBox->Checked=false; return; }
  if (HiResCheckBox->Checked)  VCam.ChangeDefaultVideoSize(4);
   else  VCam.ChangeDefaultVideoSize(2);
  HiResCheckBox->Enabled=false;
  OverlayState=OverlayCheckBox->Checked;
  OverlayCheckBox->Checked=false;
 }
 if (!on)
 {
  HiResCheckBox->Enabled=true;
  OverlayCheckBox->Checked=OverlayState;
 }
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::WebcamCheckBoxClick(TObject *Sender)
{
 OnWebCamSwitch(WebcamCheckBox->Checked);
}
//---------------------------------------------------------------------------

I do not have all of the files, never did.

It needs some research to see if anything else can be unearthed.
[/quote]

 

Related Topics