Need help with script that can show timestamp in recorded video file. - Script Writing - CHDK Forum
supplierdeeply

Need help with script that can show timestamp in recorded video file.

  • 9 Replies
  • 6778 Views
*

Offline eteny

  • *
  • 19
Advertisements
Hi, I am an astrophotographer. I understand that in the CHDK default screen display, the current system time is being displayed. I was wondering if there is a way to record a video that shows the current time (while recording) accurate to milliseconds. If that is not possible, is there a way to show the system time (shown by default in the upper left area of the screen) with milliseconds? the latest CHDK version for my S3IS only shows time in minutes and in seconds. Thanks! I intend to use this for timing astronomical events.
« Last Edit: 17 / September / 2013, 04:46:41 by eteny »

*

Offline reyalp

  • ******
  • 14082
Re: Need help with script that can show timestamp in recorded video file.
« Reply #1 on: 02 / November / 2010, 22:31:33 »
CHDK cannot currently add any kind of overlay to a video.

I would expect the frame rate of the in camera video to be pretty stable, so if some part of it was synchronized to a known time, that might be sufficient. Of course you would need to measure this before relying on it.

The code could be modified to display time in milliseconds. Displaying it would require some trivial C code. Displaying it at the maximum possible precision might be less trivial. In any case it would be limited by
1: the tick counter only has 10ms precision (which might not be the same thing as 10ms accuracy)
2: display refresh rate
3: uncertainty in when the redraw happened in relation to refresh.
Don't forget what the H stands for.

*

Offline eteny

  • *
  • 19
Re: Need help with script that can show timestamp in recorded video file.
« Reply #2 on: 02 / November / 2010, 22:39:07 »
Hi reyalp!

Great! That would be sufficient for my requirements. I can always connect the camera to a video recorder (laptop) in order to capture video feed of the LCD display. My real problem actually is the precision of the displayed time (it needs to show more precision than just minutes and seconds, and if possible show milliseconds). If someone could modify a CHDK version for me (S3IS), or write a script, it would certainly help me in my research. thanks!

Eteny
« Last Edit: 17 / September / 2013, 04:52:27 by eteny »

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Need help with script that can show timestamp in recorded video file.
« Reply #3 on: 04 / November / 2010, 15:28:12 »
Well.. attached a simple patch and a build for s3is 100a (of patched latest trunk, rev 964, default config, built on gcc3). To make use of it, enable clock OSD in 24 h mode, seconds enabled, and then use the OSD layout editor to move the clock left a bit to see the decimals (up to 0.01 s, maximum resolution of Canon's ticker) I added.

I'm not 100% sure about the validity of the way I did this (taking fractions from the ticker, seconds from time structure as usual to the clock), but on my a570 the tenths-of-a-second seem to wrap around as expected. In any case the OSD update rate is really quite poor, somewhere around 200 ms... and remember reyalp's warning about display accuracy possibly not quite matching resolution. But it's more than 1 s, hope it helps ;)



*

Offline eteny

  • *
  • 19
Re: Need help with script that can show timestamp in recorded video file.
« Reply #4 on: 05 / January / 2011, 08:42:57 »
Thanks a lot sir! Will definitely try this and let you know of the results. Thanks again! :)
« Last Edit: 17 / September / 2013, 04:53:22 by eteny »

*

Offline eteny

  • *
  • 19
Re: Need help with script that can show timestamp in recorded video file.
« Reply #5 on: 06 / January / 2011, 23:32:51 »
Hi fudgey! thank you very much for the patch that you have provided. It works perfectly with my s3is. I intend to use this clock patch for timing astronomical events called transits and occultation. I will be posting results as soon there is an opportunity to record such rare events. :) it would definitely help lots of astro-enthusiasts!

Well.. attached a simple patch and a build for s3is 100a (of patched latest trunk, rev 964, default config, built on gcc3). To make use of it, enable clock OSD in 24 h mode, seconds enabled, and then use the OSD layout editor to move the clock left a bit to see the decimals (up to 0.01 s, maximum resolution of Canon's ticker) I added.

I'm not 100% sure about the validity of the way I did this (taking fractions from the ticker, seconds from time structure as usual to the clock), but on my a570 the tenths-of-a-second seem to wrap around as expected. In any case the OSD update rate is really quite poor, somewhere around 200 ms... and remember reyalp's warning about display accuracy possibly not quite matching resolution. But it's more than 1 s, hope it helps ;)


« Last Edit: 17 / September / 2013, 04:54:29 by eteny »

*

Offline eteny

  • *
  • 19
Re: Need help with script that can show timestamp in recorded video file.
« Reply #6 on: 06 / January / 2011, 23:37:46 »
Hi reyalp, thanks for the advice regarding the time delay issue. We have now found a way to manually sync it with a known time. Thanks a lot, help is greatly appreciated. :)

Eteny

CHDK cannot currently add any kind of overlay to a video.

I would expect the frame rate of the in camera video to be pretty stable, so if some part of it was synchronized to a known time, that might be sufficient. Of course you would need to measure this before relying on it.

The code could be modified to display time in milliseconds. Displaying it would require some trivial C code. Displaying it at the maximum possible precision might be less trivial. In any case it would be limited by
1: the tick counter only has 10ms precision (which might not be the same thing as 10ms accuracy)
2: display refresh rate
3: uncertainty in when the redraw happened in relation to refresh.
« Last Edit: 17 / September / 2013, 04:55:31 by eteny »

*

Offline eteny

  • *
  • 19
Re: Need help with script that can show timestamp in recorded video file.
« Reply #7 on: 17 / December / 2012, 22:27:51 »
Hi! Special thanks to Fudgey and Reyalp for making this project possible. With the patch provided, Canon S3IS may now be used to accurately time astronomical events :) Many thanks!

http://nightskyinfocus.com/diyprojects/timing-occultations-using-canon-powershot-s3is-and-chdk/
« Last Edit: 17 / September / 2013, 04:58:31 by eteny »


*

Offline reyalp

  • ******
  • 14082
Re: Need help with script that can show timestamp in recorded video file.
« Reply #8 on: 18 / December / 2012, 00:00:51 »
Hi! Special thanks to Fudgey and Reyalp for making this project possible. With the patch provided, Canon S3IS may now be used to accurately time astronomical events :) Many thanks!

http://nightskyinfocus.com/diyprojects/timing-occultations-using-canon-powershot-s3is-and-chdk/
Great to see you got this to work, it's always nice to see CHDK used in creative applications.

I would be cautious about making any claims about the resolution though, unless you've verified it against some known standard. Fudgeys mod displays 1/100ths of a second, but the actual accuracy is likely to be significantly less. There is unknown, variable latency probably on the order of 10s of ms between the value being read from get_tick_count and reaching the display. The display has some fixed refresh rate (probably something like 30hz) and the task reading the tick count most likely does not run in lockstep with display refresh.

edit: oops, accidentally erased a line when I first posted.
« Last Edit: 18 / December / 2012, 00:06:33 by reyalp »
Don't forget what the H stands for.

*

Offline eteny

  • *
  • 19
Re: Need help with script that can show timestamp in recorded video file.
« Reply #9 on: 17 / September / 2013, 02:58:57 »
Thanks again! You may also be interested to know that we have successfully used the Canon S3IS running CHDK during an actual observation and yield results consistent with the predicted values. In any case, I will try to compare it side by side with a newly-acquired timer (the equipment that astronomers actually use in the field with a known precision and accuracy) to somehow find a way to measure the camera's actual resolution.

P.S. I have updated the page (new observations now included):) Here's a new link:
http://nightskyinfocus.com/diyprojects/timing-astronomical-events-using-chdk/
« Last Edit: 17 / September / 2013, 05:08:43 by eteny »

 

Related Topics