diff -Nurd image2mpeg-0.7/src/gip/gip.c image2mpeg-0.7ap/src/gip/gip.c
--- image2mpeg-0.7/src/gip/gip.c	2005-10-24 17:12:42.000000000 +0930
+++ image2mpeg-0.7ap/src/gip/gip.c	2007-02-12 16:53:43.000000000 +1030
@@ -1,11 +1,14 @@
 /*
-**	$Id: gip.c,v 1.1 2005/10/24 07:42:42 gromeck Exp $
+**	$Id: gip.c,v 1.2 2007/02/12 16:50:00 xanni Exp $
 **
 **	Copyright (c) 2004 by Christian Lorenz
 **
 **	GIP API
 **
 **	$Log: gip.c,v $
+**	Revision 1.2  2007/02/12 16:50:00  xanni
+**	added support for times
+**
 **	Revision 1.1  2005/10/24 07:42:42  gromeck
 **	INITIAL CHECK-IN
 **	
@@ -34,6 +37,7 @@
 	rc = rc && GIP_progress_init();
 	rc = rc && GIP_color_init();
 	rc = rc && GIP_geometry_init();
+	rc = rc && GIP_times_init();
 	rc = rc && GIP_transition_init();
 	rc = rc && GIP_image_init();
 	rc = rc && GIP_audio_init();
@@ -55,6 +59,7 @@
 	rc = rc && GIP_audio_exit();
 	rc = rc && GIP_image_exit();
 	rc = rc && GIP_transition_exit();
+	rc = rc && GIP_times_exit();
 	rc = rc && GIP_geometry_exit();
 	rc = rc && GIP_color_exit();
 	rc = rc && GIP_progress_exit();
diff -Nurd image2mpeg-0.7/src/gip/gip.h image2mpeg-0.7ap/src/gip/gip.h
--- image2mpeg-0.7/src/gip/gip.h	2005-10-24 18:05:37.000000000 +0930
+++ image2mpeg-0.7ap/src/gip/gip.h	2007-02-12 16:52:04.000000000 +1030
@@ -30,6 +30,7 @@
 #include "color.h"
 #include "error.h"
 #include "geometry.h"
+#include "times.h"
 #include "image.h"
 #include "index.h"
 #include "progress.h"
diff -Nurd image2mpeg-0.7/src/gip/index.c image2mpeg-0.7ap/src/gip/index.c
--- image2mpeg-0.7/src/gip/index.c	2005-12-12 20:48:19.000000000 +1030
+++ image2mpeg-0.7ap/src/gip/index.c	2007-02-12 22:51:52.000000000 +1030
@@ -1,11 +1,14 @@
 /*
-**	$Id: index.c,v 1.18 2005/11/16 17:25:03 gromeck Exp $
+**	$Id: index.c,v 1.19 2007/02/12 16:53:00 xanni Exp $
 **
 **	Copyright (c) 2004 by Christian Lorenz
 **
 **	handle index files
 **
 **	$Log: index.c,v $
+**	Revision 1.19  2007/02/12 16:53:00  xanni
+**	added support for times
+**
 **	Revision 1.18  2005/11/16 17:25:03  gromeck
 **	added support for overlay images (currently only one overlay is supported);
 **	the overlay image will be overlayed each resulting frame of the stream
@@ -146,7 +149,7 @@
 }
 
 /*
-**	generate an "uncomputed" index (image dureations are not set)
+**	generate an "uncomputed" index (image durations are not set)
 */
 GIP_INDEX_T *GIP_index_create(void)
 {
@@ -540,12 +543,13 @@
 /*
 **	write an index file
 */
-int GIP_index_write(const GIP_INDEX_T *idx,const char *file,int force,const char *title)
+int GIP_index_write(const GIP_INDEX_T *idx,double framerate,const char *file,int force,const char *title)
 {
 	const GIP_INDEX_ITEM_T *audio;
 	const GIP_INDEX_ITEM_T *video;
 	const GIP_INDEX_ITEM_T *overlay;
 	FILE *fd;
+	char buffer[20];
 
 	/*
 	**	dont allow overwriting if not in force mode
@@ -597,42 +601,42 @@
 		switch (video->type) {
 			case GIP_INDEX_TYPE_TRANSITION:
 				fprintf(fd,"type=%s"
-							",frames=%d"
+							",time=%s"
 							",transition=%s"
 							"\n",
 					   GIP_index_type2str(video->type),
-					   video->frames,
+					   GIP_frames2time(video->frames, framerate, buffer),
 					   GIP_transition_type2str(video->it.transition.type));
 				break;
 			case GIP_INDEX_TYPE_SOLID:
 				fprintf(fd,"type=%s"
-							",frames=%d"
+							",time=%s"
 							",rgb=%s"
 							"\n",
 					   GIP_index_type2str(video->type),
-					   video->frames,
+					   GIP_frames2time(video->frames, framerate, buffer),
 					   video->it.solid.rgb);
 				break;
 			case GIP_INDEX_TYPE_IMAGE:
 				fprintf(fd,"type=%s"
-							",frames=%d"
+							",time=%s"
 							",file=%s"
 							",from_geo=%s"
 							",to_geo=%s"
 							"\n",
 					   GIP_index_type2str(video->type),
-					   video->frames,
+					   GIP_frames2time(video->frames, framerate, buffer),
 					   video->it.image.file,
 					   (video->it.image.from_geo) ? video->it.image.from_geo : GIP_GEOMETRY_PERCENT_100,
 					   (video->it.image.to_geo) ? video->it.image.to_geo : GIP_GEOMETRY_PERCENT_100);
 				break;
 			case GIP_INDEX_TYPE_SCROLL:
 				fprintf(fd,"type=%s"
-							",frames=%d"
+							",time=%s"
 							",file=%s"
 							"\n",
 					   GIP_index_type2str(video->type),
-					   video->frames,
+					   GIP_frames2time(video->frames, framerate, buffer),
 					   video->it.scroll.file);
 				break;
 		}
@@ -645,7 +649,7 @@
 /*
 **	read an index back
 */
-GIP_INDEX_T *GIP_index_read(const char *file,int nogeo,int kenburns)
+GIP_INDEX_T *GIP_index_read(const char *file,int nogeo,int kenburns,double framerate)
 {
 	GIP_INDEX_T *idx = NULL;
 	FILE *fd;
@@ -766,6 +770,25 @@
 							key,GIP_index_type2str(type),file,line_nr);
 				}
 			}
