ProPresenter-Stage-Display-Python
ProPresenter-Stage-Display-Python copied to clipboard
Alpha key-ing
I like to use this application for alpha keying subtitles on my livestream. Is it possible to add the following features?
Outline / shadow for fonts. Configurable in config.json: outline-size, fill-color
Configure the background- and text color in the config.json (in my case: #00FF00 / #FFFFFF)
Like:
import ptext
screen = pygame.display.set_mode((854, 480))
screen.fill((0, 255, 0))
ptext.draw("And there I find You in the mystery", (20, 70), fontsize=70, shadow=(0.1,0.1), scolor="#202020", sysfontname="Quebab Shadow FFP", owidth=0.5, ocolor=(0,0,0), color=(255,255,255))
pygame.display.flip()
while not any(event.type in (pygame.KEYDOWN, pygame.QUIT) for event in pygame.event.get()):
pass
from: https://github.com/cosmologicon/pygame-text
+1 for this.
See my proof of concept: https://github.com/sdboer78/ProPresenter-Stage-Display-Python/
@anthonyeden can we get these changes merged in?
I tested this feature last Sunday:
It works fine so far. But sometimes a little bit slow. The generation of the grapic letters is a little bit heavy.
I have completely rebuild this feature, but now based on NodeJS outputted by a fullscreen browser and as base https://github.com/jswetzen/ppstagedisplay It is much faster. I will share this code also when it is ready.
Please feel free to use this python code.
@sdboer78 that looks great. The speed of the response is likely because of the Pi's ability to execute the Python, as you said it's a little heavy for the Pi. If this was written in C++ or something then it may run faster. In one of my projects we had to re-write some python instructions in C++, because they took too long to execute.
How long does it take as of now? I'm assuming it's still only a couple seconds. Also I think a helpful addition to this PR could be some documentation on how you can get the alpha-keying working for your display. Because I wouldn't know how to do that
@ksigWyatt When using the browser as presentation (the NodeJS solution), it is a fraction of a second. I am using a BlackMagic mixer https://www.thestreamingguys.com.au/blackmagic-atem-television-studio-pro-hd/ But the most cheap BM mixer (around $1000) can do this trick.
Hey @sdboer78, Thanks for the pull request! I love where you're going with it. As it currently stands, I can't merge it into the main release.
A couple of reasons spring to mind:
- Performance, as you've mentioned, isn't as good as it could be
- Most of the existing config options seem to be ignored - for example, we options to merge lines, change into uppercase, align text, etc.
- This functionality has been built into a different module, which reuses code from the first. I'd much rather text generation be a small module called from the main StageDisplay.py app so we don't duplicate anything. That way, we don't have to re-implement any of the above mentioned functionality.
Don't be discouraged. All of this is fixable, and hopefully one of us (or anyone else in the community) will be able to keep working on this soon and get it ready for release.
Hi @anthonyeden,
I am not discouraged at all! I think it is not possible to fix it in the current implementation because Tkinter.frame doesn't support graphic letters, only plain ones. Or do you think differently?
The code for so far is a prototype, to get it work in a short time, and to test speed and output. I fully support your points.
Please feel free to use the code, en merge is wherever it fits, or not ;)
nb. the PR is not mine.... ;)
I just saw your project and thought, that's how I can get the display vision to our video mixer! This would be great with the Alpha keying. I'm also a Github user mainly PHP/CodeIgniter - But, I know enough of Python - I may fork this project at some point.
Thanks for the work you have done on this project!
Here is a 100% html / javascript / css implementation of Stage Display, with a alpha keying template:
site: https://sdboer78.github.io/propresenter-stagedisplay/ code: https://github.com/sdboer78/propresenter-stagedisplay