Addon for adding subtitle files to blender VSE as Text sequences. Using pysub2 python module.

Overview

Import Subtitles for Blender VSE

Addon for adding subtitle files to blender VSE as Text sequences. Using pysub2 python module.

Supported formats by pysubs2 -

  • SubStation Alpha
    • .ass - tested
    • .ssa - not tested

Time-Based Formats

  • SubRip
    • .str - tested
  • MPL2 Time-based format similar to MicroDVD
    • .mpl2 - not tested
  • TMP
    • .tmp - not tested
  • WebVTT
    • .vtt - tested.

Frame-based Formats

  • MicroDVD -.sub - not tested

UI

Input Section: UI

  • String input - takest the full file path to your subtitle file.
  • Sub Import button - runs the script that imports subtitles as sequences of type 'Text'.
    • sequences are placed on the two topmost channels in VSE.
    • only two line subtitles are supported
    • pressing the button again will compare the sequences and their text,start time, end time, and will apply the changes.

NOTE: Updating sequences(in cases where the sequence/text is on the first channel or the one/lower line subtitle) because blender does not allow two sequences to overlap in one channel and because I didn't spent time to make it account for that, changing the time might result in that line popping to the above channel.

Update section UI2

  • Takes the position, font size, and box margin settings and exposes them to the user.
    • Note: these are the selected sequence's settings you don't need to edit those there but I just exposed them in the panel.
  • Sub Update buttom - runs the update script. Updates position based on the single line seqnece's position, font size and box margin(mainly because the double line subtitles's position have to be updated as well)

All other changes like font color,box margin or box margin color can be applied via the Copy to Selected so I haven't implemented anything to deal with this.

You might also like...
Beyond Paragraphs: NLP for Long Sequences

Beyond Paragraphs: NLP for Long Sequences

Ptorch NLU, a Chinese text classification and sequence annotation toolkit, supports multi class and multi label classification tasks of Chinese long text and short text, and supports sequence annotation tasks such as Chinese named entity recognition, part of speech tagging and word segmentation.

Pytorch-NLU,一个中文文本分类、序列标注工具包,支持中文长文本、短文本的多类、多标签分类任务,支持中文命名实体识别、词性标注、分词等序列标注任务。 Ptorch NLU, a Chinese text classification and sequence annotation toolkit, supports multi class and multi label classification tasks of Chinese long text and short text, and supports sequence annotation tasks such as Chinese named entity recognition, part of speech tagging and word segmentation.

An easy-to-use Python module that helps you to extract the BERT embeddings for a large text dataset (Bengali/English) efficiently.

An easy-to-use Python module that helps you to extract the BERT embeddings for a large text dataset (Bengali/English) efficiently.

A Python module made to simplify the usage of Text To Speech and Speech Recognition.
A Python module made to simplify the usage of Text To Speech and Speech Recognition.

Nav Module The solution for voice related stuff in Python Nav is a Python module which simplifies voice related stuff in Python. Just import the Modul

hashily is a Python module that provides a variety of text decoding and encoding operations.

hashily is a python module that performs a variety of text decoding and encoding functions. It also various functions for encrypting and decrypting text using various ciphers.

Module for automatic summarization of text documents and HTML pages.

Automatic text summarizer Simple library and command line utility for extracting summary from HTML pages or plain texts. The package also contains sim

Module for automatic summarization of text documents and HTML pages.

Automatic text summarizer Simple library and command line utility for extracting summary from HTML pages or plain texts. The package also contains sim

Uses Google's gTTS module to easily create robo text readin' on command.

Tool to convert text to speech, creating files for later use. TTRS uses Google's gTTS module to easily create robo text readin' on command.

A python script to prefab your scripts/text files, and re create them with ease and not have to open your browser to copy code or write code yourself
A python script to prefab your scripts/text files, and re create them with ease and not have to open your browser to copy code or write code yourself

Scriptfab - What is it? A python script to prefab your scripts/text files, and re create them with ease and not have to open your browser to copy code

Comments
  • Using pip to install modules

    Using pip to install modules

    If you want to add pip installing of external modules, it can be done like this:

    import bpy, sys, subprocess, site
    
    app_path = site.USER_SITE
    if app_path not in sys.path:
        sys.path.append(app_path)
    
    pybin = sys.executable  # bpy.app.binary_path_python # Use for 2.83
    
    try:
        subprocess.call([pybin, "-m", "ensurepip"])
    except ImportError:
        pass
    
    try:
        import pysubs2
    except ImportError:
        subprocess.check_call([pybin, "-m", "pip", "install", "pysubs2"])
        import pysubs2```
    opened by tin2tin 9
  • A few notes and ideas

    A few notes and ideas

    Nice to see you working on this.

    A few notes: If you want to add an open-filebrowser button next to the path, there is a template for this in the Template menu: operator_file_import.py

    After the import I get this error: AttributeError: 'Context' object has no attribute 'active_sequence_strip' - I'm running the add-on in 2.93. But it works in 3.0: https://developer.blender.org/rBSc84d1ad3dbf4551b55f7b2630ef4ba7f6512b775https://developer.blender.org/rBSc84d1ad3dbf4551b55f7b2630ef4ba7f6512b775

    For some odd reason can't the font type be batch changed with Copy to Selected, so maybe you can find a way to work around that?

    The text strips can actually insert text with forced text breaks, but you just can't insert them manually in the string widget. Adding a string like this "line 1"+chr(13)+"line 2" to the text strip will draw the text in two lines.

    opened by tin2tin 2
Owner
null
Subtitle Workshop (subshop): tools to download and synchronize subtitles

SUBSHOP Tools to download, remove ads, and synchronize subtitles. SUBSHOP Purpose Limitations Required Web Credentials Installation, Configuration, an

Joe D 4 Feb 13, 2022
Implementation of COCO-LM, Correcting and Contrasting Text Sequences for Language Model Pretraining, in Pytorch

COCO LM Pretraining (wip) Implementation of COCO-LM, Correcting and Contrasting Text Sequences for Language Model Pretraining, in Pytorch. They were a

Phil Wang 44 Jul 28, 2022
Utility for Google Text-To-Speech batch audio files generator. Ideal for prompt files creation with Google voices for application in offline IVRs

Google Text-To-Speech Batch Prompt File Maker Are you in the need of IVR prompts, but you have no voice actors? Let Google talk your prompts like a pr

Ponchotitlán 1 Aug 19, 2021
Yet Another Sequence Encoder - Encode sequences to vector of vector in python !

Yase Yet Another Sequence Encoder - encode sequences to vector of vectors in python ! Why Yase ? Yase enable you to encode any sequence which can be r

Pierre PACI 12 Aug 19, 2021
Compute distance between sequences. 30+ algorithms, pure python implementation, common interface, optional external libs usage.

TextDistance TextDistance -- python library for comparing distance between two or more sequences by many algorithms. Features: 30+ algorithms Pure pyt

Life4 3k Jan 6, 2023
Compute distance between sequences. 30+ algorithms, pure python implementation, common interface, optional external libs usage.

TextDistance TextDistance -- python library for comparing distance between two or more sequences by many algorithms. Features: 30+ algorithms Pure pyt

Life4 1.9k Feb 18, 2021
Big Bird: Transformers for Longer Sequences

BigBird, is a sparse-attention based transformer which extends Transformer based models, such as BERT to much longer sequences. Moreover, BigBird comes along with a theoretical understanding of the capabilities of a complete transformer that the sparse model can handle.

Google Research 457 Dec 23, 2022