Giter Club home page Giter Club logo

gadiovideo's Introduction

Gadio Video

sample

Platform Test Result
Windows Build status
macOS Build status

本脚本的作用是利用机核网的图文电台时间轴信息自动生成视频。

运行环境

python 3.5, 3.6, 3.7

使用说明

安装依赖

pip3 install -r requirements.txt

运行示例

https://www.gcores.com/radios/107884 中的电台为例:

如果想要生成视频可运行

# 直接生成最新一期电台的视频
python gcores.py
# 生成id为107884的电台的视频
python gcores.py 107884
# 跳过爬虫直接用已下载的图片生成107884的视频
python gcores.py 107884 -s

此外 如果想单独爬取文本和图片不生成视频,可运行

# 爬取id为107884的电台文本和图片
python crawler.py 107884
#只爬取文本 不下载图片
python crawler.py 107884 -t

图片/音频等暂存于.\cache\107884\中。图片的名称为图片在视频中最初出现的秒数。

生成的视频文件位于 output 文件夹内

更改配置

修改config.py中的参数可以修改如下配置

参数 含义 示例 注释
fps 帧率 2
width 视频宽度 1920
height 视频高度 1080
title_font_size 标题字体大小 53
content_font_size 正文字体大小 36
gcores_title_color 标题字体颜色 (255,255,255,246)
gcores_content_color 正文字体颜色 (255,255,255,205)
background_color 背景颜色 #FFFFFF
title_font 标题字体 ./gadio/utils/PingFang-Heavy.ttf 如果使用系统自带字体,直接写字体文件名
content_font 正文字体 ./gadio/utils/PingFang-Medium.ttf 如果使用系统自带字体,直接写字体文件名
gcores_logo_name logo图片 ./gadio/utils/gcores.png logo文件应放在utils文件夹下
test 测试模式 False 在测试模式下之生成前10段视频,最长不超过200秒
start_offset 片头偏移量 5 最终的文字时间轴偏移量

尺寸和实例见下图

sample sample sample

视频示例请参考

哔哩哔哩

gadiovideo's People

Contributors

dependabot[bot] avatar rabbitism avatar yihong0618 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.