搜索 社区服务 统计排行 帮助
  • 1726阅读
  • 20回复

[求助]加入图片当作字幕

楼层直达
级别: 新手上路
注册时间:
2004-05-24
在线时间:
0小时
发帖:
94
SSA的字幕可不可以加入图片当作字幕?SSA不是规定了有图片(Picture)事件吗,那如果可以的话,具体要怎么做?
级别: 新手上路
注册时间:
2003-11-16
在线时间:
0小时
发帖:
427
只看该作者 1楼 发表于: 2004-07-14
极影论坛有教程,转一下:
引用
转自http://bbs.ktxp.com/topic.cgi?forum=108&topic=96&show=25 作者:singblue
关于在影片里加入图片:
   其实这个也不是什么新东西,记得以前weilai兄已经有提到过,只是一下找不到那帖所在了,所以在这里重新复习一下,也算是为我那个字幕教程中一直没有解决的关于加载图片的问题的回答吧。
首先,我要说的是:利用SSA或ASS来加载图片,对图片格式有着很严格的要求,好像是要求图片要是“binary format”的,binary format是什么东西我也搞不清楚了(惭愧惭愧)...
然后,继续刚才的话题,加载图片,其实也可以通过VirtualDub/VirtualDubMod来实现:具体操作就是在Video选单中选择Filter然后Add,选择其内置的那个Logo滤镜,[图1]然后加载你想要的图片(*.BMP或*.TGA格式),里面有些简单的设置,我就不再一一说明了,只需要注意一点,如果要对加载的图片设置Alpha值(透明度),首先要把影片的色彩空间改成RGB32。[见图2]
接着,就是我这帖主要想说的内容了:刚才说利用VD/VDM内置的LOGO滤镜就能完成图片加载,但是有一个遗憾就是——VD/VDM不能进行REAL的编码操作,所以要是有朋友想在压制REAL格式时添加图片LOGO就不能用VD/VDM内置的滤镜了。要解决这个问题也不难,利用AVS和外置的VD滤镜logo.vdf就能实现在AVS中加载图片,然后再压制这个AVS就能达到目的。

先给一个简单的AVS脚本的例子:
--------------------------------------------------------------------------------------------------



######################定义LOGO.VDF所在文件夹########################
global VirtualDub_plugin_directory = "E:\DVD2RM\Filter"
##########################加载待处理的影片##########################
AVISource("[OP][Memories Off 想い出にかわる君][Replaymachine].avi")
############################定义“VD_Logo”函数####################
function VD_Logo(clip clip, int "x", int "y", int "alpha", bool "transparent",
\ int "xr", int "xg", int "xb", int "tolerance", string "filename",
\ bool "animate", int "start", int "duration", int "loops",
\ int "fadeinlen", int "fadeoutend", int "fadeoutlen")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\logo.vdf", "_VD_Logo", 1)
return clip._VD_Logo(default(x,0), default(y,0), default(alpha,128),
\ default(transparent,true)?1:0, default(xr,0), default(xg,0), default(xb,255),
\ default(tolerance,0), default(filename,VirtualDub_plugin_directory+"\Gundam SEED.bmp"),
\ default(animate,false)?1:0, default(start,0), default(duration,0), default(loops,0),
\ default(fadeinlen,0), default(fadeoutend,200), default(fadeoutlen,0))
}
###########################调用VD_Logo函数#########################
ConvertToRGB()
VD_logo(480, 10, 255, true, 255, 255, 255, 70, "Memories Off.bmp", true, 70, 0, 0, 50, 243, 50)
##################################################################

上面这个AVS例子中的注释已经说明了该脚本各部分的作用了,下面我再对VD_Logo函数的参数再具体说一下:

function VD_Logo(clip clip, int "x", int "y", int "alpha", bool "transparent",
\ int "xr", int "xg", int "xb", int "tolerance", string "filename",
\ bool "animate", int "start", int "duration", int "loops",
\ int "fadeinlen", int "fadeoutend", int "fadeoutlen")

