anthonyeden / ProPresenter-Stage-Display-Python

A Python implementation of the ProPresenter Stage Display - for Raspberry Pi
https://mediarealm.com.au/propresenter-pi/
GNU General Public License v3.0
27 stars 4 forks source link

Alpha key-ing #5

Open sdboer78 opened 6 years ago

sdboer78 commented 6 years ago

I like to use this application for alpha keying subtitles on my livestream. Is it possible to add the following features?

1) Outline / shadow for fonts. Configurable in config.json: outline-size, fill-color

2) Configure the background- and text color in the config.json (in my case: #00FF00 / #FFFFFF)

image

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

egoosey commented 6 years ago

+1 for this.

sdboer78 commented 6 years ago

See my proof of concept: https://github.com/sdboer78/ProPresenter-Stage-Display-Python/

Spartan-II-117 commented 6 years ago

@anthonyeden can we get these changes merged in?

sdboer78 commented 6 years ago

I tested this feature last Sunday: image

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.

ksigWyatt commented 6 years ago

@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

sdboer78 commented 6 years ago

@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.

anthonyeden commented 6 years ago

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:

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.

sdboer78 commented 6 years ago

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.... ;)

nicksweb commented 6 years ago

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!

sdboer78 commented 6 years ago

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