/honorifics

Manages honorifics and timing quirks in subtitles.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

honorifics

Manages honorifics and timing quirks in subtitles.

scripts/

Scripts can run by in-system Python. All scripts reads from stdin and output to stdout.

subtitles.py

Read line by line. If in line is text between marks {*}...{*...} then swap it. Marks can be changed by providing arguments to class TextSwapperInMark constructor in script.

timing_offset.py

For SubStation Alfa (V4 & V4+) file. Optional argument: -fps

Read all input once as lines. If in dialogue event line at the end of Text field is {+|- number cs|ms|frame|frames}
e.g. {+5 frames} then shift accordingly Start and End time field. Default frame rate is 23.976.

changing_codec.py

For video files. Optional arguments -duration, -deband, -subtitles, -output

Script adds visual effects on given timestamps and durations, and changes codec to VP9 with .mkv extension. Optionally script hardsubs given subtitle file to the video.

Examples

python3 ./scripts/subtitles.py < input > output

python3 ./scripts/timing_offset.py -fps 29.97 < input.ass > output.ass

python3 ./scripts/changing_codec.py -i input [timestamp] -d [duration] -o output.mkv

Useful tools

Meld

Developing notes

For developing purposes it is recommended to use virtual environments.

Code in honorifics/ should be covered by tests. Type hinting is preferred. PEP 8 to style.