manifestinteractive / teleprompter

Browser-based TelePrompter with Remote Control
https://promptr.tv
Other
316 stars 113 forks source link

Close caption extractor #55

Open griffon56 opened 1 year ago

griffon56 commented 1 year ago

Question

Hi, I would like to use this very good piece of software as prompter and at the same time it would feed a close-caption generator. In order to do this I would need to extract the top line of what’s actually displayed in the web browser. Then I would send as ASCII to the CC device.

By looking into the JS code I found no « obvious » way to do it. Where should I start ? Many thanks for your insights.

manifestinteractive commented 1 year ago

@griffon56 that is an interesting idea ... Few questions for you that might help come up with a solution:

  1. When you say "Top Line" what are you referring to? The first visible line in the teleprompter? Or the one that is highlighted as the text scrolls? ( there is an option to enable/disable an overlay to dim out the rest of the text and only have a single line highlighted for better focus ).
  2. When the text is sent over, I am assuming you want ONLY the text that fit in that line, correct?
  3. Can you give me an example of the expected format that you would need to make this work?
  4. Do you have an example application I could use to test any possible solution ( ideally free since I don't get paid for this app, ha ha ) ?
griffon56 commented 1 year ago

Thanks for your feedback. 1) the idea is to select one or two lines at the middle of the text line 2 or 3 (not the top one as per my first request). 2) yes I want to extract one or two lines of text 3) the caption generator awaits a TCP-IP string sent to a specific port. The string should look like : « LINE 1 \r\n LINE 2 » 4) a python script using socket module awaiting for incoming connection and display the text should do the trick

I made some progress. By separating the text into spans (1 span per line) and display it one by one by using scroller position I am now able to extract a line of text.

but I am struggling to send the string to TCP-IP port of the graphics generator. Is there a JavaScript or socket.io function I could use ? I have the impression it is difficult to address TCP IP requests from a browser.