Giter Club home page Giter Club logo

ascii-media-player's Introduction

ASCII Media Player

A python program that creates ASCII graphics from images and videos. It can also play videos with subtitle support (given a .srt file)! ๐Ÿ˜ฑ

๐ŸŽ Motivation

You have seen Music Players, Stack-overflow surfers, Hacker News portals etc. in the terminal, so it is the logical next step ๐Ÿ˜…. Besides, the terminal makes almost everything appear x10 times more cool.

โš—๏ธ Dependencies

Language and Packages

The program runs using python3 The following python packages are used in the program:

  • pysrt
  • opencv-python
  • Pillow
  • numpy

These packages can be installed using any package manager for python like pip, conda, etc.

Terminal Requirements

All POSIX compliant terminals should work well. If you use windows, and the program doesn't work well, try switching to WSL (Windows Subsystem for Linux)

๐ŸŽฅ A Demo

demo-video.mp4

๐Ÿ› ๏ธ Usage

Navigate to the directory of the python script and run the following command

python generate.py $VIDEO_FILENAME $SUBTITLE_FILENAME $OPTION

If you want to run without subtitles then

python generate.py $VIDEO_FILENAME $OPTION

Here $VIDEO_FILENAME and $SUBTITLE_FILENAME are the full path to the files and $OPTION takes values 0 for black and white output and 1 for true colour output (see if your terminal supports true colour before enabling)

๐Ÿ“ TODO and Future Plans

  • Support 3-bit RGB (8-colours)
  • Support true colour (24-bit RGB) visit tc-version branch
  • Support automatic resizing
  • Support B&W output
  • Support subtitles

ascii-media-player's People

Contributors

jeremiasfuentes avatar pk-cod3ch3mist avatar tom712 avatar vishesh-dd4723 avatar yashee99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ascii-media-player's Issues

Add play/pause functionality

Add a command/key that allows user to pause/play the video render

Add a function that waits for a play pause keypress and in case of the key being pressed/event happening, pauses (or plays) the video, i.e. pauses the rendering at the current frame.

Code Reformat & OOP Construct

The present code is messy and redundant in many areas. It will be better if the code can be modularised and packaged into one class. It will also allow to wrap the curses function upon the code.

Requirements:

  • Create a class called AMP that will have all functions in it
  • Remove/merge redundant functions read_media and read_media_sub
  • Add options for tuning the functions

Add seeking capability

Add a command that allows user to seek to a specific timestamp in the video

  • Add this feature on startup (Good First Issue): Add an option or parameter for the program to start playback from a certain timestamp.
  • Add this feature while playing: Add a keypress or command that allows user to jump/seek to a specific timestamp while playback of a video

New logo needed!

The present logo is too simplistic and does not convey graphically the essence of ASCII Media Player.
Needed a new logo that is:

  • Minimal (or not if it is really impressive)
  • Conveys the essence of ASCII Media Player and text based interfaces in general
  • In SVG format

Please discuss and show the logo first in the discussion here before raising a PR.

True Colour in Python Curses

Support for true colour in python curses

Python curses fulfils almost all the needs for the program (keyboard inputs, timings and delays, seeking), except one. As of yet, python curses doesn't support true colours (it only supports 8 or 16 colors)
Therefore, any method to somehow use true colors in python curses is appreciated.
In case this is not possible, look at issue #2

Add support for 16-colour terminals

The current generator does not support coloured output for terminals with only 16 colours like Terminal.app and Command prompt in Windows. For these, the only option is black and white ascii-graphics.

  • Add a function that determines colour of individual ASCII characters to be printed while converting the image to 16-colours (4-RGB) space.
  • It will be appreciated if done by using dithering so that the image looks similar to the true colour one.
  • Both solutions using openCV/Pillow library functions or a self implementation of dithering are acceptable

Solutions that sit well with the current code structure, i.e. using options for True-Colour/B&W/4-RGB will be appreciated

Add automatic resizing

Use the curses module to detect change in terminal size and automatically resize the video render processes to adapt to it.
You can take inspiration and check the size transformation functions in the get_pixel_matrix function.

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.