Skip to content

JMit-dev/termplayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASCII Video Player

An ASCII video player that takes a video file, extracts its frames, converts them to ASCII art, and plays the video in the terminal, synchronized with audio playback.

Features

  • Converts video frames to ASCII art and displays them in the terminal.
  • Synchronizes audio playback with the video frames.
  • Supports frame rate detection and automatic synchronization with the terminal’s width and height.
  • Extracts audio and plays it alongside the ASCII video using pygame.
  • Uses ffmpeg to extract frames and audio from the input video.

Requirements

To run the ASCII video player, you need the following dependencies:

Python Packages

  • imageio
  • imageio-ffmpeg
  • Pillow
  • pygame
  • curses (built-in on Unix systems, windows-curses on Windows)

Install Dependencies

You can install the required dependencies using pip:

pip install imageio imageio-ffmpeg pygame Pillow

For Windows users, install windows-curses:

pip install windows-curses

FFmpeg

Make sure you have ffmpeg installed on your system for frame and audio extraction.

  • On Ubuntu:

    sudo apt install ffmpeg
  • On macOS:

    brew install ffmpeg
  • On Windows, download from ffmpeg.org and ensure it is added to your PATH.

Usage

Running the Program

To run the program, you need to provide the path to a video file. The program will extract frames, convert them to ASCII, and synchronize with audio playback.

Example usage:

python main.py <path_to_video.mp4>

Command-Line Arguments

  • video_path: The path to the input video file.
  • width: The desired width of the terminal (default: terminal width).
  • height: The desired height of the terminal (default: terminal height).
  • fps: The frames per second (FPS) to synchronize the video with.
  • audio: A boolean flag to enable or disable audio playback (default: True).

Example

python main.py your_video.mp4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages