分页: 1 / 1

BillyTC - Billy's vfr maker

发表于 : 2013-02-20 1:36
Billy Herrington
BillyTC - Billy's vfr maker

Author: Billy Herrington ( billy {DOT} herrington {DOT} ny {AT} gmail {DOT} com )

Do you feel tired of separating EasyVFR's EasyVFR_Create/EasyVFR_Append?
Do you need to append more than 1022 clips so that EPOutTimeCode/TimeCodeOutPut fails?
Do you hate MindShit's dotNet runtime?
Come on man, Billy with me!

Use as simple Splice (but audio will be killed)
Be calful do not unintentionally append the first clip after *last* clip

[syntax lang="avisynth"]clip1.BillyTC /* call me for the first clip */
\ .BillyTC(clip2) /* then append following clips afterwards */
\ .BillyTC(clip3)
\ .BillyTC(clip4)
\ .BillyTC(clip5)[/syntax]

Now let Billy show you an example of concating 1023 clips!
[syntax lang="avisynth" lines="f"]
/* === Need RecEval, which can be found here: http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=665 === */
global clipA = BlankClip(length=50000).AssumeFPS(24000, 1001)
global clipB = ColorBars().AssumeFPS(60000, 1001)
n = 1023
clipA.RecEval("""Eval("global clip"+String(times)+"="+(times%2==0?"clipB.Trim(0, "+String(times-1)+")":"clipA.Trim(0, "+String(times==1?-1:times-1)+")")+" clip"+String(times))""", n)
clipA.RecEval("""Eval(times==""" + String(n) + """ ? "clip1.BillyTC" : "last.BillyTC(clip"+String("""+String(n+1)+"""-times)+")")""", n)[/syntax]

You will find the output clip has exact 1+2+3+...+1023=523776 frames, with
clip1 = clipA.Trim(0, -1) # 1 frame
clip2 = clipB.Trim(0, 1) # 2 frames
clip3 = clipA.Trim(0, 2) # 3 frames
clip4 = clipB.Trim(0, 3) # 4 frames
clip5 = clipA.Trim(0, 4) # 5 frames
...
clip1022 = clipB.Trim(0, 1021) # 1022 frames
clip1023 = clipA.Trim(0, 1022) # 1023 frames

and timecodes file is:
[syntax lang="ruby" lines="f"]# timecode format v1
Assume 23.976024
0,0,23.976024
1,2,59.940060
3,5,23.976024
6,9,59.940060
10,14,23.976024
15,20,59.940060
21,27,23.976024
28,35,59.940060
36,44,23.976024
45,54,59.940060
55,65,23.976024
66,77,59.940060
...
519690,520709,59.940060
520710,521730,23.976024
521731,522752,59.940060
522753,523775,23.976024
[/syntax]

Enjoy Billy!


