Overwrite oldest image when memory is full - General Help and Assistance on using CHDK stable releases - CHDK Forum

Overwrite oldest image when memory is full

  • 11 Replies
  • 6636 Views
Overwrite oldest image when memory is full
« on: 18 / August / 2010, 18:59:53 »
Advertisements
1. does this feature exist on any of the cameras already?
2. if not, is it possible to program any of the supported cameras to do this?

If you need a more detailed explanation: when the memory is full, instead of saying "memory full" and not taking the picture, it needs to delete the oldest one so that the new picture can be taken. (This is for a robotics project. )

*

Offline reyalp

  • ******
  • 14125
Re: Overwrite oldest image when memory is full
« Reply #1 on: 19 / August / 2010, 01:46:34 »
CHDK lua scripts can do this, but it won't allow the camera to run indefinitely because some camera RAM related to the files is never freed.
Don't forget what the H stands for.

Re: Overwrite oldest image when memory is full
« Reply #2 on: 19 / August / 2010, 11:20:31 »
OK well is there some way to make the camera some sort of tiny server so I can write another program that will access it periodically and do file maintenance? Or save the images on a remote hard drive instead of the SD card? It needs to be totally hands free and run indefinitely. How would you solve this problem?


*

Offline reyalp

  • ******
  • 14125
Re: Overwrite oldest image when memory is full
« Reply #3 on: 19 / August / 2010, 12:47:18 »
OK well is there some way to make the camera some sort of tiny server so I can write another program that will access it periodically and do file maintenance?
The problem isn't file maintenance. As I said, CHDK is perfectly capable of deleting images. The problem is the cameras are not designed to run indefinitely.

You can use the experimental PTP interface: http://chdk.setepontos.com/index.php/topic,4338.0.html to remotely control the camera.
Quote
Or save the images on a remote hard drive instead of the SD card?
You can also use eye-fi http://www.eye.fi/ to send images to a remote machine.

None of this will solve the resource leak issue. AFAIK the only way to do this is periodic rebooting. This can be done with the PTP code, or various electromechanical hacks.
Quote
It needs to be totally hands free and run indefinitely. How would you solve this problem?
Depends on the actual requirements and budget, but I'd probably avoid using CHDK in favor of something that had documented interfaces and was designed to be controlled by whatever system controls the robot.


edit:
Eye-fi has a feature similar to what you are asking about http://www.eye.fi/how-it-works/features/endless-memory but again, I wouldn't expect the camera to run indefinitely.
« Last Edit: 19 / August / 2010, 12:51:27 by reyalp »
Don't forget what the H stands for.

Re: Overwrite oldest image when memory is full
« Reply #4 on: 19 / August / 2010, 14:02:53 »
That eyefi card is absolutely awesome. The perfect solution. thanks very much for that.

I read about the PTP project but some things were not clear
1. how does it connect to the PC (USB? TTL? RS485?)?
2. does the camera's firmware require modification or can the stock camera be used?

Re: Overwrite oldest image when memory is full
« Reply #5 on: 19 / August / 2010, 14:08:48 »
the robot is controlled by hobby servos using a servo controller and an RS232 extender with the computer 30+ feet away.

*

Offline reyalp

  • ******
  • 14125
Re: Overwrite oldest image when memory is full
« Reply #6 on: 19 / August / 2010, 14:49:30 »
I read about the PTP project but some things were not clear
1. how does it connect to the PC (USB? TTL? RS485?)?
USB. PTP is the standard USB protocol used by most recent consumer cameras to communicate with a PC. edit: CHDK extends this to add features not present in the stock firmware.

You can also make ad-hoc communication protocols with stock CHDK, using an LED for output and USB power for input. This is probably more suitable for a micro-controller based applications, and does not require a custom CHDK build. However, it wouldn't be very suitable for transferring images.
Quote
2. does the camera's firmware require modification or can the stock camera be used?
It requires a custom build of CHDK (and possibly some new code if the camera isn't already supported by one of the PTP patches).

I just assumed you were intending to use CHDK, since this is the CHDK forum.
Don't forget what the H stands for.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Overwrite oldest image when memory is full
« Reply #7 on: 19 / August / 2010, 14:50:46 »
I read about the PTP project but some things were not clear
1. how does it connect to the PC (USB? TTL? RS485?)?
2. does the camera's firmware require modification or can the stock camera be used?

USB.

PTP is the USB Picture Transfer Protocol supported by most digital cameras out there. Experimental PTP patches to CHDK add non-standard functionality to Canon's PTP implementation, making it possible to talk to the camera via USB from a PC host in ways not previously possible. CHDK doesn't require any firmware modifications, the PTP patches don't change this.

Re: Overwrite oldest image when memory is full
« Reply #8 on: 19 / August / 2010, 17:08:40 »
what will the camera do when the memory leak wastes all of the memory like you were saying? will it just freeze the OS, automatically reboot or what? I've already gone out and bought and installed the Eye-Fi card. I'm just wondering when the camera will freeze up. It is an A490 btw. is it wasting internal memory or card memory?

On a separate note, I also need to remove the damn IR filter but these newer cameras are hard to disassemble without destroying something. are there any good disassembly videos that feature newer cameras?

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Overwrite oldest image when memory is full
« Reply #9 on: 19 / August / 2010, 17:35:04 »
what will the camera do when the memory leak wastes all of the memory like you were saying? will it just freeze the OS, automatically reboot or what? I've already gone out and bought and installed the Eye-Fi card. I'm just wondering when the camera will freeze up. It is an A490 btw. is it wasting internal memory or card memory?

It will definitely not restart. It don't remember what mine does, I may have written about it previously somewhere. It probably either shuts down with lens out (your normal every day assert) or sits in a dull state with display on and either reacts or doesn't react to things such as the power button (i.e. could require battery/external power removal).

My camera (a570) is one of the models that don't have a lot of free RAM, it pretty much consistently crashes on timelapses (booted with an empty DCIM tree) when it attempts to create the fifth DCIM subdirectory. Each DCIM subdirectory can hold up to 2000 photos, meaning my maximum is 8000 photos, and that requires resetting the JPEG image counter before starting a timelapse. See http://chdk.wikia.com/wiki/CHDK/Camera_RAM_memory_usage.

The amount of free RAM changes between camera models (not price tag). It's of course possible that Canon has changed the file table code in ways that makes this better or worse for you. No way of knowing that unless someone tries to find the limits. I believe Canon considers having several thousands of shots on a card abnormal, because starting the camera with a huge number of photos makes booting to play mode extremely slow when the camera tries to index the DCIM tree.

Note that I can actually boot the camera and shoot successfully (albeit slowly) even with >8000 images on the card i.e. the camera has ways to overcome this RAM issue -- it just doesn't do this sort of cleanup while powered on, only when it's first switched to play mode after power-on.

None of this is related to CHDK really... CHDK (and eye-fi too I suppose) just makes it possible for you to delete photos without Canon firmware knowing it so you'll be able to confuse the camera by shooting more than what fits the card. CHDK scripting enables useful timelapse, MD etc applications that may fill a huge SD card with tiny images without rebooting, which is not normal for a everyday use of a P&S camera.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal