Log in

View Full Version : Add Date / Timer


zerowalker
5th December 2013, 12:47
Is there any plugin that works like a Timer with Date?

where you can set like

2013/8/8 12:33:44:492

And then a timer for so itīs "realtime" ?

I know of a Virtualdub plugin, it works perfectly, Except one thing.

It only works fin RGB32, so if my video is YV12, i will have to upsample and downsample it just for some text (which is white and doesnīt even use Chroma in my case).

LoadVirtualDubPlugin("E:\Virtualdub\32 bit - Stable\plugins\addframenumber.vdf", "addframenumber", 0)
addframenumber(10304, 0, 20130530, 63481000, 0, 33, 0, 0, 0, 0, 16777215, 15, 100)


Something like that with the Virtualdub plugin.

If there is anyway to make it work in YV12 it would be great however.


EDIT:

It may work with Overlay, but i donīt know how to make it transparent, except for the Date / Timer.

raffriff42
5th December 2013, 13:59
http://avisynth.nl/index.php/ShowSMPTE
You only have to calculate the time of day in frames for start offset.

See also this faster 'framenumber' plugin:
http://forum.doom9.org/showthread.php?t=91968

zerowalker
5th December 2013, 14:14
What i want it a total date. Not just the frame number (even though the plugin i use has that name), or time during the video.
But i want to be able to choose the date, which will most likely be the time it was created.

Think of it like when you record with a Camera and has a Timestamp. Like that but added afterwards.

Guest
5th December 2013, 14:51
It would be trivial to modify the existing plugins to add a date.

poisondeathray
5th December 2013, 14:54
e.g. you can use subtitle() for the date, with showstmpe() using x,y positions and "offset" for the time

use the same fonts and sizes

zerowalker
5th December 2013, 15:00
So it should be fairly easy to add support for Date, Seconds, ms etc?

The word "trivial" escapes me, but from what i understand it means that it should be easy?

Guest
5th December 2013, 15:04
Trivial in this context means minor. Of course, you need to be able to progam/modify/build plugins, so if you don't have that capability then it is major. :)

If you cannot modify plugins, then use poisondeathray's excellent suggestion.

zerowalker
5th December 2013, 15:06
I know, thatīs what i showed in the first post, that plugin is splendid, but it only works in RGB32.
And well there is also that itīs not that userfriendly, getting the Time(Clock time) through numbers isnīt that fun. I think it translates hours,minutes,seconds and milliseconds to milliseconds, meaning itīs a huge number and itīs not that easy to get what i want fast.
But itīs not really that much of a problem however, could be worse.

zerowalker
5th December 2013, 15:12
Trivial in this context means minor. Of course, you need to be able to progam/modify/build plugins, so if you don't have that capability then it is major. :)

If you cannot modify plugins, then use poisondeathray's excellent suggestion.

Great.

Well havenīt really made any plugins, depends on the looks of the language, i can understand scripts if itīs fairly simple, but DLL files and such stuff is another story.

Well his suggestion works, but not entirely.
As i want 2 timers.

http://s24.postimg.org/tzh1crf6d/Timestamp_Avisynth_Virtualdub_plugin.png

Like that, Clock and continuing timer at top.
Date and Actual video time below.

poisondeathray
5th December 2013, 15:17
You can use 2 calls to ShowSMPTE() for 2 timers

If you want to overlay a timer (e.g. generated from a different program), you can use overlay() with showalpha for transparenecy. The alpha matte needs to be a black/white version of the timer, where the timer "text" is white on a black background .

(I think Overlay() works internally in YUY2 , but Layer() might be able to work in YV12 directly, not sure)

raffriff42
5th December 2013, 15:17
So the VirtualDub plugin is perfect except it's RGB, and all this is to avoid a color space conversion, on an offline timecode window dub? Just use the Vdub plugin and be happy.

zerowalker
5th December 2013, 15:21
Poison, I am trying to get it to work with an overlay, so i put the Virtualdub plugin timer there, the text is white the background is black.
And as itīs RGB it should work, but the actual video is YV12.

But i canīt make the overlay transparent, except for blend, add etc which alters the video.