这个是在函数定义时声明的格式,从中我们可以看到其中每个参数的具体含义,为了更形象,我还是在例子中说明:
-------------------------------------------------------------------
VD_logo(480, 10, 255, true, 255, 255, 255, 70, "bz.bmp", true, 20, 0, 0, 50, 243, 50)
480,10:
图片出现在影片中的X、Y坐标位置;
255:
图片的ALPHA值,即透明度,0为透明,255为不透明,变化范围:0--255 (这个跟SSA字幕中刚好相反)
true, 255, 255, 255, 70:
设置图片的透明通道: true/false 打开/关闭此功能;255, 255, 255 分别对应红(R)、绿(G)、蓝(B)三色;7 为容差我理解为一些图像处理软件中(如PS)阀值的设定;本例中因为我使用的图片的背景是白色的,而我不想要这个白色背景,所以用白色透明通道使其变为透明色了;
"bz.bmp":
这个没什么多说的,就是我加载的图片,(注意如果图片跟AVS不在同一目录下,要把其全路径都写下来);
true:
这个true/false是用来打开序列的静态图片组成的动态效果的设置,序列图片就是这样的形式:Recu0001.bmp ,Recu0002.bmp ,Recu0003.bmp .....RecuXXXX.bmp,只要打开了动态效果,那么AVS就会自动地从第一张图片开始加载这个图片序列;
20:
图片出现时所在影片的帧数;
0:
原函数定义为int "duration",持续时间(是针对图像序列每张图片持续的时间);
0:
原函数定义为int "loops"为循环次数(针对对图像序列);
50:
定义为淡入动作所持续的帧数长度;
243:
图片消失时所在影片的帧数;
50:
定义为淡出动作所持续的帧数长度;

以上就是所有参数的具体含义。
另外,在使用的时候的注意事项:
因为图片只能在RGB色彩空间进行加载,所以必须使用ConvertToRGB()来转换色彩空间;
加载图片时必须保证是24位色的位图(*.BMP),并且该图片要存在,否则输出的图像将会是黑屏;
已知问题:如果改变帧速率,可能造成压制出来的影片是黑屏。
级别: 新手上路
注册时间:
2003-12-28
在线时间:
0小时
发帖:
96
只看该作者 2楼 发表于: 2004-07-14
好复杂呀。还是算了吧。
级别: 工作组
注册时间:
2003-08-26
在线时间:
13小时
发帖:
6600
只看该作者 3楼 发表于: 2004-07-14
上面的函数已经封装得非常完美了……但是………………picture事件肯定可以用的……看来要继续探究

催片请点此处: http://bbs.popgo.org/bbs/read.php?tid=502402&displayMode=1#19103164
级别: 新手上路
注册时间:
2003-12-05
在线时间:
0小时
发帖:
235
只看该作者 4楼 发表于: 2004-07-14
SSA加载EXE,不晓得是个什么效果

どんと来~い、超常現象
级别: 新手上路
注册时间:
2004-01-29
在线时间:
0小时
发帖:
169
只看该作者 5楼 发表于: 2004-07-14
引用
最初由 极品飞翼 发布
极影论坛有教程,转一下:

好笑!!!
转了又转的文章.....
说是极影的是不是有点滑稽啊~~
级别: 新手上路
注册时间:
2003-11-16
在线时间:
0小时
发帖:
427
只看该作者 6楼 发表于: 2004-07-14
因为我不知道首发在哪里嘛!这的确是从极影转过来的,我可没说是已经原创的啊。
级别: 工作组
注册时间:
2003-08-26
在线时间:
13小时
发帖:
6600
只看该作者 7楼 发表于: 2004-07-15
Appendix B: embedded font/picture encoding

SSA’s font and picture file embeddeding is a form of UUEncoding.

