Code Monkey home page Code Monkey logo

rubbish-video-generator's Introduction

Rubbish-Video-Generator

B站讲解

营销号视频生成器~仅供娱乐

功能:自动生成文本,自动添加字幕,自动给视频配音(人声)

🐛1.1版本更新

  • 修复了原视频带有bgm,最终生成的视频没有声音的问题
  • 现在支持手动设定字体大小,在args.txt文件中的第五行进行设置

下载

$ git clone https://github.com/wmathor/Rubbish-Video-Generator.git

如何使用

moviepy == 1.0.0

python > 3.5

自行安装ImageMagick

缺少的库自行pip

如果报错'module 'websocket' has no attribute 'enableTrace'',请参考下面的解决方案

pip uninstall websocket
pip uninstall websocket-client
pip install websocket-client
  1. 需准备一个时长大于50s的视频,有无背景音乐均可,命名为in.mp4
  2. 需准备一个时长大于50s的BGM,命名为in.mp3
  3. 提前在args.txt文本中定义好主体、事件、另一种说法
  4. args.txt文本中添加讯飞语音合成(流式版)的APPIDAPIKeyAPISecret,以英文分号;分隔
  5. 执行程序

示例

设计思路

  1. 剪裁视频→getVideo()
  2. 将台词写入文本→getText(file)
  3. 获取视频总时长→getLength(video)
  4. 给视频添加背景音乐→add_audio(video, mp3, output='out.mp4')
  5. 给视频添加字幕→subTitle(text_file, video_file, output='out_sub.mp4')
  6. 文本转人声→讯飞API
  7. 给视频添加人声→add_people(mp3_file, video_file)
  8. 清除中间生成的文件→clean()

LICENSE

知识共享许可协议
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可

rubbish-video-generator's People

Contributors

wmathor avatar xju-aslp avatar

Stargazers

Insomniaguo avatar

Watchers

 avatar

Forkers

maxinsomnia

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.