raffriff42, i donīt want color space conversion, hence why i am having troubles, i can make a black bar with the overlay around it like the picture above. But that is more like a hackish way to solve it.

poisondeathray
5th December 2013, 15:59
Poison, I am trying to get it to work with an overlay, so i put the Virtualdub plugin timer there, the text is white the background is black.
And as itīs RGB it should work, but the actual video is YV12.

But i canīt make the overlay transparent, except for blend, add etc which alters the video.


I don't use vdub's plugin, but I'll try to explain the general concept of Overlay() and transparency so you can use it with vdub or any program in avisynth

The overlay text doesn't have to be "white" - it can be any color. Only the "mask" has to be black & white . The mask layer determines what areas are "transparent" . 100% White areas are seen from the overlay "top" layer, 100% black areas are shown through from the bottom layer . Intermediate "shades of grey" are variable in transparency (ie. a mix of the bottom and top layers). You can think of the overlay layer as "covering on top" of the bottom or base layer , and the mask determines what parts are shown from the top or bottom layer

It goes like this
Overlay(bottom, top, mask=mymask)

If you have white text on black background, you can use the same clip as the mask layer . The mask layer should be the same dimensions as the baseclip

Here is a concrete example you can download with 2 example videos with colored text for the overlay and an avs script . These are xvid/avi
https://www.mediafire.com/?oav559oli1fcnae

color.avi is the colored text overlay layer
white.avi is the mask layer ; the white/black version of the same clip



myoverlay=AVISource("color.avi")

mymask=AVISource("white.avi")

baseclip=Colorbars(640,360, pixel_type="YV12").AssumeFPS(30000,1001)

Overlay(baseclip, myoverlay, mask=mymask)





So if your intended text overlay is white on a black background, you can use that ALSO as the mask layer

I haven't tried this as I don't use the vdub plugin, but it should work . (Overlay can work with overlaying different colorspaces, but it takes the baseclip as the final colorspace)



MyVideo=WhateverSource()

Blankclip(MyVideo)
ConvertToRGB32()
LoadVirtualDubPlugin("E:\Virtualdub\32 bit - Stable\plugins\addframenumber.vdf", "addframenumber", 0)
addframenumber(10304, 0, 20130530, 63481000, 0, 33, 0, 0, 0, 0, 16777215, 15, 100)
MyOverlay=last


Overlay(MyVideo, MyOverlay, mask=MyOverlay)



But if your intended text wasn't white/black you would need a 2nd version that is white/black for the mask layer

Gavino
5th December 2013, 16:49
I think Overlay() works internally in YUY2 , but Layer() might be able to work in YV12 directly, not sure
Overlay() works internally in the equivalent of YV24, so zerowalker will still get the chroma up and downsampling he wanted to avoid, although he will at least avoid YUV<->RGB conversion.

Layer() can work in YUY2 directly, but not YV12.

poisondeathray
5th December 2013, 16:59
Overlay() works internally in the equivalent of YV24, so zerowalker will still get the chroma up and downsampling he wanted to avoid, although he will at least avoid YUV<->RGB conversion.

Layer() can work in YUY2 directly, but not YV12.



Thanks for the clarification, was it overlay() that working internally in YUY2 in avisynth 2.5.x ?

What about subtitle() or showsmpte() or related functions ? Internally can they work in YV12 if the baseclip is YV12 ?

poisondeathray
5th December 2013, 17:15
What about subtitle() or showsmpte() or related functions ? Internally can they work in YV12 if the baseclip is YV12 ?


It looks like there isn't an extra conversion with subtitle


a=colorbars(pixel_type="yv12")
b=a.subtitle("text")

Subtract(a,b).Levels(127, 1, 129, 0, 255)



If there was some other conversion the (amplified) subtract script should detect it


a=colorbars(pixel_type="yv12")
b=a.subtitle("text")

Subtract(a,b.converttoyv24.converttoyv12).Levels(127, 1, 129, 0, 255)

Gavino
5th December 2013, 17:50
Thanks for the clarification, was it overlay() that working internally in YUY2 in avisynth 2.5.x ?
As far I as I know (including since 2.5.7) Overlay has always been the same. It converts everything (base, overlay and mask clips) into an internal YUV 4:4:4 format and converts the output to the original input format.

