Code Monkey home page Code Monkey logo

obs-text-pthread's Introduction

OBS Pthread Text

Introduction

This plugin displays text with many advanced features.

  • Markup
  • Text alignment
    • Left, center, and right
    • Justification
  • Outline
    • Configurable width, color, and opacity
    • Configurable shape of corners
    • Blur
  • Transition
    • Fade-in, fade-out, cross-fade
    • Slide
  • Threaded glyph drawing
    • Lower priority to draw glyphs so that other sources and encoders are not impacted
    • More frequent polling of the text file
  • Automatic line-break supporting East Asian languages
  • Saving as PNG files for post production

Markups

See the Pango Markup Language for detailed markup tags available.

Properties

List of properties describes all available propeties.

Updating text

This plugin can set the text by setting or from a text file. To have transition, it is recommended that the text is updated from a progam, not by typing on the propeties window.

Updating text using obs-websocket

You can use SetSourceSettings request for obs-websocket. Request fields will be as below for example.

{"sourceName": "source-name", "sourceSettings": {"text": "your new text"}}

Updating text file

This plugin checks these file attributes; inode, mtime, and size. Recommended flow to update the text is as below.

  1. Set the source file in the property of this plugin. Let's say /dev/shm/text.txt for example.
  2. Write to a temporary file. your_program > /dev/shm/text.txt~
  3. Move the temporary file to the target file. mv /dev/shm/text.txt~ /dev/shm/text.txt This step is atomic so that the plugin won't read the middle state.

Furture plan

  • support Windows,
  • and feature requests.

obs-text-pthread's People

Contributors

flexiondotorg avatar norihiro avatar palakis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

obs-text-pthread's Issues

The default plugin folders of OBS Studio 27 has been changed another location on Ubuntu 22.04.

Since Ubuntu update to 22.04, the default plugin folders of OBS Studio 27 has been changed to /usr/lib/x86_64-linux-gnu/obs-plugins instead of /usr/lib/obs-plugins. And OBS Studio won't load /usr/lib/obs-plugins any more. It cause OBS 27 couldn't load obs-text-pthread unless I created a symbol link to /usr/lib/x86_64-linux-gnu/obs-plugins for it.

So please consider to fix obs-text-pthread-2.0.2-obs27-ubuntu-20.04-x86_64.deb since Ubuntu haven't released OBS Studio 28 informally.

2022-09-19 01-41-17 的螢幕擷圖
2022-09-19 01-41-23 的螢幕擷圖

Paths in dependent libraries not correctly relativized in Apple Silicon version

The current Apple Silicon build of obs-text-pthread fails to load, because some of the library paths in the dependent libraries have not been relativized to @loader_path and instead point to somewhere in @@HOMEBREW_CELLAR@@.

Here are the problematic links from the output of otool -L on the libraries:

libgio-2.0.0.dylib:
	@@HOMEBREW_CELLAR@@/glib/2.72.3/lib/libglib-2.0.0.dylib (compatibility version 7201.0.0, current version 7201.3.0)
	@@HOMEBREW_CELLAR@@/glib/2.72.3/lib/libgobject-2.0.0.dylib (compatibility version 7201.0.0, current version 7201.3.0)
	@@HOMEBREW_CELLAR@@/glib/2.72.3/lib/libgmodule-2.0.0.dylib (compatibility version 7201.0.0, current version 7201.3.0)

libgobject-2.0.0.dylib:
	@@HOMEBREW_CELLAR@@/glib/2.72.3/lib/libglib-2.0.0.dylib (compatibility version 7201.0.0, current version 7201.3.0)

libpangocairo-1.0.0.dylib:
	@@HOMEBREW_CELLAR@@/pango/1.50.8/lib/libpango-1.0.0.dylib (compatibility version 5001.0.0, current version 5001.8.0)
	@@HOMEBREW_CELLAR@@/pango/1.50.8/lib/libpangoft2-1.0.0.dylib (compatibility version 5001.0.0, current version 5001.8.0)

libxcb-render.0.dylib:
	@@HOMEBREW_CELLAR@@/libxcb/1.15/lib/libxcb.1.dylib (compatibility version 3.0.0, current version 3.0.0)

libxcb-shm.0.dylib:
	@@HOMEBREW_CELLAR@@/libxcb/1.15/lib/libxcb.1.dylib (compatibility version 3.0.0, current version 3.0.0)

