分页: 1 / 1

[AVS插件]TimeCodeOutPut:合并多个Clip并输出TimeCode文件

发表于 : 2010-09-20 22:12
cunhan
下载:
请至http://code.google.com/p/cunhan-media-tools/
下载AvsFilterNet.dll和TimeCodeOutPut.dll两个文件

插件详情请往下看
--------------------------------------------
这是一个基于AvsFilterNet(http://avsfilternet.codeplex.com/)二次开发的AVS滤镜

我们在处理片源的时候,往往会手动分段,做不同的处理。
当分段比较多,而且混杂有改变帧数操作(如decimate,MCBob等)的情况下,想手写timecode,就得逐段阅览,并计算始末帧的位置,但这是一件很烦人而且容易出错的事情。
这个插件就是为了从这种数数字的地狱中解脱出来而开发的。
使用出现RP问题,欢迎猛击PM骚扰。

运行环境:
AviSynth2.5 .Net Framework 2.0
注:此滤镜在windows7 32bit下开发和调试,假如在其他window系统下有问题,欢迎报告。

功能:
把若干个不同帧率的clip合并,并输出对应的timecode(format v1)文件。
只需以播放器/VMD/AvsP等打开avs,timecode文件即能生成,不需要像tfm的log那样完整地跑一遍。

Todo:
输出v2格式 timecode

加载滤镜:
由于是基于AvsFilterNet做二次开发的插件,所以加载形式有点特殊
LoadPlugin("AvsFilterNet.dll")
LoadNetPlugin("TimeCodeOutPut.dll")
还有另外两种加载方法,详见AvsFilterNet主页

语法:
TimeCodeOutPut(clip c, clip c1, [...], string tcfile="TimeCode.txt", string input="")
参数说明:
c, c1,[...] —— 待合并的clip
tcfile —— 输出的timecode文件,默认值为“TimeCode.txt”, 若不指定该值,则会在当前目录下生成名为TimeCode.txt的文件。
input —— 此值为第一个clip c指定tc文件(format v1 only)。若留空,表示clip c为constant frame rate。
待合并的clip数量最大为1022(实测). 当超过这个数字时,filter就会抱怨too many argument(max is 1024)。

例子1:
newclip = TimeCodeOutPut(c, c1, c2)
其效果等价于
newclip = c.assumefps(c.framerate) ++ c1.assumefps(c.framerate) ++ c2.assumefps(c.framerate)
并输出timecode文件TimeCode.txt,其内容为
# timecode format v1
Assume last.framerate
0,c.framecount-1,c.framerate
c.framecount,c.framecount+c1.framecount-1,c1.framerate
c.framecount+c1.framecount,c.framecount+c1.framecount+c2.framecount-1,c2.framerate
例子2:
newclip = TimeCodeOutPut(c, c1, c2, tcfile="tcv1.txt")
效果同例子1,只是生成的文件名为tcv1.txt

例子3:
newclip = TimeCodeOutPut(c, c1, c2, tcfile="tcv1.txt")
newclip1 = TimeCodeOutPut(newclip, c3, tcfile="n_tcv1.txt" input="tcv1.txt")或者newclip1 = newclip.TimeCodeOutPut(c3, tcfile="n_tcv1.txt" input="tcv1.txt")
此例子中,使用TimeCodeOutPut把c,c1,c2三个clip合并成newclip,并输出tc文件tcv1.txt
然后,再把newclip和c3合并成newclip1,通过input参数指定newclip对应的tc文件tcv1.txt,输出newclip1的tc文件n_tcv1.txt。

例子4:
newclip = TimeCodeOutPut(c, c1, c2, tcfile="tcv1.txt")
newclip1 = TimeCodeOutPut(newclip, c3, tcfile="tcv1.txt" input="tcv1.txt")
tcfile和input可以指定为同一个文件,当然,该文件作为input时的内容最终会被修改成tcfile的内容。

changlog:
2010-9-30: v0.3,加入append模式,使用语法有所改变。