Skip to content

Deathspike/normalasser

Repository files navigation

normalasser

Normalasser extracts ASS subtitles from MKV video files and normalizes their appearance to enhance readability and ensure consistency. Unlike the simpler SRT format, ASS subtitles include embedded styles that dictate font, color, and size, leaving no room for viewer preferences. Normalasser selectively overrides these styles to ensure that subtitles maintain a consistent size across different series and sources, while preserving other stylistic elements such as font choice, color, and positioning. This approach not only improves viewer experience but also upholds the original artistic intent of the subtitles.

Preview

Before After

Prerequisites

Install

npm install -g normalasser

Usage

To use Normalasser from the command line, simply run the tool followed by the absolute paths to the MKV files or directories containing MKV files. Normalasser will recursively scan directories to find all MKV files to extract and normalize ASS subtitles according to your specifications.

normalasser /path/to/video.mkv

You can also pass multiple paths:

normalasser /path/to/directory /path/to/video.mkv

Customize Normalasser's behavior with the following options:

  • --check-ass: Normalize already extracted ASS subtitles.
  • --force-mkv: Extract and normalize even if external ASS subtitles already exist.
  • --size: Set the size of the subtitles (tiny, small, normal, large or huge).

Example with multiple options:

normalasser --check-ass --size large /path/to/directory

Webserver

If no absolute paths are specified when launching Normalasser, it operates as a webserver on port 7883. This mode enables other applications to send POST requests with JSON payloads containing absolute paths to the MKV files or directories containing MKV files.

normalasser

To send a request, use any HTTP client capable of sending POST requests with JSON:

curl -X POST -d '{"path": "/path/to/video.mkv"}' http://127.0.0.1:7883

Normalasser scans the entire JSON object, extracting absolute paths from any part of its structure, regardless of how it is formatted. This flexibility ensures that Normalasser is compatible with a wide range of input sources and can be integrated with automation tools like Sonarr and Radarr that may send structured data in different formats.

Contributions

We welcome contributions from the community! If you have suggestions for improvements, bug fixes, or new features, please feel free to submit a pull request or open an issue on our GitHub page. Your feedback and contributions make Normalasser better for everyone.

About

Extracts ASS subtitles from MKV video files and normalizes their appearance to enhance readability and ensure consistency.

Resources

License

Stars

Watchers

Forks

Packages

No packages published