级别: 新手上路
- 注册时间:
- 2005-02-19
- 在线时间:
- 0小时
- 发帖:
- 31
|
采用笨办法,10个循环,图片采用最初从Gif Movie Gear保存下来的原始尺寸的png图片,由于gif图片帧率为12.5frm/s,差不多是影片23.975frm/s的一半,故每2帧对应1幅动画
引用 v1=AviSource("G:\gif\jpg\s01.avi").converttorgb32 p1=ImageReader("G:\Sample\pics\png\01.png").converttorgb32.flipvertical() p2=ImageReader("G:\Sample\pics\png\02.png").converttorgb32.flipvertical() p3=ImageReader("G:\Sample\pics\png\03.png").converttorgb32.flipvertical() p4=ImageReader("G:\Sample\pics\png\04.png").converttorgb32.flipvertical() p5=ImageReader("G:\Sample\pics\png\05.png").converttorgb32.flipvertical() p6=ImageReader("G:\Sample\pics\png\06.png").converttorgb32.flipvertical() v2=trim(v1,0,124).converttorgb32 v11=trim(v1,125,126).Layer(p1,"add",255,0,0) v12=trim(v1,127,128).Layer(p2,"add",255,0,0) v13=trim(v1,129,130).Layer(p3,"add",255,0,0) v14=trim(v1,131,132).Layer(p4,"add",255,0,0) v15=trim(v1,133,134).Layer(p5,"add",255,0,0) v16=trim(v1,135,136).Layer(p6,"add",255,0,0) v21=trim(v1,137,138).Layer(p1,"add",255,0,0) v22=trim(v1,139,140).Layer(p2,"add",255,0,0) v23=trim(v1,141,142).Layer(p3,"add",255,0,0) v24=trim(v1,143,144).Layer(p4,"add",255,0,0) v25=trim(v1,145,146).Layer(p5,"add",255,0,0) v26=trim(v1,147,148).Layer(p6,"add",255,0,0) v31=trim(v1,149,150).Layer(p1,"add",255,0,0) v32=trim(v1,151,152).Layer(p2,"add",255,0,0) v33=trim(v1,153,154).Layer(p3,"add",255,0,0) v34=trim(v1,155,156).Layer(p4,"add",255,0,0) v35=trim(v1,157,158).Layer(p5,"add",255,0,0) v36=trim(v1,159,160).Layer(p6,"add",255,0,0) v41=trim(v1,161,162).Layer(p1,"add",255,0,0) v42=trim(v1,163,164).Layer(p2,"add",255,0,0) v43=trim(v1,165,166).Layer(p3,"add",255,0,0) v44=trim(v1,167,168).Layer(p4,"add",255,0,0) v45=trim(v1,169,170).Layer(p5,"add",255,0,0) v46=trim(v1,171,172).Layer(p6,"add",255,0,0) v51=trim(v1,173,174).Layer(p1,"add",255,0,0) v52=trim(v1,175,176).Layer(p2,"add",255,0,0) v53=trim(v1,177,178).Layer(p3,"add",255,0,0) v54=trim(v1,179,180).Layer(p4,"add",255,0,0) v55=trim(v1,181,182).Layer(p5,"add",255,0,0) v56=trim(v1,183,184).Layer(p6,"add",255,0,0) v61=trim(v1,185,186).Layer(p1,"add",255,0,0) v62=trim(v1,187,188).Layer(p2,"add",255,0,0) v63=trim(v1,189,190).Layer(p3,"add",255,0,0) v64=trim(v1,191,192).Layer(p4,"add",255,0,0) v65=trim(v1,193,194).Layer(p5,"add",255,0,0) v66=trim(v1,195,196).Layer(p6,"add",255,0,0) v71=trim(v1,197,198).Layer(p1,"add",255,0,0) v72=trim(v1,199,200).Layer(p2,"add",255,0,0) v73=trim(v1,201,202).Layer(p3,"add",255,0,0) v74=trim(v1,203,204).Layer(p4,"add",255,0,0) v75=trim(v1,205,206).Layer(p5,"add",255,0,0) v76=trim(v1,207,208).Layer(p6,"add",255,0,0) v81=trim(v1,209,210).Layer(p1,"add",255,0,0) v82=trim(v1,211,212).Layer(p2,"add",255,0,0) v83=trim(v1,213,214).Layer(p3,"add",255,0,0) v84=trim(v1,215,216).Layer(p4,"add",255,0,0) v85=trim(v1,217,218).Layer(p5,"add",255,0,0) v86=trim(v1,219,220).Layer(p6,"add",255,0,0) v91=trim(v1,221,222).Layer(p1,"add",255,0,0) v92=trim(v1,223,224).Layer(p2,"add",255,0,0) v93=trim(v1,225,226).Layer(p3,"add",255,0,0) v94=trim(v1,227,228).Layer(p4,"add",255,0,0) v95=trim(v1,229,230).Layer(p5,"add",255,0,0) v96=trim(v1,231,232).Layer(p6,"add",255,0,0) v01=trim(v1,233,234).Layer(p1,"add",255,0,0) v02=trim(v1,235,236).Layer(p2,"add",255,0,0) v03=trim(v1,237,238).Layer(p3,"add",255,0,0) v04=trim(v1,239,240).Layer(p4,"add",255,0,0) v05=trim(v1,241,242).Layer(p5,"add",255,0,0) v06=trim(v1,243,244).Layer(p6,"add",255,0,0) v3=trim(v1,245,0).converttorgb32 return v2+v11+v12+v13+v14+v15+v16+v21+v22+v23+v24+v25+v26+v31+v32+v33+v34+v35+v36+v41+v42+v43+v44+v45+v46+v51+v52+v53+v54+v55+v56+v61+v62+v63+v64+v65+v66+v71+v72+v73+v74+v75+v76+v81+v82+v83+v84+v85+v86+v91+v92+v93+v94+v95+v96+v01+v02+v03+v04+v05+v06+v3
动画从第5秒开始出现,5*25=125frm,持续4.8秒,9.8*25=245frm
ffdshow由于脚本行数受到限制,当语句过多时将无法加载;
将10个循环的avs脚本直接从Helix Producer Plus中打开,但动画出现后出现急速翻转现象;
若通过VirtualDubMod中的"Open video file(s) via AVIsynth"打开avs脚本,通过移动关键帧开始也会出现动画的翻转现象,但多移动几次后则正常显示,此时再按上面的方法压缩保存即可
|