What about subtitle() or showsmpte() or related functions ? Internally can they work in YV12 if the baseclip is YV12 ?
Yes (as you have discovered).
In general, Avisynth filters will either accept the format you give it or throw an error if it can't be handled directly. Overlay() is the only one I can think of (though there may be others) that does a conversion 'behind the scenes'.

poisondeathray
5th December 2013, 17:52
Thanks gavino

Since subtitle() can overlay "text" and stay in YV12 , wouldn't it possible to make a modified overlay function that is YV12 only ? Or is there some avisynth code or something that prevents that ?

Gavino
5th December 2013, 18:01
There's no overriding reason it couldn't be done - I guess the thinking has been that Overlay() is 'good enough'.

Note that for YV12, you can get a lot of Overlay's functionality via mt_merge() from masktools.

poisondeathray
5th December 2013, 19:33
And I screwed up the mask in my download example above, it was created with a 16-235 Y' mask with xvid, but it should be created a 0-255 Y' mask

levels(16,1,235,0,255,false) will make it a 0-255 Y' clip



myoverlay=AVISource("color.avi")

mymask=AVISource("white.avi").levels(16,1,235,0,255,false)

baseclip=Colorbars(640,360, pixel_type="YV12").AssumeFPS(30000,1001)

o=Overlay(baseclip, myoverlay, mask=mymask)
m=mt_merge(baseclip, myoverlay, mymask, luma=true)
subtract(o, baseclip).Levels(127, 1, 129, 0, 255)
#subtract(m, baseclip).Levels(127, 1, 129, 0, 255)




But here looks like there is no additional loss from colorspace conversion using overlay() or mt_merge() in YV12 . The losses shown in the masked overlay region are probably from xvid compression, and/or levels() filter quantization , but the baseclip otherwise shows no additional loss. If overlay() was working in YV24 or similar, wouldn't there be some loss detected in the non mask region ?

Gavino, can you please clarify ? . Also , mt_merge is faster processing speed wise, correct?
http://forum.doom9.org/showthread.php?t=166469

Gavino
5th December 2013, 19:52
If overlay() was working in YV24 or similar, wouldn't there be some loss detected in the non mask region ?

Gavino, can you please clarify ? . Also , mt_merge is faster processing speed wise, correct?
Overlay() doesn't work in YV24 as such; it uses its own internal 4:4:4 format. I've just had a look at the source code and the chroma up and downsampling it uses is lossless in the non mask region. (It replicates on upsampling and averages on downsampling). So my earlier warning (post #14) was wrong.

Yes, mt_merge() is much faster and uses less memory too.

poisondeathray
5th December 2013, 19:59
Thanks again for the clarification :)

zerowalker
6th December 2013, 01:33
I am a bit confused now.

If i use Overlay, will the source, the thing thatīs NOT the overlay, meaning the actual clip, be altered in anyway?
Cause i read that you say it works in 4:4:4 and some say it down/upsamples everything, and now itīs lossless, so i donīt know whatīs going on.

As The Overlay is just Luma for my sake, White Black will be what i want to use, so it can be well, whatever , YV12 YUY2 i donīt care as there is no color.
But i donīt want the Base/Source to be altered in anyway, which i think all you understood.

Thanks

Gavino
6th December 2013, 01:43
It won't be altered (apart from the area that gets the overlay put on, of course).

Chroma will be internally upsampled and downsampled inside Overlay(), but it is done in a lossless way, ie you end up with the same as you started.

zerowalker
6th December 2013, 02:29
Ah nice, so even the Overlay will be Untouched, meaning if i work with colors it will be lossless?
How can it upsample/downsample without altering it, is it possible to do that on normal videos/images as well, or is it because it uses some unique 4:4:4?

Gavino
6th December 2013, 10:29
When upsampling chroma to convert to 4:4:4, Overlay() simply replicates each chroma pixel 4 times (rather than interpolating). Then when downsampling for the final output, it averages each block of 4, so the end result (in the places that have not been overlaid) is exactly the original value. [(x+x+x+x)/4 = x]

