Giter VIP home page Giter VIP logo

ass_renderer's Introduction

logo

Simple extensible ASS subtitle editor for Linux

Features

  • Python - easily extend it however you want
  • Video preview
  • Audio preview (spectrogram)
  • Video band for quick assessment of scene boundaries
  • Audio and video are synced at all times
  • Spectrogram shows where subs start and end
  • Slow playback support (with audio pitch correction)
  • I can sub an entire episode without ever having to touch the mouse
  • Mouse users are not excluded and can click their way to all the commands
  • Robust plugin API (everything GUI is capable of can be done through the API)
  • Simple architecture (Commands โ†” API โ†” GUI)
  • Separate control for persistent inline comments (useful for translating)
  • Newlines support in the editor
  • Everything is aligned to video frames
  • Style editor with realistic preview
  • Vim mode in the text editor (off by default, requires neovim 0.4+)
  • No bloat

Screenshot

Installation

  • Install system dependencies
  • Clone the repository: git clone https://github.com/bubblesub/bubblesub
  • Enter its directory: cd bubblesub
  • Install bubblesub: pip install --user .
  • Run bubblesub: python3 -m bubblesub or simply bubblesub

If you want to simplify bubblesub installation, look at our Dockerfile. You will find what dependencies are needed, how to install them and how to run our tests.

Documentation

Default hotkeys and commands

Please see this file.

API

For the API documentation, for now please consult the docstrings in the bubblesub.api module. In the future, if bubblesub experiences a boost in popularity, this might be improved.

Configuration and plugins

  • $XDG_CONFIG_HOME/bubblesub/: contains user configuration
    • options.yaml: general options
    • hotkeys.conf: configurable user hotkeys
    • menu.conf: configurable additional user menus
  • $XDG_CONFIG_HOME/bubblesub/scripts: contains user plugins (see example plugin)
  • $XDG_CACHE_HOME/bubblesub/: used to cache time codes and such

Questions

  1. I want to report a bug.

    Please use GitHub issues.

  2. I want a feature.

    Chances are I'm too busy to work on features I don't personally need, so pull requests are strongly encouraged.

  3. Why not aegisub?

    Because it doesn't cover my needs, it's too convoluted and its development is too slow.

  4. Windows builds?

    You can find a Windows build for bubblesub here.
    I don't maintain it, so please contact the current developer if you find some issue.

  5. Versioning? PyPI?

    I don't say no, maybe in the future, if the project gets more popular. For now, git master is the way to go.

Contact

Issue tracker: GitHub issues

Acknowledgments

I'd like to thank all contributors for the help on this project.
The lovely logo was donated by fri. Thanks :)

ass_renderer's People

Contributors

rr- avatar theoneric avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ass_renderer's Issues

Defaults for ASS track are wrong

ASS has standard default values for those headers but ass_renderer assigns different ones. If those fields are linked with the actual C object from libass, i.e. the values are automatically updated when libass changes them, simply removing the custom defaults is the correct thing to do as libass will take care of it.
If not, and those fields are exposed/used somewhere (after #1 removes the usage as a bogus storage size) a patch similar to the following will emulate the correct fallbacks:

From 9c921570adae3bcdbdffc7b782be1ec5accf2edf Mon Sep 17 00:00:00 2001
From: Oneric <[email protected]>
Date: Wed, 16 Feb 2022 19:38:24 +0100
Subject: [PATCH] Fix default values for ASS headers

 - ScaledBorderAndShadow defaults to no
 - WrapStyle defaults to 0 ("smart" mode)
 - PlayRes{X,Y} has obscure fallback values
---
 ass_renderer/libass.py | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/ass_renderer/libass.py b/ass_renderer/libass.py
index 0cad674..b714057 100644
--- a/ass_renderer/libass.py
+++ b/ass_renderer/libass.py
@@ -369,16 +369,26 @@ class AssTrack(ctypes.Structure):
         text = write_ass(ass_file).encode("utf-8")
         _libass.ass_process_data(ctypes.byref(self), text, len(text))
 
-        self.play_res_x = int(
-            ass_file.script_info.get("PlayResX") or video_resolution[0]
+        self.wrap_style = int(ass_file.script_info.get("WrapStyle") or 0)
+        self.scaled_border_and_shadow = (
+            ass_file.script_info.get("ScaledBorderAndShadow", "no") == "yes"
         )
-        self.play_res_y = int(
-            ass_file.script_info.get("PlayResY") or video_resolution[1]
+        res_x = int(
+            ass_file.script_info.get("PlayResX") or 0
         )
-        self.wrap_style = int(ass_file.script_info.get("WrapStyle") or 1)
-        self.scaled_border_and_shadow = (
-            ass_file.script_info.get("ScaledBorderAndShadow", "yes") == "yes"
+        res_y = int(
+            ass_file.script_info.get("PlayResY") or 0
         )
+        if res_x <= 0 and res_y <= 0:
+            res_x = 384
+            res_y = 288
+        elif res_x <= 0:
+            res_x = 1280 if res_y == 1024 else max(1, res_y * 4 // 3)
+        elif res_y <= 0:
+            res_y = 1024 if res_x == 1280 else max(1, res_x * 3 // 4)
+        self.play_res_x = res_x
+        self.play_res_y = res_y
+
 
 
 _libc.free.argtypes = [ctypes.c_void_p]
-- 
2.30.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.