Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove ass effects end with '}' #2

Merged
merged 2 commits into from
Jul 29, 2014
Merged

remove ass effects end with '}' #2

merged 2 commits into from
Jul 29, 2014

Conversation

songzhou21
Copy link
Contributor

有些 ass 特效不能清除干净,他们都是以 ‘}’ 字符结尾。详见http://cl.ly/image/0t0C1y381r1f

有些 ass 特效不能清除干净,他们都是以 ‘}’ 字符结尾。详见http://cl.ly/image/0t0C1y381r1f
@sorz
Copy link
Owner

sorz commented Jul 27, 2014

这些特效都是以}结尾的,但是否所有}结尾的都是这种特效?

@songzhou21
Copy link
Contributor Author

确实欠考虑,不过很少正常字幕以 "}" 结尾。—
Sent from Mailbox

On Sun, Jul 27, 2014 at 10:54 PM, Shell Chen notifications@github.com
wrote:

这些特效都是以}结尾的,但是否所有}结尾的都是这种特效?

Reply to this email directly or view it on GitHub:
#2 (comment)

@songzhou21
Copy link
Contributor Author

我下载的人人影视 ass 字幕,它的某些特效是以 {\p0} 结尾。所有以 {\p0} 结尾的字幕绝大部分应该是特效吧。

@sorz
Copy link
Owner

sorz commented Jul 29, 2014

Google 到一个文档 http://moodub.free.fr/video/ass-specs.doc
这应该属于 Appendix A: Style override codes, Drawings 的那部分,
那些没删去字母、数字属于 Drawing commands

Commands must appear after {\p1+} and before {\p0}. (except for \clip(..))
Drawings must always start with a move to command.

写个正则把 \p1(或 \p2\p3…) 与 \p0 之间的内容去掉吧?
还要注意大括号 { } 内可以有多个命令连写。

@songzhou21
Copy link
Contributor Author

{\p0} 结尾的基本都是对 srt 无意义的,全部去掉也无妨。像你这样去掉就会只有时间线,而没内容了,跟全部去掉在播放时效果一样。不过这样不会误操作而删除 srt 需要的 '{\p0}',只是可能性很低。

@sorz
Copy link
Owner

sorz commented Jul 29, 2014

最好是能按规范来处理吧,能够尽可能适应不同的字幕。

sorz added a commit that referenced this pull request Jul 29, 2014
remove drawing command
@sorz sorz merged commit 183ee9b into sorz:master Jul 29, 2014
@sorz
Copy link
Owner

sorz commented Jul 29, 2014

感谢!

@songzhou21
Copy link
Contributor Author

我自己后来把判断条件改成了 line.endswith('{/p0}'},这样错误率会少很多。其实要感谢开发者,帮我省了很多看视频使用字幕的麻烦(VLC 对 ass 字幕支持的很不好)。—
Sent from Mailbox

On Tue, Jul 29, 2014 at 11:55 PM, Shell Chen notifications@github.com
wrote:

Merged #2.

Reply to this email directly or view it on GitHub:
#2 (comment)

@sorz sorz mentioned this pull request Jul 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants