Git Product home page Git Product logo

gadiovideo's Introduction

Gadio Video Generator

Platform Test Result
Windows Build status
macOS Build status

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

运行环境

python 3.5, 3.6, 3.7

使用说明

本脚本可以生成三种不同规格的视频

Simple Complex Animated
时间校对 ✔️ ✔️ ✔️
文本 ✔️ ✔️ ✔️
图片 ✔️ ✔️ ✔️
亚克力背景 ✔️ ✔️
logo/水印 ✔️ ✔️
声音 ✔️ ✔️
转场动画 ✔️
GIF动画 ✔️
建议帧数 0-5 fps 0-5 fps 20-39 fps
常规用时 3 min 15 min 150 min

具体使用方法请参考各自章节

安装依赖

pip3 install -r requirements.txt

运行示例

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

  1. 如果想要生成Simple样式版本的视频可运行
python simple.py 107884
  1. 如果想要生成Complex样式版本的视频可运行
python complex.py 107884
  1. 如果想要生成Animated样式版本的视频可运行
python animated.py 107884

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

python crawler.py 107884

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

想跳过爬虫直接用已经爬好的图片和文字生成视频,可在上面生成视频的命令后加-s:

python simple.py 107884 -s
python complex.py 107884 -s
python animated.py 107884 -s

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

更改配置

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

参数 含义 示例 注释
fps 帧率 3
animation_fps 动画帧率 24 animated版本视频帧率
width 视频宽度 1280
height 视频高度 720
margin 边界宽度 60
picture_width 图片宽度 400 图片过高时会以高度为准
title_font_size 标题字体大小 48
content_font_size 正文字体大小 28
title_color 标题字体颜色 #424242
content_color 正文字体颜色 #424242
background_color 背景颜色 #FFFFFF
font 字体 ./util/SourceHanSans-Regular.ttc 如果使用系统自带字体,直接写字体文件名
logo_name logo图片文件名 logo.png logo文件应放在util文件夹下
fade_duration 渐变时间 1 两张图片间转场的时间长度,单位为秒
test 测试模式 False 在测试模式下之生成前10段视频,最长不超过200秒
enable_logo 是否增加logo True 是否在视频左下角增加logo
skip_gif 是否跳过gif False 是否在animated版本中跳过插入gif图片

尺寸和实例见下图

sample sample sample

视频示例请参考

哔哩哔哩

gadiovideo's People

Contributors

rabbitism 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.