Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link |
Registered User
Join Date: Feb 2022
Posts: 86
|
ass2bdnxml – direct ASS to BDNXML+PNG conversion without AviSynth
ass2bdnxml is a command line software that converts ASS files to BDN XML + PNG assets. It is a clone of avs2bdnxml, except that it interfaces directly with libass and does not need AviSynth or an AVS script and has fewer options.
This software was originally written by mia-0 for a project. I have forked it and made some basic fixes, like supporting embedded fonts and setting pixel ratio to render subtitles for anamorphic content. All credits to mia-0 and ps auxw for the software. Usage: Everything is in the readme. Generally, you will not need any advanced options. This should be enough most of the time: Code:
./ass2bdnxml -f 50 -v 1080i ./subtitles.ass -v --video-format Sets the video format. Accepted values: [480i, 576i, 720p, 1080i, 1080p] Default: 1080p -f --fps Sets the FPS. Accepted values: [23.976, 24, 25, 29.97, 50, 59.94] Default: 23.976 -q --quantize Enables image palettization and sets the max number of colours to use. Default: 0 (quantization disabled) -a --fontdir Specify an additional look-up directory for fonts. -s --split Sets the split behaviour and aggressiveness (value in {0, 1, 2, 3}). Default: 0 (Not enabled). -m --splitmargin Sets the minimum vertical and opt. horizontal margins to do a split. Format: VxH (E.g 10x200) -p --par Sets the pixel aspect ratio (PAR) to use in libass (e.g anamorphic clip) Default: libass guess (generally PAR=1) -o --offset Sets the NDF TC offset to shift all of the BDN Timecodes. Default: 00:00:00:00 (no offset) -z --negative Flag to indicate a negative --offset. Ignored if no offset is provided -r --rleopt Flag to prevent usage of palette ID 0 to avoid line encoding error at authoring. -c --copyname Flag to reflect the name of the ASS file to the output XML. -t --trackname Sets the human-readable name of the subtitle track. Default: Undefined -l --language Sets the language of the subtitle track. Default: und -w --render-width Specify the .ass width to use as frame/storage space. Default: video-format width -h --render-height Specify the .ass height to use as frame space/storage space. Default: video-format height -g --hinting Enables soft libass hinting. Default: Not enabled -d --dvd-mode Uses 4 colors and increase contrast to make the subs visually pleasant. Default: Not enabled -x --width-store ASS storage width to use in libass. Default: libass guess (generally 1:1 to video-format unless --par is specified.) -y --height-store ASS storage height to use in libass. Default: libass guess (generally 1:1 to video-format unless --par is specified.) If --quantize N is used: --liq-speed Sets LIQ speed. Lower is better but slower. Value within [1; 10] incl. Default: 4 --liq-quality Sets quantization quality. Values >85 are generally lossless and compress better. Default: 100 --liq-dither Sets the dithering level, value must be within [0; 1.0] incl. Default: 1.0 SUP output ass2bdnxml does not support exporting to SUP. Conversion to SUP/PGS is done by other softwares like SUPer. In this case, image splitting or quantization should NOT be used as SUPer recalculates it internally. Download https://github.com/cubicibo/ass2bdnxml Windows binaries https://github.com/cubicibo/ass2bdnxml/releases/ Last edited by cubicibo; 20th November 2023 at 16:13. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Feb 2022
Posts: 86
|
What error? I don't use Windows but I can build it on macOS and Ubuntu 20.04 without issues (Ubuntu needs libbsd-dev installed and libbsd specified in cflags, also some distrib wants "libpng" rather than "png" in the gcc command line).
Maybe someone knows how to cross compile libass with mingw... I don't. I would recommend to install WSL so you can use all those nifty doom9 tools and filters on your favorite Windows machine but in a Linux command line window ![]() Last edited by cubicibo; 2nd June 2023 at 19:38. |
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: Nov 2010
Posts: 4
|
Error those:
meson builddir The Meson build system Version: 1.1.1 Source dir: \\testproject Build dir: \\testproject\builddir Build type: native build Project name: ass2bdnxml Project version: undefined C compiler for the host machine: cl (msvc 19.36.32532 "��⨬������騩 ��������� Microsoft (R) C/C++ ���ᨨ 19.36.32532 ��� x86") C linker for the host machine: link link 14.36.32532.0 Host machine cpu family: x86 Host machine cpu: x86 Did not find pkg-config by name 'pkg-config' Found Pkg-config: NO Found CMake: \Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.EXE (3.26.0) Run-time dependency libass found: NO (tried cmake) meson.build:6:4: ERROR: Dependency lookup for libass with method 'pkgconfig' failed: Pkg-config binary for machine 1 not found. Giving up. A full log can be found at \\testproject\builddir\meson-logs\meson-log.txt WARNING: Running the setup command as meson [options] instead of meson setup [options] is ambiguous and deprecated. |
![]() |
![]() |
![]() |
#5 | Link | |
Registered User
Join Date: Nov 2010
Posts: 4
|
Quote:
Code:
meson builddir The Meson build system Version: 1.1.1 Source dir: \\testproject Build dir: \\testproject\builddir Build type: native build Project name: ass2bdnxml Project version: undefined C compiler for the host machine: cl (msvc 19.36.32532 " Microsoft (R) C/C++ 19.36.32532 x86") C linker for the host machine: link link 14.36.32532.0 Host machine cpu family: x86 Host machine cpu: x86 Did not find pkg-config by name 'pkg-config' Found Pkg-config: NO Found CMake: \Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.EXE (3.26.0) Run-time dependency libass found: NO (tried cmake) meson.build:6:4: ERROR: Dependency lookup for libass with method 'pkgconfig' failed: Pkg-config binary for machine 1 not found. Giving up. A full log can be found at \\testproject\builddir\meson-logs\meson-log.txt WARNING: Running the setup command as meson [options] instead of meson setup [options] is ambiguous and deprecated. |
|
![]() |
![]() |
![]() |
#6 | Link |
Registered User
Join Date: Feb 2022
Posts: 86
|
There's no pkg-config on windows. You have to specify the (compiled) library paths for libass and libpng.
I would suggest you to try with msys2, you can get pkgconf (equivalent to pkg-config) and directly compiled libass and libpng ready to use with make. Else, you could try to setup the project to be like assrender and to follow the build instructions, which lets you build libass. You would have to find your way with libpng. |
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Feb 2022
Posts: 86
|
I have managed to build ass2bdnxml on Windows. The .exe file can be obtained here: ass2bdnxml.exe v0.3.
|
![]() |
![]() |
![]() |
#9 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,476
|
Many thanks, cubicibo !
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." |
![]() |
![]() |
![]() |
#10 | Link |
Registered User
Join Date: Feb 2022
Posts: 86
|
ass2bdnxml v0.4
This version greatly improve the time accuracy of the output. Combined with SUPer v0.2.0, you can now generate frame accurate masking effects in your (authoring compliant) PGS ![]() In the next version, I will try to add support for libimagequant to output 8-bit palletized PNG for users who want to directly import the PNG in Scenarist BD. At the moment, ass2bdnxml outputs 32-bit images and Scenarist users must execute "pngquant.exe 255 -f --ext .png *.png" on the images. |
![]() |
![]() |
![]() |
#11 | Link | ||
Registered User
Join Date: Feb 2022
Posts: 86
|
ass2bdnxml v0.6a
Image quantization added with libimagequant. DO NOT use image quantization if you generate a BDN XML that will be converted to PGS with SUPer. v0.6a changes Quote:
v0.5 changes Quote:
Last edited by cubicibo; 9th October 2023 at 21:41. |
||
![]() |
![]() |
![]() |
#12 | Link |
Registered User
Join Date: Nov 2023
Posts: 1
|
Hi! Is it possible to add compatibility support for the vsfiltermod plugin? With the help of filter, My ASS subs have more setting options to be able to handle and display some more complex dynamic subtitle effects, and realize more advanced and useful functions, e.g.: importing external image sequences... I have been using avs2bndxml to output xmlPNG, but this project has been discontinued for many years, it needs to write extra AVS scripts to load .dll filters for rendering, and the processing speed is so slow, it basically takes about 10 minutes to convert over thousand lines in ASS subs, which is really maddening.
Recently, I have changed to use ass2bdnxml to convert ASS, the same subtitles only need less than 1 minute, and then with SUPer, to make Blu-ray subtitles, the experience is simply amazing and easier, but the shortcoming is that ass2bdnxml does not have that filter and can not customize the output path, I hope that the project can be perfected, and finally still say thanks to cubicibo brought us such good tools! |
![]() |
![]() |
![]() |
#13 | Link |
Registered User
Join Date: Feb 2022
Posts: 86
|
You are welcome.
I don't think I understand your request. Do you want ass2bdnxml to: 1) Offer the possibility to switch between libass or xy-VSFilter/VSFilterMod to render .ASS input files (or other types of files supported by VSFilter)? Akin to the user option in MPC-HC. 2) Be an actual VapourSynth/AviSynth filter, feed it a clip and expect it to output BDNXML using either libass/VSFilter? VSFilter has tons of dependencies and is much less portable than libass. If it is option #1, maybe. Option #2 is less likely. Also, what's the use case? Shouldn't libass mimicks VSFilter? EDIT: Looked into VSFilterMod, API is barely usable and it is C++, so I cannot add a dll and call it. Sorry, there's not much I can do for that. I will however fix the output path in the future. Last edited by cubicibo; 20th November 2023 at 20:02. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|