avs2bdnxml 制作SUP格式字幕 | ASS/SSA/SRT字幕转SUP

标签: none

当混流的视频时候需要SUP字幕文件的时候可以通过avs2bdnxml 把ASS/SSA/SRT字幕转换成SUP格式的.适合一些低级的高清播放机播放特效字幕.

AviSynth rendered subtitles to BluRay SUP/PGS and BDN XML (v2.08)

作者没有提供已经构建好的版本.所以需要自行构建.
首先下载源码 avs2bdnxml v2.09 (备用下载址)

1.如果你想自己构建一个exe, 建议在安装了开发环境(gcc)的linux下执行make 即可.

2.准备字幕。使用一般格式(SRT 或者 ASS/SSA)生成字幕,也可以预先生成RGBA视频。

3.创建一个AviSynth脚本, 制作普通的SUP字幕可以参考这个:

video=AviSource("video.avi")
# This requires at least VSFilter 2.39
MaskSub("subtitles.ext",video.width,video.height,video.framerate,video.framecount)

实例:
srttosup.avs
Annihilation.2018.1080p.BluRay.x264.Atmos.TrueHD7.1-HDChina.ass

video=LWLibavVideoSource("X:\zip2\00800.1.hevc")
MaskSub("C:\Users\Desktop\Annihilation.2018.1080p.BluRay.x264.Atmos.TrueHD7.1-HDChina.ass",1920,video.height, video.framerate,video.framecount)

如果创建RGBA 视频,可以参考这个:

AviSource("subtitles_RGBA.avi")
FlipVertical()

4.运行程序 使用cmd

avs2bdnxml -t Undefined -l und -v 1080p -f 23.976 -b1 -o output.xml input.avs

5.For some programs, you have to convert the PNG files to 8bit RGBA palette. avs2bdnxml can do this for you, using the -p switch. This isn't necessary for BDSupEdit.

6.You get BDN XML in the following format:

<?xml version="1.0" encoding="UTF-8"?>
<BDN Version="0.93" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="BD-03-006-0093b BDN File Format.xsd">
<Description>
<Name Title="Undefined" Content=""/>
<Language Code="und"/>
<Format VideoFormat="[ 480i / 480p / 576i / 720p / 1080i /1080p ]" FrameRate="[ 23.976 / 24 / 25 / 29.97 / 50 / 59.94 ]" DropFrame="false"/>
<Events LastEventOutTC="00:00:00:00" FirstEventInTC="00:00:00:00" ContentInTC="00:00:00:00"
ContentOutTC="00:00:00:00" NumberofEvents="[ number of encoded frames ]" Type="Graphic"/>
</Description>
<Events>
<Event Forced="[ False / True ]" InTC="00:00:00:00" OutTC="00:00:00:00">
<Graphic Width="0" Height="0" X="0" Y="0">000000.png</Graphic>
</Event>
</Events>
</BDN>

7.Use a program like BDSupEdit or BDSup2Sub to convert the BDN XML stuff to a BD-SUP file. The rest is left as an exercise for the reader.

AVS to BluRay SUP/PGS and BDN XML


扫描二维码,在手机上阅读!

已有 4 条评论

  1. 豆豆 豆豆

    知道了。刚刚看了https://forum.doom9.org/showthread.php?t=146493这个帖子。感谢。

  2. 豆豆 豆豆

    大佬,你好。请问MaskSub("C:UsersDesktopAnnihilation.2018.1080p.BluRay.x264.Atmos.TrueHD7.1-HDChina.ass",1920,video.height, video.framerate,video.framecount)这里的video.framecount总帧数怎么才能知道?给我一个字幕文件,我如何才能知道这个字幕一共有多少帧?

    1. video.framecount 这里的 video 是第一行设置的变量,不需要自己指定. 程序会自己处理总帧数.

      1. 豆豆 豆豆

        假如没有视频文件,只有ass字幕,这样可以知道字幕的总帧数吗?

添加新评论