Edited to add: Also, note that libgmodule and libpangoft2 are not actually included in the lib directory of the prebuilt plugin.

Change format of PNG file names

Currently, PNG files are named by os_gettime_ns, which is calculated since the system boot time.
This is not useful because the same name could be applied after rebooting the system.
Instead, it should be named as same as the OBS's video files.

Make a Building Guide for the Plugin

I'm on Nobara 37 and wanted to use this plugin on OBS. Unfortunately, it crashed immediately after I moved plugin files to its plugin folder. Maybe I'm missing some dependencies, or I outright can't use it as it explicitly said it is for MacOS and Ubuntu, so adding a building guide will help many Linux users other than Ubuntu to use this plugin a bit easier.

New Feature: Infinite scrolling text

This is an idea to keep scrolling infinite text.

  • Set a limit of lines, returns number of characters processed until reaching the limit.
  • Or, limit/fix text height and scroll until it reaches the bottom.
  • Add an option to lock update callback until rendering is done, and not render text until there is a pending text to scroll-in.
  • Bugfix that a scrolling text suddenly vanishes if a new text is empty.

Incorrect shadow color if outline is enabled

Settings

  • outline enabled, red color
  • shadow enabled, green color

Expected behavior

The shadow becomes green.

Actual behavior

The shadow becomes red and green; outside is red and inside is green.

Plugin not working under Apple Silicon and OBS 28

I have installed the macos-arm64 plugin using both the pkg and the zip but I get this error and the plugin doesn't actually load on OBS
06:13:14.848: os_dlopen(/Users/dixxie/Library/Application Support/obs-studio/plugins/obs-text-pthread.plugin/Contents/MacOS/obs-text-pthread->/Users/dixxie/Library/Application Support/obs-studio/plugins/obs-text-pthread.plugin/Contents/MacOS/obs-text-pthread): dlopen(/Users/dixxie/Library/Application Support/obs-studio/plugins/obs-text-pthread.plugin/Contents/MacOS/obs-text-pthread, 0x0101): Library not loaded: '@@HOMEBREW_CELLAR@@/glib/2.72.3/lib/libglib-2.0.0.dylib' 06:13:14.848: Referenced from: '/Users/dixxie/Library/Application Support/obs-studio/plugins/obs-text-pthread.plugin/Contents/lib/libgobject-2.0.0.dylib' 06:13:14.848: Reason: tried: '/usr/lib/libglib-2.0.0.dylib' (no such file)Library not loaded: '@@HOMEBREW_CELLAR@@/glib/2.72.3/lib/libglib-2.0.0.dylib' 06:13:14.848: Referenced from: '/Users/dixxie/Library/Application Support/obs-studio/plugins/obs-text-pthread.plugin/Contents/lib/libgio-2.0.0.dylib' 06:13:14.848: Reason: tried: '/usr/lib/libglib-2.0.0.dylib' (no such file)Library not loaded: '@@HOMEBREW_CELLAR@@/pango/1.50.8/lib/libpango-1.0.0.dylib' 06:13:14.848: Referenced from: '/Users/dixxie/Library/Application Support/obs-studio/plugins/obs-text-pthread.plugin/Contents/lib/libpangocairo-1.0.0.dylib' 06:13:14.848: Reason: tried: '/usr/lib/libpango-1.0.0.dylib' (no such file) 06:13:14.848: 06:13:14.848: Module '/Users/dixxie/Library/Application Support/obs-studio/plugins/obs-text-pthread.plugin/Contents/MacOS/obs-text-pthread' not loaded

It looks like it's not properly loading libraries so I tried compiling it myself following the instructions on the wiki but I can't figure out how to get the .plugin bundle OBS 28 now requires

Text Pthread does not render any text

Expected behaviour

Add Text Pthread source, enter some text and text is rendered.

Actual behaviour

Add Text Pthread source, enter some text and text not text is rendered.

image

image

I see a line in the OBS log that says:

13:01:28.735: [obs-text-pthread] Cannot load '(null)'
13:01:28.803: User added source 'Text Pthread' (obs_text_pthread_source_v2) to scene 'Wimdow Cap'

Configuration

  • Ubuntu 22.04
  • OBS Studio 28.0.1
  • Text Pthread 2.0.1

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.