A tool to convert and tweak bitmap based subtitle streams
BDSup2Sub is a tool initially created to convert captions demuxed from a Blu-Ray transport stream (M2TS) into the DVD VobSub format (SUB/IDX) used by many DVD authoring tools - hence the name. Many more features were added over time as was support for other formats. So in the meantime the name seems a little inappropriate. In a nutshell, it's a subtitle conversion tool for image based stream formats with scaling capabilities and some other nice features.


Supported Formats
-----------------

Blu-Ray SUP
Sony BDN XML (as used by Sonic Scenarist HDMV)
HD-DVD SUP (import only)
VobSub (SUB/IDX)
DVD-SUP (SUP/IFO)


What it can do
--------------

convert any supported import format to any supported export format
add a fixed delay to all timestamps
perform a frame rate conversion e.g. for pal speedup
synchronize time stamps to output frame rate
edit times and position of each caption
control all features (except editing) from the command line
move all captions inside or outside a given area or horizontally
crop the target screen size
scale up/down with a variety of filters (from bilinear over bicubic to Lanczos3 and Mitchell)
edit "forced" flags
exclude single captions from export
erase rectangular regions of a caption
scale captions independently of screen size
automatically remove fade in/out from imported subtitle streams.
export the target palette in PGCEdit text format (RGB values 0..255)
edit the imported DVD palette when input is either VobSub or SUP/IFO
edit the frame palette and alpha values when input is either VobSub or SUP/IFO
set/clear forced flags for all captions


Web references
--------------

https://forum.doom9.org/showthread.php?t=145277
https://www.videohelp.com/software/BDSup2Sub


Command Line Options
--------------------

usage: java -jar BDSup2Sub [options] -o <output> <input>
 -h,--help                       Show usage information and exit.
 -L,--load-settings              Load settings stored in configuration file
                                 even if running in command-line mode.
 -r,--resolution <resolution>    Set resolution to: keep, ntsc=480, pal=576,
                                 720p=720, 1080p=1080, 1440x1080
                                 Default: keep
 -T,--fps-target <fps>           Synchronize target frame rate to <fps>.
                                 Predefined values: 24p=23.976, pal or 25p=25,
                                 ntsc or 30p=29.967, keep (preserves the source
                                 fps for BD&XML, else default)
                                 Default: automatic (dumb!).
 -C,--convert-fps <src>, <trg>   Convert frame rate from <src> to <trg>
                                 Supported values: 24p=23.976, 25p=25,
                                 30p=29.970
                                 auto,<trg> detects source frame rate.
 -d,--delay <delay>              Set delay in ms
                                 Default: 0.0
 -f,--filter <filter>            Set the filter to use for scaling.
                                 Supported values: bilinear, triangle, bicubic,
                                 bell, b-spline, hermite, lanczos3, mitchell
                                 Default: bilinear
 -p,--palette-mode <mode>        Set palette mode.
                                 Supported values: keep, create, dither
                                 Default: create
 -m,--minimum-time <time>        Set minimum display time in ms.
                                 Default: 500
 -x,--merge-time <time>          Set maximum time difference for merging
                                 subtitles in ms.
                                 Default: 200
 -I,--move-in <ratio, offset>    Move captions inside screen ratio <ratio>, +/-
                                 offset <offset>
 -O,--move-out <ratio, offset>   Move captions outside screen ratio <ratio>,
                                 +/- offset <offset>
 -X,--move-x <pos[, offset]>     Move captions horizontally from specified
                                 position. <pos> may be left, right, center
                                 +/- optional offset <offset> (only if moving
                                 left or right)
 -c,--crop-y <n>                 Crop the upper/lower n lines.
                                 Default: 0
 -a,--alpha-crop <n>             Set the alpha cropping threshold.
                                 Default: 10
 -S,--scale <x, y>               Scale captions horizontally and vertically.
                                 Default: 1.0,1.0
 -P,--export-palette             Export target palette in PGCEdit format.
 -D,--forced-only                Export only forced subtitles (when converting
                                 from BD-SUP).
 -F,--force-all <state>          Set or clear the forced flag for all
                                 subtitles.
                                 Supported values: set, clear
 -w,--swap                       Swap Cr/Cb components when loading a BD/HD-DVD
                                 sup file.
 -i,--fix-invisible              Fix zero alpha frame palette for SUB/IDX and
                                 SUP/IFO.
 -A,--alpha-thr <n>              Set alpha threshold 0..255 for SUB/IDX
                                 conversion.
                                 Default: 80
 -M,--lum-low-med-thr <n>        Set luminance lo/med threshold 0..255 for
                                 SUB/IDX conversion.
                                 Default: auto
 -H,--lum-med-hi-thr <n>         Set luminance med/hi threshold 0..255 for
                                 SUB/IDX conversion.
                                 Default: auto
 -l,--language <language>        Set language for SUB/IDX export.
                                 Default: en
 -t,--palette-file <file>        Load palette file for SUB/IDX conversion.
                                 Overrides default palette.
 -o,--output <arg>               Specify output file.
 -v,--verbose                    Verbose console output mode.
 -V,--version                    Show version information and exit.