Download: [syntax lang="avisynth" lines="f" filename="BillyTC.avsi"]# BillyTC - Billy's vfr maker
#
# Author: Billy Herrington ( billy.herrington.ny@gmail.com )
#
# Do you feel tired of separating EasyVFR's EasyVFR_Create/EasyVFR_Append?
# Do you need to append more than 1022 clips so that EPOutTimeCode/TimeCodeOutPut fails?
# Do you hate MindShit's dotNet runtime?
# Come on man, Billy with me!
#
# Use as simple Splice (but audio will be killed)
# Be calful do not unintentionally append the first clip after *last* clip
#
# clip1.BillyTC /* call me for the first clip */
# \ .BillyTC(clip2) /* then append following clips afterwards */
# \ .BillyTC(clip3)
# \ .BillyTC(clip4)
# \ .BillyTC(clip5)
#
# Now let Billy show you an example of concating 1023 clips!
#
# /* ========== Need RecEval, which can be found here: http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=665 ========== */
# global clipA = BlankClip(length=50000).AssumeFPS(24000, 1001)
# global clipB = ColorBars().AssumeFPS(60000, 1001)
# n = 1023
# clipA.RecEval("""Eval("global clip"+String(times)+"="+(times%2==0?"clipB.Trim(0, "+String(times-1)+")":"clipA.Trim(0, "+String(times==1?-1:times-1)+")")+" clip"+String(times))""", n)
# clipA.RecEval("""Eval(times==""" + String(n) + """ ? "clip1.BillyTC" : "last.BillyTC(clip"+String("""+String(n+1)+"""-times)+")")""", n)
#
# You will find the output clip has exact 1+2+3+...+1023=523776 frames,
# with clip1 = clipA.Trim(0, -1) # 1 frame
# clip2 = clipB.Trim(0, 1) # 2 frames
# clip3 = clipA.Trim(0, 2) # 3 frames
# clip4 = clipB.Trim(0, 3) # 4 frames
# clip5 = clipA.Trim(0, 4) # 5 frames
# ...
# clip1022 = clipB.Trim(0, 1021) # 1022 frames
# clip1023 = clipA.Trim(0, 1022) # 1023 frames
#
# and timecodes file is:
# # timecode format v1
# Assume 23.976024
# 0,0,23.976024
# 1,2,59.940060
# 3,5,23.976024
# 6,9,59.940060
# 10,14,23.976024
# 15,20,59.940060
# 21,27,23.976024
# 28,35,59.940060
# 36,44,23.976024
# 45,54,59.940060
# 55,65,23.976024
# 66,77,59.940060
# ...
# 518671,519689,23.976024
# 519690,520709,59.940060
# 520710,521730,23.976024
# 521731,522752,59.940060
# 522753,523775,23.976024
#
# Enjoy Billy!
#
Function BillyTC(clip c1, clip "c2", string "tc"){

tc = Default(tc, "timecodes_v1.txt")
b2 = Defined(c2)

c1 = c1.KillAudio.NormalFPS
x1 = c1.FramerateNumerator
y1 = c1.FramerateDenominator
f1 = String(pFrac2Str(x1, y1, 6))
n1 = c1.framecount

c2 = b2 ? c2.KillAudio.NormalFPS : NOP
x2 = b2 ? c2.FramerateNumerator : NOP
y2 = b2 ? c2.FramerateDenominator : NOP
f2 = b2 ? String(pFrac2Str(x2, y2, 6)) : NOP
n2 = b2 ? c2.framecount : NOP

Lv = "# timecode format v1"
Ls = "Assume " + f1
L1 = "0," + String(n1-1) + "," + f1
L2 = b2 ? String(n1) + "," + String(n1+n2-1) + "," + f2 : NOP

return b2 ? c1 ++ c2.AssumeFPS(x1, y1)
\ .WriteFileStart(tc, "L2", append=True)
\ : c1.WriteFileStart(tc, "Lv", append=False)
\ .WriteFileStart(tc, "Ls", append=True )
\ .WriteFileStart(tc, "L1", append=True )
}


# Positive Fraction to String
# Workaround for String(24000./1001.)=23.976025, String(120000./1001.)=119.880119
#
Function pFrac2Str(int x, int y, int precision){
return x > y ? String(x/y) + RightStr(String(Float(x%y)/Float(y), "%0."+String(precision)+"f"), precision+1)
\ : String(Float(x)/Float(y), "%."+String(precision)+"f")
}


# Convert any NTSC based framerate to accurate value
# E.g., 23.976xxxxx to exact 24000./1001.
#
Function NormalFPS(clip c){
origFPS = c.framerate
NTSCnum = int(origFPS * 1.001 + 0.5)
epsilon = 0.01

b_conv = c.frameratedenominator!=1 && ( abs(origFPS - NTSCnum / 1.001) < epsilon )
return b_conv ? c.AssumeFPS(NTSCnum*1000, 1001) : c
}
[/syntax]

Re: BillyTC - Billy's vfr maker

发表于 : 2013-02-20 11:53
mawen1250
\Aniki/ Yeah Yeah!

Re: BillyTC - Billy's vfr maker

发表于 : 2013-02-20 14:59
-o-o-304-o-o-
\王♂之♂军♂势/

Re: BillyTC - Billy's vfr maker

发表于 : 2013-02-20 23:13
zhongpang
can't love u more♂

Re: BillyTC - Billy's vfr maker

发表于 : 2013-02-22 20:32
akw28888
Thank you very much!
話說這個和http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=11功能差不多?

Re: BillyTC - Billy's vfr maker

发表于 : 2013-02-22 23:55
yabbay
Ass we can!!

Re: BillyTC - Billy's vfr maker

发表于 : 2015-01-27 18:15
猫耳幽香
不知道啥情况,下载链接挂了,于是贴一个上去。
BillyTC.7z
(1.68 KiB) 下载 115 次