Auto-Stream-Recording-Twitch icon indicating copy to clipboard operation
Auto-Stream-Recording-Twitch copied to clipboard

Possibility of adding chat log video rendering with TwitchDownloader

Open crackerbear opened this issue 4 years ago • 2 comments

First and foremost I'd like to thank you for your script, I use it a lot, however I want to modify it slightly by adding the ability to render the chat log to a video using TwitchDownloader after TCD downloads the logs.

The TwitchDownloader CLI commands can be found here: https://github.com/lay295/TwitchDownloader/blob/master/TwitchDownloaderCLI/README.md

I know nothing about Python or coding in general, but I've tried changing from line 507 onwards to something like this:

subprocess.Popen(['tcd', "-v", vod_id, "--timezone", self.timezoneName, "-f", "json", "-o", processed_stream_path], stdout=None, stderr=None)
Popen().wait()
subprocess.Popen(['TwitchDownloaderCLI', "-m", "ChatRender", "-i", processed_stream_path + vod_id + ".json", "-h", "612", "-w", "272", "--framerate", "60", "--backround-color", "#000000", "-o", processed_stream_path + vod_id + "_chat.mp4"], stdout=None, stderr=None)

The code doesn't work, I don't think the Popen().wait() that I Googled and added is correct (the idea is to wait for tcd to finish before executing the next subprocess) and I'm not sure how to modify the input and output argument correctly since processed_stream_path doesn't seem to work.

Any help would be highly appreciated.

crackerbear avatar Sep 03 '20 17:09 crackerbear

Firstly, if you want to execute another process after tcd you have to wait till it ends or make another thread for tcd. This script was made without threads and any pauses while processing. You can try add a thread for chat processing or use subrocess.run to wait until tcd ends if it's acceptably for you. Secondly, tcd has it's own naming system. If you want to use processed_stream_path you should config same filename layout in tcd as in script or make another layout to use. I sorry but I don't have time to work on it now since quarantine over.

EnterGin avatar Sep 03 '20 17:09 EnterGin

Like I said earlier, I have no clue how to code so I guess I'll have to give up on this idea or maybe go ask on StackOverflow instead.

I'll leave this issue open for now to see if anyone else passing by reading this can help, otherwise you can close it if you feel that it's redundant.

Thanks for the help anyway!

crackerbear avatar Sep 03 '20 17:09 crackerbear