ofxSurfingTextSubtitle

Draws subtitles from an .SRT (or plain text) into a formatted styled paragraph with fading opacity and more.

OTHER License

Stars
6

OVERVIEW

Ready to use customizable .SRT text subtitle (and plain text) player for openFrameworks.

FEATURES

  • Full .SRT file browser for exploring the dialogs.
  • Text Mode for importing .txt. files. Split file in blocks then used as slides.
  • Fast FontStash render.
  • Custom Paragraph Styles.
  • Scalable and draggable rectangle container.
  • All settings are persistent.
  • Animated Fade In/Out for transparency.
  • Transport time player with four modes:
    • STANDALONE
      • Dialogs following the original SRT times and durations.
    • FORCED
      • Customizable dialogs duration. Ignoring SRT times. Ideal for Text mode.
    • EXTERNAL
      • Time is controlled by a video player or linked to one external control.
    • MANUAL
      • To work without loading any SRT file. Just pass the text slides manually.
  • Presets Engine for all the settings.

SCREENCASTS

VIDEO

- example-Subs_ImGui

- example-Subs_ofxGui / ofxGui

- example-Subs_ofxGui2 / ofxGui (Video Player)

- example-SubtitleWhisper / Whisper (Real-time audio to text) [ ADVANCED / WIP ]

Screenshot Requires this FORK of ofxWhisper from @roymacdonald.

- example-SubtitleChatGPT / [ ADVANCED / WIP ]

VIDEO

USAGE

ofApp.h

#include "ofxSurfingTextSubtitle.h"

ofxSurfingTextSubtitle subs;

ofApp.cpp

void ofApp::setup() 
{
	//subs.setup("Alphaville.srt"); // Optional
}
void ofApp::draw()
 {
	subs.draw();

	subs.drawGui();
}

DEPENDENCIES

OPTIONAL

  • ofxGui / Optional (oF core)
  • ofxWhisper / FORK (Only for the example)
  • ofxChatGPT / FORK (Only for the example)

TODO

  • List and load different render fonts files on runtime.
  • macOS testing.

TESTED SYSTEM

  • Windows 10 / VS 2022 / OF ~0.11

THANKS

LICENSE

MIT LICENSE

Related Projects