Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
13th July 2013, 16:44 | #1 | Link |
Registered User
Join Date: Jun 2013
Location: Germany
Posts: 44
|
Timer (kinda like ShowTime())
I thought that ShowTime() had not enough functions to it, so I created this script.
It has two functions, timer() and timer_cut(). Requires: Gavino's GRunT plugin - http://forum.doom9.org/showthread.php?t=139337 stickboy's jdl-util - http://avisynth.org/stickboy/jdl-util.avsi Usage: timer(clip clp, string "mode", bool "reverse", int "color", float "size", int "x", int "y", int "align") timer_cut(clip clp, string "mode", int "start", int "end", bool "reverse", bool "showstart", bool "showend", int "color", float "size", int "x", int "y", int "align") timer() adds the timer and has the following options: mode - chose the mode you want to use (whether you want only minutes and seconds, or hours, minutes, seconds and milliseconds, and so on): "hmmss": 0:04:17 "mmss": 04:17 "mss": 4:17 "mssms1": 4:17.3 "mssms2": 4:17.37 "mssms3": 4:17.375 "mssms": 4:17.375 "mmssms1": 04:17.3 "mmssms2": 04:17.37 "mmssms3": 04:17.375 "mmssms": 04:17.375 "hmmssms1": 0:04:17.3 "hmmssms2": 0:04:17.37 "hmmssms3": 0:04:17.375 "hmmssms": 0:04:17.375 reverse - the timer runs backwards, starting with the final time color - color, default is white size - font size x, y - the timer's positional x and y coordinates align - timer position relatively to x, y timer_cut() adds a timer starting at frame a and ending at frame b. Options are the same as in timer() plus these additional options: start, end - start and end frame showstart, showend - If set true the timer will be visible the whole time, starting at frame a and freezing at frame b. of course you can only add the timer at the start or end if you want. Examples: Code:
colorbars().trim(0,3000) import("timer.avs") timer() timer(mode="mssms1",color=color_green,size=66.6) timer_cut(mode="mss",start=500,end=2500,showstart=true,showend=false,size=99.9,x=150,y=200) Code:
blankclip(length=15001,width=320,height=120,fps=1000) import("timer.avs") timer(mode="mssms3",size=85,y=15) PHP Code:
Last edited by djcj; 14th July 2013 at 11:51. |
13th July 2013, 19:56 | #2 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Hi djcj, welcome to the forum and thanks for your initial contributions.
I have a couple of comments on your timer functions. I see you use global variables to pass function parameter values into ScriptClip. This is undesirable as it prevents the function being used more than once (with different arguments) in the same script. A better way is to use the 'args' parameter of the extended version of ScriptClip from the GRunT plugin. I would also make the mode an explicit parameter of function formattime. Because of the way Trim() is used, function timer_cut will not work properly if start is 0 or 1, or if end=framecount-1. (See stickboy's classic post Caveats of using Trim in functions.) This is easier to fix in Avisynth 2.60 as you can use the new length argument of Trim(). |
14th July 2013, 11:19 | #3 | Link | |||
Registered User
Join Date: Jun 2013
Location: Germany
Posts: 44
|
Quote:
Quote:
Quote:
Last edited by djcj; 14th July 2013 at 11:46. |
|||
8th September 2021, 18:02 | #4 | Link | |
Registered User
Join Date: Jan 2018
Posts: 2,150
|
Quote:
|
|
8th September 2021, 18:10 | #5 | Link |
Banana User
Join Date: Sep 2008
Posts: 983
|
|
8th September 2021, 18:21 | #7 | Link | |
Banana User
Join Date: Sep 2008
Posts: 983
|
Quote:
PS: Maybe language barrier... let's rephrase: djcj fixed his script by using function from stickboy's script, he didn't modified stickboy's script. Last edited by VoodooFX; 8th September 2021 at 18:31. |
|
9th September 2021, 00:55 | #9 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,664
|
@kedautinh12
You're not understanding what VoodooFX said.... stickboy's jdl-util WAS NOT updated by djcj. The last time jdl-util was updated was in 2008. There is not an updated version. djcj updated HIS Timer() script in 2013. He did not update stickboy's jdl-util script. |
9th September 2021, 01:36 | #10 | Link | |
Registered User
Join Date: Jan 2018
Posts: 2,150
|
Quote:
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|