+			else if (!strcasecmp(key,"time")) {
+				/*
+				**	the image times
+				*/
+				switch (type) {
+					case GIP_INDEX_TYPE_AUDIO:
+						audio->frames = GIP_time2frames(val, framerate);
+						break;
+					case GIP_INDEX_TYPE_TRANSITION:
+					case GIP_INDEX_TYPE_SOLID:
+					case GIP_INDEX_TYPE_IMAGE:
+					case GIP_INDEX_TYPE_SCROLL:
+						video->frames = GIP_time2frames(val, framerate);
+						break;
+					default:
+						CRITICAL("key '%s' not allowed for type '%s' in %s:%d\n",
+							key,GIP_index_type2str(type),file,line_nr);
+				}
+			}
 			else if (!strcasecmp(key,"transition")) {
 				/*
 				**	the transition type
diff -Nurd image2mpeg-0.7/src/gip/index.h image2mpeg-0.7ap/src/gip/index.h
--- image2mpeg-0.7/src/gip/index.h	2005-12-12 20:48:19.000000000 +1030
+++ image2mpeg-0.7ap/src/gip/index.h	2007-02-12 19:30:25.000000000 +1030
@@ -199,12 +199,12 @@
 /*
 **	write the index to the given file
 */
-int GIP_index_write(const GIP_INDEX_T *idx,const char *file,int force,const char *title);
+int GIP_index_write(const GIP_INDEX_T *idx,double framerate,const char *file,int force,const char *title);
 
 /*
 **	read an index from a file
 */
-GIP_INDEX_T *GIP_index_read(const char *file,int nogeo,int kenburns);
+GIP_INDEX_T *GIP_index_read(const char *file,int nogeo,int kenburns,double framerate);
 
 /*
 **	free an index
diff -Nurd image2mpeg-0.7/src/gip/Makefile.am image2mpeg-0.7ap/src/gip/Makefile.am
--- image2mpeg-0.7/src/gip/Makefile.am	2005-10-23 01:24:07.000000000 +0930
+++ image2mpeg-0.7ap/src/gip/Makefile.am	2007-02-12 15:46:44.000000000 +1030
@@ -1,5 +1,5 @@
 #
-#   $Id: Makefile.am,v 1.5 2005/10/22 10:11:02 gromeck Exp $
+#   $Id: Makefile.am,v 1.6 2007/02/12 14:55:00 xanni Exp $
 #
 #	Copyright (c) 2004 by Christian Lorenz
 #
@@ -17,6 +17,8 @@
 			color.h \
             geometry.c \
 			geometry.h \
+            times.c \
+			times.h \
             image.c \
 			image.h \
             audio.c \
diff -Nurd image2mpeg-0.7/src/gip/times.c image2mpeg-0.7ap/src/gip/times.c
--- image2mpeg-0.7/src/gip/times.c	1970-01-01 09:30:00.000000000 +0930
+++ image2mpeg-0.7ap/src/gip/times.c	2007-02-12 22:58:55.000000000 +1030
@@ -0,0 +1,131 @@
+/*
+**	$Id: times.c,v 1.1 2007/02/12 14:57:00 xanni Exp $
+**
+**	Copyright (c) 2007 by Andrew Pam
+**
+**	handle times
+**
+**	$Log: times.c,v $
+**	Revision 1.1  2007/02/12 14:57:00  xanni
+**	INITIAL CHECK-IN
+**	
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include "gip.h"
+
+/*
+**	init the API
+*/
+int GIP_times_init(void)
+{
+	return 1;
+}
+
+/*
+**	shutdown the API
+*/
+int GIP_times_exit(void)
+{
+	return 1;
+}
+
+/*
+**	parse a time string and return the number of frames
+**
+**	time strings are of the form
+**
+**		{<hours>:}{<minutes>:}<seconds>
+**		where <seconds> can optionally be a decimal fraction
+*/
+int GIP_time2frames(const char *time, double framerate)
+{
+	int f = 0;
+	long ms;
+	char *s;
+
+	DEBUG("time:%s	framerate:%f\n", time, framerate);
+
+	/*
+	**	no time => use the default
+	*/
+	if (!time)
+		time = "1";
+
+	/*
+	**	handle negative times
+	*/
+	if (time[0] == '-')
+		return -1;
+
+	/*
+	**	find and parse time
+	*/
+	ms = abs(atoi(time));
+
+	/* hours and minutes, if any */
+	if ((s = strchr(time, ':'))) {
+		ms *= 60 + abs(atoi(++s));
+		if ((s = strchr(s, ':')))
+			ms *= 60 + abs(atoi(++s));
+	}
+
+	ms *= 1000;
+	/* fractional seconds, if any */
+	if ((s = strchr(time, '.')))
+	{
+		ms += (*++s - '0') * 100;
+		if (*++s)
+		{
+			ms += (*s - '0') * 10;
+			if (*++s)
+				ms += *s - '0';
+		}
+	}
+
+	/* calculate number of frames with rounding */
+	f = (int) (((ms * framerate) + 500) / 1000);
+
+	DEBUG("time:%s	framerate:%f	ms:%ld	frames:%d\n", time, framerate, ms, f);
+	return f;
+}
+
+/*
+**	convert a number of frames to a time string
+*/
+const char *GIP_frames2time(int frames, double framerate, char *time)
+{
+	if (frames < 0)
+		strcpy(time, "-1");
+	else
+	{
+		double ms = (frames * 1000) / framerate;
+		int h = (int) (ms / (1000 * 60 * 60));
+		int m = (int) (ms / (1000 * 60)) % 60;
+		int s = (int) (ms / 1000) % 60;
+		int f = (int) ((long) ms % 1000);
+		time[0] = '\0';
+		char t[15];
+		DEBUG("frames:%d	framerate:%f	ms:%f	hmsf:%02d:%02d:%02d.%03d\n", frames, framerate, ms, h, m, s, f);
+
+		if (h) {
+			sprintf(t, "%d:", h);
+			strcat(time, t);
+		}
+		if (m) {
+			sprintf(t, (time[0] ? "%02d:" : "%d:"), m);
+			strcat(time, t);
+		}
+		sprintf(t, (time[0] ? "%02d" : "%d"), s);
+		strcat(time, t);
+		if (f) {
+			sprintf(t, ".%03d", f);
+			strcat(time, t);
+		}
+
+		DEBUG("frames:%d	framerate:%f	ms:%f	time:%s\n", frames, framerate, ms, time);
+	}
+	return time;
+}
+
+/**/
diff -Nurd image2mpeg-0.7/src/gip/times.h image2mpeg-0.7ap/src/gip/times.h
--- image2mpeg-0.7/src/gip/times.h	1970-01-01 09:30:00.000000000 +0930
+++ image2mpeg-0.7ap/src/gip/times.h	2007-02-12 19:16:30.000000000 +1030
@@ -0,0 +1,35 @@
+/*
+**	$Id: times.h,v 1.1 2007/02/12 14:50:00 xanni Exp $
+**
+**	Copyright (c) 2007 by Andrew Pam
+**
+**	handle times
+**
+**	$Log: times.h,v $
+**	Revision 1.1  2007/02/12 14:50:00  xanni
+**	INITIAL CHECK-IN
+**	
+*/
+
+#ifndef __GIP_TIMES_H__
+#define __GIP_TIMES_H__ 1
+
+/*
+**	init & shutdown the API
+*/
+int GIP_times_init(void);
+int GIP_times_exit(void);
+
+/*
+**	parse a time string and return the number of frames
+*/
+int GIP_time2frames(const char *time, double framerate);
+
+/*
+**	convert a number of frames to a time string
+*/
+const char *GIP_frames2time(int frames, double framerate, char *time);
+
+#endif
+
+/**/
