Can I use a PowerShot Canon as a Webcam? - page 3 - Script Writing - CHDK Forum

Can I use a PowerShot Canon as a Webcam?

  • 43 Replies
  • 21248 Views
*

Offline reyalp

  • ******
  • 14121
Re: Can I use a PowerShot Canon as a Webcam?
« Reply #20 on: 14 / April / 2020, 17:19:26 »
Advertisements
Thanks.
BTW will you remove the debugging info just in the stable version?
The debugging display should not be present in the autobuilds. If you are still seeing it, you probably did not have successfully install the autobuild. That would also explain why you still see issues in movie mode.

Note I only made the fix in the 1.5 tree, not the 1.4 "stable" autobuild.

edit:
Use the "full" zip from http://mighty-hoernsche.de/trunk/
« Last Edit: 14 / April / 2020, 17:21:31 by reyalp »
Don't forget what the H stands for.

Re: Can I use a PowerShot Canon as a Webcam?
« Reply #21 on: 15 / April / 2020, 11:13:45 »
I've used the full 1.5 5460.

*

Offline reyalp

  • ******
  • 14121
Re: Can I use a PowerShot Canon as a Webcam?
« Reply #22 on: 15 / April / 2020, 14:03:36 »
I've used the full 1.5 5460.
Are you saying that the debugging screen appears in autobuild 5460? If so, I really don't see how that would happen. Please go to miscellaneous -> build info and check the version number there.
Don't forget what the H stands for.

Re: Can I use a PowerShot Canon as a Webcam?
« Reply #23 on: 16 / April / 2020, 04:03:24 »
There's no debugging data in5461.
But there's still flickering in video mode.
https://www.sendspace.com/file/u3pk7k


*

Offline srsa_4c

  • ******
  • 4451
Re: Can I use a PowerShot Canon as a Webcam?
« Reply #24 on: 16 / April / 2020, 17:12:01 »
But there's still flickering in video mode.
https://www.sendspace.com/file/u3pk7k
I assume you mean the tearing. Unfortunately, the live buffers in CHDK are usually tuned for fast motion detection (which is a traditional CHDK feature and - AFAIK - predates PTP support).
I guess changing the current buffer calculation in vid_get_viewport_live_fb() might result in less tearing - although I have not made any experiments. Another cause of tearing could be a slow USB transfer speed.

*

Offline reyalp

  • ******
  • 14121
Re: Can I use a PowerShot Canon as a Webcam?
« Reply #25 on: 16 / April / 2020, 19:37:22 »
There's no debugging data in5461.
But there's still flickering in video mode.
https://www.sendspace.com/file/u3pk7k
Thanks. Like srsa_4c, what I see in this video is "tearing" where you see part of one frame and part of another, like the attached.

This is different from the issue in https://chdk.setepontos.com/index.php?topic=14030.msg143203#msg143203 where garbage would be displayed every few frames.

Unfortunately, tearing is normal to see in the current implementation of chdkptp live view. I have some ideas to reduce it, but for now that's just the way it is. If you are still seeing an issue that doesn't look like tearing, please let us know.
Don't forget what the H stands for.

Re: Can I use a PowerShot Canon as a Webcam?
« Reply #26 on: 17 / April / 2020, 06:26:41 »
Can I get less tearing with a wiser fps choice or something like this?

*

Offline srsa_4c

  • ******
  • 4451
Re: Can I use a PowerShot Canon as a Webcam?
« Reply #27 on: 17 / April / 2020, 17:10:42 »
Can I get less tearing with a wiser fps choice or something like this?
No, because the buffers that are chosen to be transferred over PTP happen to be overwritten by new data at the same time, no matter how many FPS you're aiming at.
Attached is an experiment, with this change:
Code: [Select]
Index: platform/sx260hs/lib.c
===================================================================
--- platform/sx260hs/lib.c (revision 5463)
+++ platform/sx260hs/lib.c (working copy)
@@ -76,10 +76,10 @@
 void *vid_get_viewport_live_fb() {
     // appears to use 4 buffers in video mode or recording
     if (camera_info.state.mode_video || is_video_recording()) {
-        return viewport_buffers[(active_viewport_buffer-1)&3];
+        return viewport_buffers[(active_viewport_buffer-2)&3];
     }
     // 8 buffers in still mode
-    return viewport_buffers[(active_viewport_buffer-1)&7];
+    return viewport_buffers[(active_viewport_buffer-2)&7];
 }
 
 int vid_get_viewport_width() {


Re: Can I use a PowerShot Canon as a Webcam?
« Reply #28 on: 18 / April / 2020, 18:13:51 »
I've tried the 5468 version - there's still tearing in movie mode but M mode works perfectly ( why there's a difference).
That's good enough for me.
Thank you all for the good work!

Re: Can I use a PowerShot Canon as a Webcam?
« Reply #29 on: 19 / April / 2020, 16:21:11 »
BTW how can I keep chdk settings even when I install a new version?

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal