Giter Site home page Giter Site logo

random-yang / video2asciiart Goto Github PK

View Code? Open in Web Editor NEW
47.0 5.0 5.0 87.81 MB

🎥 🎨一个将普通视频实时转换为字符画视频的Vue组件

Home Page: https://random-yang.github.io/Video2ASCIIArt/dist/index.html

License: MIT License

JavaScript 48.15% HTML 10.42% Vue 41.43%
asciiart video-filter video vue

video2asciiart's Introduction

Video2ASCIIArt

🎥 🎨一个将普通视频实时转换为字符画视频的Vue组件

视频素材来源KBHD

npm version week download

English | 中文

📒 如何使用

通过 npm 引入

试玩儿

$ npm install video2asciiart
# or
$ yarn add video2asciiart
<template>
    <div class="container">
        <Video2ASCIIArt>
            <video :src="videoURL" controls="controls" crossorigin=""></video>
        </Video2ASCIIArt>
    </div>
</template>
<script>
import Video2ASCIIArt from 'video2asciiart'

export default {
    components: {
        Video2ASCIIArt
    }
}
</script>

CDN <script> 标签引入

标签用法 (此在线 demo 在 safari 上可能会有问题)

<meta charset="utf-8" />
<title>Video2ASCIIArt demo</title>
<!-- import vue -->
<script src="https://unpkg.com/vue"></script>
<!-- import the component -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/Video2ASCIIArt.umd.js"></script>

<div id="app">
    <demo charppi="2" color="gray">
        <!-- normal video tag -->
        <video
            src="../../your/video/url"
            controls="controls"
            crossorigin=""
        ></video>
    </demo>
</div>

<script>
    new Vue({
        components: {
            demo: Video2ASCIIArt
        }
    }).$mount('#app')
</script>

组件属性

Props Name Type Default Description
charppi String|Number 1 改变字符的密度[0.25|0.5|1|2]
color String #000000 控制字符的颜色 (css like)

⛏️ 贡献代码

欢迎 pr && issue!

安装依赖

yarn install

快速开发(HMR)

yarn run serve

构建打包组件

yarn run build:lib

构建打包 demo

yarn run build:demo

TODO

  • 内存优化(目前打开开发者工具查看内存,有比较明显的阶段性内存递增和 GC,而且占用的内存较大)
  • 丰富控件功能
  • 增加字符画的可调节参数的维度
  • resize

License

MIT

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.