TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua

 找回密码
 新人加入
查看: 3020|回复: 0

[libtcas] TCAS File Merger [复制链接]

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

发表于 2011-10-27 13:45:16 |显示全部楼层
Reasons to Merge

1. Since each invocation of TcasSub will create a frame buffer which is just the same size as the video resolution, e.g. for a 720p video, 1280 * 720 * 4 bytes of buffer will be created for each frame with each TcasSub invocation. So if we can merge two TCAS files into one, we can save the resource and time of allocating extra buffers.
2. By merging, we can also save some I/O


How We Can Merge

1. Think of the parsed TCAS file. If the two TCAS files have certain common properties, we can parse the two at the same time into one single TCAS file.
2. Actually, we even do not need the two files have some common properties. Again, think of the rendering of TCAS files into a single video, we just use two TcasSub invocation, regardless of the types or properties the TCAS file has.
3. So, we can negotiate the two to make a common header.
4. But to simplify the process, and concentrate on the practical use, we require the two TCAS files have the same type resolution and frame rate.


Common Header for the Output TCAS Files

1. Except for minTime maxTime and chunks, the header of the output TCAS file simply copies the header of the first input TCAS file, since the two input files have all that things in common.
2. the minTime and maxTime is calculated through min(minTime1, minTime2) and max(maxTime1, maxTime2)




您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-3-28 21:55

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH