Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Alpha key-ing #5

Open
sdboer78 opened this issue Feb 28, 2018 · 10 comments
Open

Alpha key-ing #5

sdboer78 opened this issue Feb 28, 2018 · 10 comments

Comments

@sdboer78
Copy link

sdboer78 commented Feb 28, 2018

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)

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
Copy link

egoosey commented Feb 28, 2018

+1 for this.

@sdboer78
Copy link
Author

sdboer78 commented Mar 4, 2018

@Spartan-II-117
Copy link

@anthonyeden can we get these changes merged in?

@sdboer78
Copy link
Author

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
Copy link

ksigWyatt commented Mar 13, 2018

@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
Copy link
Author

sdboer78 commented Mar 13, 2018

@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
Copy link
Owner

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.

@sdboer78
Copy link
Author

sdboer78 commented Mar 13, 2018

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
Copy link

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
Copy link
Author

sdboer78 commented Apr 1, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants