Collection of tools to convert vector SWF animations into ASS https://swf2ass.gammaspectra.live
Go to file
2024-03-08 18:53:53 +01:00
ass Clip tag optimizations 2024-03-08 18:19:48 +01:00
http Fix zst extension on http 2024-03-08 18:53:53 +01:00
settings Clip tag optimizations 2024-03-08 18:19:48 +01:00
types Fix Vector2 Equals() for float64, fixed position transitions 2023-12-03 16:52:10 +01:00
go.mod Force playback on swf2ass, fixed DefineFont tag 2023-12-03 04:57:13 +01:00
go.sum Force playback on swf2ass, fixed DefineFont tag 2023-12-03 04:57:13 +01:00
LICENSE Add LICENSE 2023-11-19 02:15:45 +01:00
parser_test.go Added FlushInterval setting to cache previous lines to append 2023-12-04 09:15:25 +01:00
README.md Drop ASS tags that don't ever have a visible color 2023-12-03 04:08:00 +01:00
signatures.json Apply signatures from input hash 2023-12-03 15:47:15 +01:00
swf2ass-pack.sh Updated scripts, add HTTP server to serve compressed ASS 2024-03-08 18:20:07 +01:00
swf2ass-zlib.sh Updated scripts, add HTTP server to serve compressed ASS 2024-03-08 18:20:07 +01:00
swf2ass.go Added FlushInterval setting to cache previous lines to append 2023-12-04 09:15:25 +01:00
swf2ass.sh Updated scripts, add HTTP server to serve compressed ASS 2024-03-08 18:20:07 +01:00

swf2ass ➡️🍑

Converts Flash animations into ASS subtitles with vector drawings where possible. Work in progress, expect broken output.

Usage

$ go run git.gammaspectra.live/WeebDataHoarder/swf2ass-go -input [file.swf] -output [file.ass] -audio [file.mp3]

The -audio parameter is optional and will only be produced if the input file has streaming MP3 audio.

Create a bogus video track with the subtitles and audio embedded:

$ FILENAME=file
$ ffmpeg -y \
-f lavfi -i "color=size=$(grep PlayResX ${FILENAME}.ass | head -n 1 | awk '{ print $2 }')x$(grep PlayResY ${FILENAME}.ass | head -n 1 | awk '{ print $2 }'):rate=$(grep '?dummy' ${FILENAME}.ass | head -n 1 | awk -F: '{ print $3 }'):color=black" \
-i "${FILENAME}.mp3" \
-i "${FILENAME}.ass" \
-map 0:v -map 1:a -map 2:s \
-c:v libx264 -pix_fmt yuv420p -crf 1 -tune stillimage -preset placebo -x264-params keyint=240 \
-c:a copy \
-c:s copy -disposition:s:0 forced -metadata:s:s:0 language=und \
-shortest "${FILENAME}.mkv"

Compress subtitles

zstd -19 -T24 file.ass -o file.ass.zst