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.

 

Go Back   Doom9's Forum > General > Subtitles

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th May 2023, 17:33   #1  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 74
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

-f --fps          Sets the FPS. Accepted values: [23.976, 24, 25, 29.97, 50, 59.94]         Default: 23.976
-v --video-format Sets the video format. Accepted values: [480i, 576i, 720p, 1080i, 1080p]  Default: 1080p
-t --trackname 	  Sets the human-readable name of the subtitle track.                       Default: Undefined
-l --language 	  Sets the language of the subtitle track.                                  Default: und
-d --dvd-mode 	  Uses 4 colors and increase contrast to make the subs visually pleasant.   Default: Not enabled
-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
-p --par          Set the pixel aspect ratio (PAR) to use in libass (e.g anamorphic clip)   Default: libass guess (generally PAR=1)
-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.)
-a --fontdir      Additional font directory for font look-up.
-s --split        Perform event splitting across 2 graphic files whenever possible.         Default: Not enabled.
XML + PNG assets are created in the current working directory.

SUP output and splitting
ass2bdnxml does not support exporting to SUP. Conversion to SUP/PGS is done by other softwares like SUPer. In this case, image splitting should not be used as SUPer recalculates the splits internally.

Download
https://github.com/cubicibo/ass2bdnxml

Windows binaries
https://github.com/cubicibo/ass2bdnxml/releases/

Last edited by cubicibo; 26th July 2023 at 22:02.
cubicibo is offline   Reply With Quote
Old 2nd June 2023, 18:05   #2  |  Link
HPotter
Registered User
 
Join Date: Nov 2010
Posts: 4
Hi, tried to Build this one from git, but failed.
Could you pls provide builded .exe version for Windows?
HPotter is offline   Reply With Quote
Old 2nd June 2023, 19:32   #3  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 74
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.
cubicibo is offline   Reply With Quote
Old 2nd June 2023, 20:26   #4  |  Link
HPotter
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.
HPotter is offline   Reply With Quote
Old 3rd June 2023, 12:51   #5  |  Link
HPotter
Registered User
 
Join Date: Nov 2010
Posts: 4
Quote:
Originally Posted by cubicibo View Post
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
Error those:

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.
HPotter is offline   Reply With Quote
Old 3rd June 2023, 13:48   #6  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 74
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.
cubicibo is offline   Reply With Quote
Old 24th July 2023, 20:40   #7  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 74
Latest version adds event splitting across two graphics whenever possible. This may be handy to reduce PG buffer usage with some authoring tools.
cubicibo is offline   Reply With Quote
Old 26th July 2023, 22:03   #8  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 74
I have managed to build ass2bdnxml on Windows. The .exe file can be obtained here: ass2bdnxml.exe v0.3.
cubicibo is offline   Reply With Quote
Old 27th July 2023, 13:06   #9  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,406
Many thanks, cubicibo !
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 27th August 2023, 12:05   #10  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 74
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.
cubicibo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.