It is possible to do something similar in scripts by using chromaresample="point" in the Convert filters. See here.

zerowalker
6th December 2013, 15:44
Great, thanks!

zerowalker
10th December 2013, 14:23
Is anyone else getting:

Exception WindowsError: 'exception: access violation reading 0x05F62C00' in <bound method PIScriptEnvironment.__del__ of <avisynth.PIScriptEnvironment instance at 0x01F77170>> ignored

These kind of errors when using the plugin with AVSpmod?
It also seems to make saving such a video hard for some reason, it can fail at occasions.

zerowalker
10th December 2013, 16:52
It seems it works fine when i changed Avisynth Version:S

But i noticed a thing, about the plugin.
I hope someone can illuminate why itīs like this, or perhaps fix it.

When it runs on 30fps (probably other framerates), it fails be be accurate, though to a very marginal degree, but itīs there.

If it goes like: 0:00:00:333 , then 666 then 1 sec (333,666 being milliseconds), it will eventually differ, it will turn to 999 instead of 1 sec, then 998,997,996 etc, it goes down by 1 ms, donīt know exactly when.
But after about 1:50 hours, it is about 70ms behind.

Not sure why this is happening, i think itīs an error, and 30fps should mean 30frames = 1 sec, and be the same all the time, but perhaps i am missing something here.

poisondeathray
10th December 2013, 18:22
It seems it works fine when i changed Avisynth Version:S

But i noticed a thing, about the plugin.
I hope someone can illuminate why itīs like this, or perhaps fix it.

When it runs on 30fps (probably other framerates), it fails be be accurate, though to a very marginal degree, but itīs there.

If it goes like: 0:00:00:333 , then 666 then 1 sec (333,666 being milliseconds), it will eventually differ, it will turn to 999 instead of 1 sec, then 998,997,996 etc, it goes down by 1 ms, donīt know exactly when.
But after about 1:50 hours, it is about 70ms behind.

Not sure why this is happening, i think itīs an error, and 30fps should mean 30frames = 1 sec, and be the same all the time, but perhaps i am missing something here.

Is this the vdub plugin ? It seems to work ok here, matches ShowTime() in avisynth

Maybe the timebase of your video file is fractionally off?

Load it with avisynth and AssumeFPS(30) to see if it makes a difference

And I'm still not sure why you're using the vdub plugin when you can do the same thing (and more) with ShowTime(), Subtitle(), ShowSMPTE() in avisynth ?

zerowalker
11th December 2013, 09:00
Yes, oh i can?
Hmm must try those, as if itīs easy i can probably make a script for it.

Have tried AssumeFPS(30) as i thought the same, but it seems to be a fault in the calculation, itīs probably having something like 3339 6669 and when the (9) reaches 0, it becomes 3329 etc, it doesnīt round up, but itīs just a guess.

Edit: ShowSMPTE() does do the clock quite well, though i would like to change it somehow, not it counts 0-30 as 0-1000 ms, i want it to be 0-1000 and 3 digits, as i find it more "accurate".

EDIT 2: i manage to get it working though itīs an extremely hackish way, but i think it will be possible to make a script for it at least:

a=Avisource("Z:\Test\Test - 2012-08-01 05-52-09-377.avi")
BlankClip(length=framecount(a)+377*10000, width=350, height=58, pixel_type="RGB32", fps=1000, fps_denominator=1, audio_rate=48000, channels=2, sample_type="16bit", color=$000000)
ShowSMPTE(offset="05:52:09:00", font="Digital-7 Mono",x=96,y=30, size=32, text_color=$FFFFFF, halo_color=$000000, font_width=0.0, font_angle=0.0)
Subtitle("2012-08-01: ", x=6, y=30, font="Digital-7 Mono", size=32, text_color=$FFFFFF, halo_color=$000000, align=7, spc=0, font_width=0.0, font_angle=0.0, interlaced=False)
Trim(377,0).ShowTime(x=260,y=56,offset_f=0, font="Digital-7 Mono", size=32, text_color=$FFFFFF, halo_color=$000000, font_width=0.0, font_angle=0.0).ChangeFPS(30, linear=false).Crop(6,8,0,0)
c=last
Overlay(a,c, x=10, y=10, opacity=1.0, mode="blend", greymask=true, ignore_conditional=false, pc_range=false)

