GithubHelp home page GithubHelp logo

videotochars's Introduction

视频字符画转化器

使用方法:

本转化器没有可视化界面(因为麻烦)仅有控制台界面,运行转化过程请不要随意退出

video01.exe是以黑底为背景的

video02.exe是以白底为背景的

video02.exe是以亮灰为背景的

差异请从文件夹test上查看

其中有几个参数需要注意:

字符分辨率:以视频的宽为基准,值为多少即视频宽有多少个字符

开始/结束时间:转换器是截取原视频的片段进行转化的,以秒(s)为单位,所以请不要输入超出视频时长的部分。

之后就愉快的玩耍吧。

原理:

(1)通过moviepy.editor库的VideoFileClip来进行截取视频片段(会自动整合音频)

(2)通过逐帧读取视频获取每帧图像

(3)通过转化图像为灰度图,设置字符串组对应灰度系数(用了import numpy as np来解析灰度系数)

(4)通过画布功能直接改写帧图像,以字体的宽度分割图像为若干个图块。(用了from PIL import Image, ImageFont, ImageDraw)

(5)将改写后的帧图像集合成新视频

videotochars's People

Contributors

xs-jinbert avatar

Watchers

James Cloos avatar  avatar

Forkers

mylql

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.