Giter Site home page Giter Site logo

geraldinee / video-to-ascii Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joelibaceta/video-to-ascii

0.0 2.0 0.0 28.82 MB

It is a simple python package to play videos in the terminal using characters as pixels

License: MIT License

Python 100.00%

video-to-ascii's Introduction

Logo

It's a simple python package to play videos in a terminal using ASCII characters.

PyPI version Maintainability contributions welcome HitCount

Installation

pip install video-to-ascii

The installation will copy the main script to your PATH and making it available for general use.

How to use

In your terminal just run video-to-ascii + your video path.

$ video-to-ascii myvideo.mp4

How it works

Every video is composed by a set of frames that are played at a certain frame rate.

frames

Since a terminal has a specific number of rows and columns, we have to resize our video to adjust to the terminal size limitations.

frames

To reach a correct visualization of an entire frame we need to adjust the frame height to match the terminal rows, avoiding using more characters than the number of terminal columns.

frames

When picking a character to represent a pixel we need to measure the relevance of that pixel's color in the frame, based on that we can then select the most appropriate character based on the intensity they represent.

frames

The reduced range of colors supported by the terminal is a problem we need to account for. Modern terminals support up to 256 colors, so we need to find the closest 8 bit color that matches the original pixel color, we call this set of 256 colors ANSI colors.

frames

Finally, when putting it all together, we will have an appropriate character for each pixel and a new color.

frames

video-to-ascii's People

Contributors

joelibaceta avatar unjavascripter avatar

Watchers

James Cloos avatar Geraldine 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.