As you can see, i make a BlankClip thatīs a bit longer than the original clip, and make it 1000fps, else SMPTE wonīt show the ms as i want it.

Then i just add the other stuff, i also Trim(377,0) as you can se the original clip was recorded at that ms.

Far from perfect though, as changing the size will completely mess everything up.
Though perhaps i can use PointResize for that it needed.

I also noticed i liked the Black background which is why i use Overlay, it made the text easier to read.

zerowalker
11th December 2013, 14:59
Okay i am trying to make a script of it, and while it looks like a total mess, itīs working quite well.

function TimeStamp(clip a,int ms)
{
try {assert(false)}
catch(err_msg) {

filename = RightStr(err_msg, FindStr(RevStr(err_msg), "\")-1)
filename2= LeftStr(filename, StrLen(filename) - FindStr(RevStr(filename), "."))
filename3 = RightStr(filename2, 23)
gettime = RightStr(filename3, 12)

time2 = LeftStr(gettime, StrLen(gettime) - 10)+":" +RightStr(gettime, StrLen(gettime) -3 ).LeftStr( StrLen(gettime)-10 )+":"+RightStr(gettime, StrLen(gettime) -6 ).LeftStr( StrLen(gettime)-10 )+":"+RightStr(gettime, StrLen(gettime) -9 )

date=RightStr(filename3, 23).LeftStr( StrLen(filename3)-13 )+"*"
#~ ms =(int)"23"

BlankClip(length=framecount(a)+ms*10000, width=344, height=50, pixel_type="YV12", fps=1000, fps_denominator=1, audio_rate=48000, channels=2, sample_type="16bit", color=$000000)

ShowSMPTE(offset=LeftStr(time2,StrLen(time2)-3)+"00", font="Digital-7 Mono",x=90,y=22, size=32, text_color=$FFFFFF, halo_color=$000000, font_width=0.0, font_angle=0.0)

Subtitle(date, x=0, y=22, font="Digital-7 Mono", size=32, text_color=$FFFFFF, halo_color=$000000, align=7, spc=0, font_width=0.0, font_angle=0.0, interlaced=False)

Trim(ms,0).ShowTime(x=254,y=48,offset_f=0, font="Digital-7 Mono", size=32, text_color=$FFFFFF, halo_color=$000000, font_width=0.0, font_angle=0.0).ChangeFPS(30, linear=false)

#~ subtitle(date)

Overlay(a,last, x=10, y=10, opacity=1.0, mode="blend")

#~ mt_merge( last,a,h=Height(a),w=Width(a))
}
}


Though i have a problem, i canīt convert string to int, is there a way to do that?

And this script works by getting the date/time from the filename, which format should be:

Filename 2012-08-15 06-24-22-325 , for example.

Though while it getīs everything from the file name, it canīt get milliseconds, as i need to the int of that (As i am trimming the clip to get to the ms i want).


If you guys have any suggestions i am all ear, as there is probably some extreme performance problems that can be solved, as when i look at it, i do so much just to achieve something that i guess should be much simpler.

poisondeathray
11th December 2013, 15:58
For ending in ms use ShowTime() - hh:mm:ss.ms

For ending in frames use ShowSMPTE() - hh:mm:ss:frames

zerowalker
11th December 2013, 16:59
The problem is, i canīt use ShowTime as i canīt control the time flow, it starts from 0, i want 1 timer to start from 0, one to start from what i tell it to.

EDIT:
Oh wait, confused the two.
Itīs ShowSMPTE() i use for the non-0 timer, and i have to use ChangeFPS etc to make it work as i want (by making the frames act as ms).


What would be perfect is to have ShowTime and have the option to set where the timer should begin.

zerowalker
17th July 2014, 03:22
Have been trying to get a certain thing to work with the TimeStamp function, hard to explain as i don't know what to call it, but will show you i guess.


So let's say i have a clip, with it's name correctly so i can get the date and time from it.

Clip "timedate.avi"

Then i want to show the timestamp for 10 seconds, just like, an "introduction" or what to call it, as it can be bothersome to have it on all the time at some occasions.
This can be done without any issues.

The problem is, If i want to Cut this video, and "Refresh" so that after a Cut it will show the Timestamp 10 seconds again.
If i just reuse the function, the time will be out of sync and useless, so my guess is that i must somehow ask the video "where are we in the Video time", then use that time to calculate the offset.

However, i am not sure if such information exists, it seems that when you Cut, Avisynth simply discards everything past that, and thinks that the Video actually begins at specified time.

So, i am a bit lost about this, any ideas?

poisondeathray
17th July 2014, 04:29
Have been trying to get a certain thing to work with the TimeStamp function, hard to explain as i don't know what to call it, but will show you i guess.


So let's say i have a clip, with it's name correctly so i can get the date and time from it.

Clip "timedate.avi"

Then i want to show the timestamp for 10 seconds, just like, an "introduction" or what to call it, as it can be bothersome to have it on all the time at some occasions.
This can be done without any issues.

The problem is, If i want to Cut this video, and "Refresh" so that after a Cut it will show the Timestamp 10 seconds again.
If i just reuse the function, the time will be out of sync and useless, so my guess is that i must somehow ask the video "where are we in the Video time", then use that time to calculate the offset.

However, i am not sure if such information exists, it seems that when you Cut, Avisynth simply discards everything past that, and thinks that the Video actually begins at specified time.

So, i am a bit lost about this, any ideas?






Use 2 versions of the clip, one clean, one with timestamp and swap between them. Make your cuts/edits after the timestamp has been applied

You can specify frame ranges with stickboy's remapframes plugin, or similar plugins, or even using trim()



Or


Apply the timestamp to a blank alpha channel overlay, and overlay those ranges where you want it to appear

zerowalker
17th July 2014, 04:34
It seems to be most efficient to use an overlay, the Timestamp itself is on one so will have to use a double.

But still, how can i change the opacity at ranges of choice, thought it was fixed?

poisondeathray
17th July 2014, 05:26
It seems to be most efficient to use an overlay, the Timestamp itself is on one so will have to use a double.

But still, how can i change the opacity at ranges of choice, thought it was fixed?


Did you want to fade it in/out, that sort of thing ? You can animate the opacity parameter of overlay(), or animate the mask black<=>white if that's what you're using

Or hard cuts (on/off) in sections ? This can be done with the trim() or remapframes etc.. methods . You can think of it as you're basically swapping between 2 (or more) versions of the video

zerowalker
17th July 2014, 05:48
Don't really matter, but leaning towards hardcuts.

Currently trying to add some sort of Refresh function, by taking a clean clip and the cut clip, using the framecount to Trim the clean clip after i put a timestamp on it.
Then use that as an overlay on the other clip, and it will then go away after time of choice.

This seems to work, but it's a bit complicated to add within my other function.
I am using the Animate function with opacity Ciel(variable) so it cuts when it reaches 0, (0.1 etc will be 1.0).


FrameCount(RefreshDate) >= 0 ? Eval("""
#~ RefreshDate.Trim(FrameCount(RefreshDate)-FrameCount(c),0)
c=c.Animate(0, 301, "Refresh",RefreshDate,1.0,RefreshDate,0.0)
""") : Eval("""
""")

function Refresh(clip C,Clip D ,float opacity)
{

return C
\ .Overlay(D.TimeStamp("...", 0,false),opacity=(opacity), mode="blend").Trim(FrameCount(D)-FrameCount(C),0)
}

EDIT:

Think i got it working:)

EDIT 2:

Okay it Works, but not as i would want it, i have to use 2 separate functions as it messes up if i Cut.

Avisource("....")
Clean=last
last
Trim(22143,0)
Trim(19762,0)
Animate(0, 301, "Refresh",Clean,1.0,Clean,0.0)
AddIntro(RefreshDate=Clean,Format="RGB32", Font="Victor's Pixel Font", TBC=true)

So, this works, but as you can see i have to use Animate to force the Timestamp there.
Then i use my AddIntro, which, well adds an Intro, and TBC adds Outro if true.

I want it to be built within AddIntro.

Problem is, as AddIntro is adding both an Intro and Outro it has to be put at the bottom of the code after the cutting is done.
And i don't know how to then make a calculation to give it the correct starting point for the Overlay containing the TimeStamp.

Here is the Script:

function AddIntro(clip c,clip "RefreshDate",string "Format",string "Font",bool "TBC",string "Filename")
{
TBC = Default(TBC,False)
Format = Default(Format, "YV12")
Font = Default(Font, "")


RefreshDate = Default(RefreshDate, BlankClip(length=0))
c
Intro=Avisource("R:\Intro.Avi").Zoombox(Width (c), Height (c),ResizeMethod="BicubicResize").ChangeFPS(c)
TBClip=BlankClip(length=90, width=Width(c), height=Height(c), pixel_type="RGB32", fps=30.0, fps_denominator=1, audio_rate=48000, channels=2, sample_type="16bit", color=$000000).ChangeFPS(c)

String=Subtitle("To Be Continued", x=Width(c)/2, y=Height(c)/2, first_frame=0, font="Victor's Pixel Font", size=60, text_color=$FFFFFF, halo_color=$832fc6, align=2, spc=0 ,font_width=0.0, font_angle=0.0, interlaced=False)

FrameCount(RefreshDate) > 0 ? Eval("""

c=c.Animate(0, 301, "Refresh",RefreshDate,1.0,RefreshDate,0.0)
#c=c.Trim(0,Trim-framecount(Intro))
""") : Eval("""
""")


#######################################
Format == "RGB32" ? Eval("""
Intro=Intro.ConvertToRGB32(matrix="Rec601")
TBClip=TBClip.ConvertToRGB32("Rec709")
""") : Format == "YV16" ? Eval("""
Intro=Intro.ConverttoYV16()
TBClip=TBClip.ConverttoYV16("Rec709")
""") : Eval("""
Intro=Intro.ConverttoYV12()
TBClip=TBClip.ConvertToYV12("Rec709")
""")
#Decides the Format with string, RGB32 YV16 or YV12 which is chosen if the others are false
#######################################
Overlay(TBClip, x=0, y=0, opacity=0.0, mode="blend", greymask=true, ignore_conditional=false, pc_range=false)
TBC == True ? Eval("""

Result=Intro++c++TBClip
\.Animate( 0, Round(2.0*FrameRate), "sub_anim_1",
\ "To Be Continued",Font, 0.0, 0.00,
\ "To Be Continued",Font, 0.085, 1.0)
## 2.0*FrameRate => 2 sec
## 1.0/32 => start text height = 1/32 picture height
## 1.5 => end text height = 1.5 picture height
## 0.2 => starting opacity
## 1.5 => ending opacity
""") : Eval("""
Result=Intro++c
""")

#######################################
function sub_anim_1(clip C, string msg,string Font, float size, float opacity)
{
return C.Subtitle(msg, align=2,
\ x=Width(c)/2, y=Height(c)/2,
\font=Font,
\ text_color=to_rgb32i(255, 255, 255, Round(opacity*256.0)),
\ halo_color=to_rgb32i( 184, 47, 198, Round(opacity*256.0)),
\ size=Float(C.Height)*size)

}
#######################################
## given R, G, B, A, return an Avisynth color
##
function to_rgb32i(int r, int g, int b, int a) {
r = Min(Max(0, r), 255)
g = Min(Max(0, g), 255)
b = Min(Max(0, b), 255)
a = 255 - Min(Max(0, a), 255)
return (a*$1000000) + (r*$10000) + (g*$100) + b
}
#######################################
#Refresh Timestamp According To Other Clip
function Refresh(clip C,Clip D ,float opacity)
{

return D
\ .Overlay(D.TimeStamp("Filename", 0,false)
\,opacity=Ceil(opacity), mode="blend").Trim(FrameCount(D)-FrameCount(C),0)
}
return Result
}
function Refresh(clip C,Clip D ,float opacity)
{

return D
\ .Overlay(D.TimeStamp("Filename", 0,false)
\,opacity=Ceil(opacity), mode="blend").Trim(FrameCount(D)-FrameCount(C),0)
}


RefreshDate is the part in question.

Hope my explanation make sense.