Time lapse date stamp overlay

What type of scripts do you need?

Moderator: byronnash

Post Reply
droesch
Posts: 1
Joined: May 4th, 2006, 10:27 am

I have shot thousands of stills that I am now wanting to make a time lapse movie out of. Each still is named with the date and time it was taken. For example 0507270505011.jpg would have been taken yy/mm/dd/hh/mm/ss/(camera ID).

Is there a way to write an expression or script that would overlay the date and time stamp on each image (frame) so as the movie played the date and time would increment accurately? Each still in one frame long.

Are there any plugins that would do something like this?

I recieved this response at wwug.com

---------------------


Put this as an expression for the Source Text of a layer just above your picture layer.

thisComp.layer(index+1).name


--------------------

Eventhough this works it doesn't do exactly what i'm wanting it to do:

I see how the argument (index+1) tells the text layer to look one layer below for the filename but this would mean I would have to paste this text layer above every individual still (each one frame long).

Is there a way to write a variable such as (index+n) where n is the frame number in the comp? This way I could just use one text layer above all the images (each one frame in duration) and the expression would increment by 1 each successive frame. I just don't know the syntax or what functions are available.

Secondly, is there a way to parse the filename to convert it into something more legible? So 0507230004461.jpg would translate into July 23, 2005 - 12:10 AM? I would need to have the expression look at the correct set of digits and do the translation.

If that is not possible, it would be nice to instead be able to lop off the .jpg in the text layer but I suppose I could just mask that off.

Thanks in advance for any light you can shed on this!

Dan
bradshaw1965
Posts: 98
Joined: March 14th, 2006, 2:16 pm
Location: Atlanta, GA
Contact:

....
Secondly, is there a way to parse the filename to convert it into something more legible? So 0507230004461.jpg would translate into July 23, 2005 - 12:10 AM? I would need to have the expression look at the correct set of digits and do the translation.

Okay, I'll bite

Code: Select all

parseDateString('0507230004461.jpg');

function parseDateString(date){

	var year =date.substring(0,2);
	var month = date.substring(2,4);
	var day = date.substring(4,6);
	var hour = date.substring(6,8);
	var minutes =date.substring(8,10);
	var seconds = date.substring(10,12);
	
	switch (month)
	{
		case "01":
			month = 'January';
			break;
		case "02":
			month = 'February';
			break;
		case "03":
			month = 'March';
			break;
		case "04":
			month = 'April';
			break;
		case "05":
			month = 'May';
			break;
		case "06":
			month = 'June';
			break;
		case "07":
			month = 'July';
			break;
		case "08":
			month = 'August';
			break;
		case "09":
			month = 'September';
			break;
		case "10":
			month = 'October';
			break;
		case "11":
			month = 'November';
			break;
		case "12":
			month = 'December';
			break;
		
	}
	
	
   //assume 2000+ for year
   
   year = "20" + year;
   
   if(minutes > 0){
		minuteFormat = ":" + minutes;
	}else{
		minuteFormat = ":00";
	}	
		
	if(hour == 0){
		timeFormat = "12" + minuteFormat + " AM";
	}else if(hour < 12){
		
		timeFormat = hour + minuteFormat + " AM";
		
	}else if(hour > 12 && hour != 24){
		hour = hour - 12;
		
		timeFormat = hour + minuteFormat + " PM";
	}else if(hour == 12){
		timeFormat = hour + minuteFormat + " PM";
	}else if(hour == 24){
		timeFormat = "12" + minuteFormat + " AM";
	}
	
	return month + " " + day + ", " + year + "  - " + timeFormat;
}
But, I can't for the life of me figure out how

0507230004461.jpg

would be

July 23, 2005 - 12:10 AM

instead of

July 23, 2005 - 12:04 AM
Post Reply