swf2ass-go

command module
v0.0.0-...-7d2fe1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 18 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
ass
tag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL