【自荐】Ass-shifter 字幕批量偏移工具

因为发布时间是August Second Saturday,所以叫ass-shifter

Ass-shifter

是一个用来批量对ass字幕添加偏移的命令行小工具。

注意,工具会直接替换原文件,操作前请记得备份。

平台

  • Windows
  • Linux
  • MacOS

软件开源,可自行编译至更多平台。

用法

ass-shifter [path] -t [shift ms]

  Positional Variables:
    path   the subtitle path to shift (Required)
  Flags:
       --version       Displays the program version string.
    -h --help          Displays help with available flag, subcommand, and positional value parameters.
    -t --shift         shift ms (default: 0)
    -s --start         start from HH:MM:SS
    -e --end           end at HH:MM:SS
    -sr --startRegexp  start from regular expression
    -er --endRegexp    end at regular expression
    -d --dry           dry run

用例

ass-shifter ../Better.Call.Saul/S06 -t -3200 -s 0:06:13

Better.Call.Saul.S06E01.2022.1080p.WEB-DL.x265.10bit.ass
From 0:06:13.00 to end, 1152 lines shifted 3200ms

Better.Call.Saul.S06E02.2022.1080p.WEB-DL.x265.10bit.ass
From 0:06:13.00 to end, 1222 lines shifted 3200ms

...

Better.Call.Saul.S06E12.2022.1080p.WEB-DL.x265.10bit.ass
From 0:06:13.00 to end, 1035 lines shifted 3200ms

Better.Call.Saul.S06E13.2022.1080p.WEB-DL.x265.10bit.ass
From 0:06:13.00 to end, 1629 lines shifted 3200ms

[Info] 13 subtitle files updated.

下载

2 个赞

什么歪屁股的东西呀~

1 个赞

v1.0.0 版本更新

添加了对 .srt 格式的支持

V1.1.0 版本更新

现在你可以对指定时间片段的字幕进行偏移操作了。

正好要用到:heart_hands::heart_hands::heart_hands:

1 个赞

v1.2.0 版本更新

  • 现在支持了使用正则表达式进行时间范围的约束。
  • 添加了dry run,方便测试。

示例:

ass-shifter ../Better.Call.Saul/S06 -sr "第.季\s*第.+集" -t 3234 --dry

Better.Call.Saul.S06E01.2022.1080p.WEB-DL.x265.10bit.ass
From 0:05:32.87 to end, 1155 lines shifted 3234ms

Better.Call.Saul.S06E02.2022.1080p.WEB-DL.x265.10bit.ass
From 0:07:20.77 to end, 1221 lines shifted 3234ms

...

Better.Call.Saul.S06E11.2022.1080p.WEB-DL.x265.10bit.ass
From 0:01:39.00 to end, 1387 lines shifted 3234ms

Better.Call.Saul.S06E12.2022.1080p.WEB-DL.x265.10bit.ass
From 0:02:50.43 to end, 1145 lines shifted 3234ms

Better.Call.Saul.S06E13.2022.1080p.WEB-DL.x265.10bit.ass
From 0:05:17.70 to end, 1651 lines shifted 3234ms

[Info] Dry run, no file changes.