Modified video remaining time - Feature Requests - CHDK Forum

Modified video remaining time

  • 2 Replies
  • 3275 Views
Modified video remaining time
« on: 16 / July / 2009, 04:58:50 »
Advertisements
Hi,

As video lenght is limited to 2GB in fat 32 (Correct me if I am wrong)
With the very high capacity sdhc we can have now (up to 32GB now)
I was thinking about modify the remaining time OSD to take care of the 2GB limit.
At the moment on my camera with a very high quality selected it display something
like 1h20 left but this is false as the 2GB file will be full in about 10 mins ...

Is it worth doing it ?

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Modified video remaining time
« Reply #1 on: 16 / July / 2009, 05:14:48 »
hm, true. havent thought about that when i coded this.
we could add another indicator: MB so far. so when the number will rise to 2 GB it will get red and probably blink so you know when to stop.

Re: Modified video remaining time
« Reply #2 on: 16 / July / 2009, 09:34:33 »
The MB indicator would be perfect !!

In the meantime I made this ugly hack ;)


--- gui_osd.c-ori       2009-07-16 15:15:53.000000000 +0200
+++ gui_osd.c   2009-07-16 15:26:07.000000000 +0200
@@ -1096,6 +1096,7 @@
 static long init_time;
 static int record_running = 0;
 static int init = 0;
+static int hastobefree = 0;
 static unsigned int skipcalls = 1;
 unsigned int hour=0, min=0, sec=0;
 int mode_video = MODE_IS_VIDEO(m);
@@ -1138,6 +1139,7 @@
     {
     init = 1;
     init_space = GetFreeCardSpaceKb();
+    if (init_space > 2*1024*1024) hastobefree = init_space - 2*1024*1024;
     init_time  = get_tick_count();
     }
     if (init == 1)
@@ -1146,7 +1148,7 @@
     card_used = init_space - GetFreeCardSpaceKb();
     elapsed = (int) ( get_tick_count() - init_time ) / 1000;
     avg_use = card_used / elapsed;  // running average Kb/sec
-    time_left = (GetFreeCardSpaceKb() / avg_use);
+    time_left = ((GetFreeCardSpaceKb() - hastobefree) / avg_use);
     hour = time_left / 3600;
     min = (time_left % 3600) / 60;
     sec = (time_left % 3600) % 60;

 

Related Topics


SimplePortal © 2008-2014, SimplePortal