It takes a binary file, three bytes at a time, and converts the 24bits of those bytes into four 6-bit numbers. 33 is added to each of these four numbers, and the corresponding ascii character for each number is written into the script file.

The offset of 33 means that lower-case characters cannot appear in the encoded output, and this is why the “filename” lines are always lower case.

Each line of an encoded file is 80 characters long, except the last one, which may be shorter.

If the length of the file being encoded is not an exact multiple of 3, then for odd-number filelengths, the last byte is multiplied by hexadecimal 100, and the most significant 12 bits are converted to two characters as above. For even-number filelengths, the last two bytes are multiplied by hexadecimal 10000, and the most significant 18 bits are converted to three characters as above.

There is no terminating code for the embedded files. If a new [section] starts in the script, or if another filename line is found, or the end of the script file is reached then the file is considered complete.
应该是要求UUE编码

催片请点此处: http://bbs.popgo.org/bbs/read.php?tid=502402&displayMode=1#19103164
级别: 新手上路
注册时间:
2002-12-13
在线时间:
0小时
发帖:
291
只看该作者 8楼 发表于: 2004-07-15
其实用AE加入图片是最简单了
并且可以使用KEYING抠像,ADJUSTMENT等辅助图片特效
级别: 新手上路
注册时间:
2003-11-16
在线时间:
0小时
发帖:
427
只看该作者 9楼 发表于: 2004-07-15
全E文,看不懂。
级别: 新手上路
注册时间:
2004-01-29
在线时间:
0小时
发帖:
169
只看该作者 10楼 发表于: 2004-07-15
引用
最初由 MeteorRain 发布
Appendix B: embedded font/picture encoding

SSA’s font and picture file embeddeding is a form of UUEncoding.

It takes a binary file, three bytes at a time, and converts the 24bits of those bytes into four 6-bit numbers. 33 is added to each of these four numbers, and the corresponding ascii character for each number is written into the script file.

The offset of 33 means that lower-case characters cannot appear in the encoded output, and this is why the “filename” lines are always lower case.

Each line of an encoded file is 80 characters long, except the last one, which may be shorter.

If the length of the file being encoded is not an exact multiple of 3, then for odd-number filelengths, the last byte is multiplied by hexadecimal 100, and the most significant 12 bits are converted to two characters as above. For even-number filelengths, the last two bytes are multiplied by hexadecimal 10000, and the most significant 18 bits are converted to three characters as above.

There is no terminating code for the embedded files. If a new [section] starts in the script, or if another filename line is found, or the end of the script file is reached then the file is considered complete.
应该是要求UUE编码





问一下这个资料是在什么地方找到的, 我想看看全文~~~
级别: 版主
注册时间:
2002-04-23
在线时间:
3小时
发帖:
7693
只看该作者 11楼 发表于: 2004-07-15
vobsub的帮助文件就有

身份 :我是坏人:D
目标 :收齐高达系列:p
请多多支持ftp区啊(顺便edonkey, mirc吧)

偶的业余嗜好:


暴走模式->
级别: 新手上路
注册时间:
2004-01-29
在线时间:
0小时
发帖:
169
只看该作者 12楼 发表于: 2004-07-15
引用
最初由 kiasushou 发布
vobsub的帮助文件就有


>_< 没看到~~~~~
级别: 新手上路
注册时间:
2001-11-21
在线时间:
0小时
发帖:
264
只看该作者 13楼 发表于: 2004-07-15
在ass-specs文档中

这个UUE编码到是明白了,不过还是不知道该怎么用和用在哪里啊……

级别: 新手上路
注册时间:
2004-01-29
在线时间:
0小时
发帖:
169
只看该作者 14楼 发表于: 2004-07-15
曾经试图用 SSA的那个制作软件来实现 PICTURE
结果做出来的东西, VOBSUB不能识别 >_<

晕~~~~
快速回复

限150 字节
上一个 下一个