Twitch Vod Highlights Generatior
twigen的Python项目详细描述
Twigen(β)
是一个抽搐视频点播亮点生成器,下载过去流的最佳时刻。它还可以选择下载特定部分或整个视频点播。
工作原理
Twigen分析聊天数据,并选择每个示例包含更多消息的流段(默认情况下,示例为60秒)。此外,还可以指定要包含的流段。
关于gui
twigen
使用命令行接口。但是,如果在没有参数的情况下调用它,就会产生一个(非常简单的)gui。它是一个命令生成器,也就是说,您在gui中选择的选项将转换为在终端上运行的命令(命令提示符)。从技术上讲,终端不需要成功,但是当您按下ok按钮时,gui会关闭,您将无法看到进度或发生错误。
使用示例
此命令将下载https://www.twitch.tv/videos/436057160生成5分钟(至少)视频的突出显示:
twigen --urls 436057160 --min 5
对于具有小型聊天交互的小型频道,可以使用--signal and--include:
twigen --urls 436176289 --min 10 --signal --include "0:0:0, 0:1:0"
此命令将在聊天中查找包含!把那一刻包括在亮点里。--include“0:0:0,0:1:0”保证第一分钟包含在突出显示中。include选项接受多个时间间隔:
--include "0:0:0, 0:1:0; 0:20:0, 1:0:0"
也可以使用多个VOD生成高光:
twigen --urls 436176289,437203732,438054911 --min 15 --group --output twigen_highlights.mp4
选项列表
-h, --help show this help message and exit
-u URLS, --urls URLS URLs or IDs of the VODs to process
-q, --quiet do not print what is being done
-s SAMPLE, --sample SAMPLE
duration of each sample in seconds, default=60
-d DELAY, --delay DELAY
start recording DELAY seconds early in each sample,
default=30
-g, --group process a list of urls into a single output file
-l, --check print how long the output file would be with this
options
-T, --tmp do not save dowloaded data to current directory
-M, --muted include muted portions of the VOD
-i INCLUDE, --include INCLUDE
include the specified samples
-Z, --signal look for !twigen in chat messages and create a sample
of that moment
-o OUTPUT, --output OUTPUT
name of the output file
-S, --segs do not concatenate samples
-C, --nochat do not download chat data, process included samples
only
-m MIN, --min MIN minimum length of the output file when generating
highlights
-y HYPE, --hype HYPE float number between [0,1] used by the highlights
generator for selecting samples, default=0.6
如何安装
首先,您需要Python3.7。在Linux上,您应该在发行版的软件包中找到它。在windows上,从official web site下载。
现在,在终端/命令提示符下:
pip install twigen
或者您可能需要运行:
python3.7 -m pip install twigen
现在您需要安装ffmpeg。在Linux上,您的发行版应该有相应的软件包,例如:
sudo apt install ffmpeg
在windows上,从official web site下载。
解压缩.zip,将文件重命名为类似FFmpeg
的文件,并将其粘贴到C:\
然后打开命令提示符并运行:
setx PATH "C:\FFmpeg\ffmpeg-20190610-80e68ce-win64-static\bin;%PATH%"
以便可以从命令提示符调用ffmpeg。确保ffmpeg中的文件夹名为ffmpeg-20190610-80e68ce-win64-static
,如果不只是用您的名称修改命令的话。
现在运行:
twigen --help
你应该看到Twigen的帮助信息。