View Full Version : How to writefile frames in smpte?


Guest
29th September 2004, 12:54
Hi,
Is there an easy way to framenumbers in smpte to a txt file?
(using writefile)

ShowSmpte is only for writing in the image... I guess :confused:

Tin2tin

Wilbert
29th September 2004, 17:12
There's a way to write framenumbers in a filter. See docs of ConditionalFilter.

Guest
29th September 2004, 17:55
Hi,
I'm not sure if I understand how to use the ConditionalFilter for that purpose?

What I'm trying to figure out is: if there is an easy way to get showsmpte() as a string in order to write it to a txt file.

Or in other words is there a function to convert a framenumber(int) to a smpte-string aka hh:mm:ss:ff?

Tin2tin

tsp
29th September 2004, 20:59
something like this?


avisource("c:\clip.avi")
global f=framerate(last)
logfile="c:\smpte.txt"
writefile(logfile,"showsmpte(current_frame,f)")

function showsmpte(int cf,float fr) #cf=current_frame,fr=framerate
{
hh=int(cf/3600/fr)
mm=int((cf-hh*3600*fr)/60/fr)
ss=int((cf-hh*3600*fr-mm*60*fr)/fr)
ff=int((cf-hh*3600*fr-mm*60*fr-ss*fr))
smpte=string(hh,"%02.0f")+":"+string(mm,"%02.0f")+":"+string(ss,"%02.0f")+":"+string(ff,"%0"+string(int(log(fr)/log(10)))+".0f")
smpte
}

Guest
30th September 2004, 10:17
Yeah! Cool! Thanks!!!

Tin2tin