1 #
\83f
\83t
\83H
\83\8b\83g
\90Ý
\92è
\92l
\r
9 SetFilterMtMode("LanczosResize", 2)
\r
10 SetFilterMtMode("Overlay", 2)
\r
13 #
\90Ý
\92è
\83t
\83@
\83C
\83\8b\82©
\82ç
\83\8d\81[
\83h
\r
14 if(Exist(ScriptDir() + "config.avs")) {
\r
15 Import(ScriptDir() + "config.avs")
\r
17 if(Exist(ScriptDir() + "version.avs")) {
\r
18 Import(ScriptDir() + "version.avs")
\r
23 function AdjustLength(clip clip)
\r
25 alen = clip.AudioDuration
\r
26 vlen = 1.0 * clip.FrameCount / clip.FrameRate
\r
28 video = clip.KillAudio()
\r
29 audio = clip.KillVideo()
\r
32 d = Int((vlen - alen) * video.FrameRate)
\r
33 audio = audio + clip.BlankClip(length=d).KillVideo()
\r
37 d = Int((alen - vlen) * video.FrameRate)
\r
38 video = video + video.BlankClip(length=d)
\r
41 return AudioDub(video, audio)
\r
45 function TimeCode(clip clip, int "x_offset", int "y_offset", int "bg_color")
\r
47 x_offset = Default(x_offset, 0)
\r
48 y_offset = Default(y_offset, 0)
\r
49 bg_color = Default(bg_color, color_black)
\r
52 x = Int(WIDTH / 2 + x_offset)
\r
53 y = Int(70 * (HEIGHT / 1080.0) + y_offset)
\r
54 size = Int(70 * (HEIGHT / 1080.0))
\r
56 bg = clip.BlankClip(width = Int(710 * (WIDTH / 1920.0)), height = Int(75 * (HEIGHT / 1080.0)), color=bg_color).ConvertToRGB24().ConvertToRGB32()
\r
59 clip = clip.layer(bg, op="mul", x = Int(x - bg.width / 2), y = Int(70 * (HEIGHT / 1080.0)), level=100)
\r
61 clip = clip.ScriptClip( "Subtitle(GetTimeCode(current_frame, FrameRate()), " \
\r
62 + "x=" + String(x) + ", " \
\r
63 + "y=" + String(y) + ", " \
\r
64 + "size=" + String(size) + ", " \
\r
65 + "font=" + Chr(34) + "Migu 1P"+ Chr(34) + "," \
\r
66 + "text_color=color_white, " \
\r
67 + "halo_color=$FF000000, " \
\r
75 function GetTimeCode(float current_frame, float frame_rate) {
\r
77 current_time = current_frame / frame_rate
\r
78 h = Int(current_time / 3600)
\r
79 m = Int(Int(current_time) % 3600 / 60)
\r
80 s = Int(Int(current_time) % 60)
\r
81 fr = (current_time - Int(current_time)) * frame_rate
\r
85 timecode = String(frame_rate, "%0.2f") + "fps/TCR " + String(h, "%02.0f") + ":" + String(m, "%02.0f") + ":" + String(s, "%02.0f") + ":" + String(fr, "%02.0f")
\r
91 function LoadAVI(string filepath)
\r
95 LanczosResize(WIDTH, HEIGHT)
\r
98 Subtitle(filepath, align=1, x=0, y=20, size=20)
\r
99 ShowSMPTE(x = WIDTH - 50, y = 20, size = 20)
\r