batimg is a small program written in Rust, designed to be fast and compatible with every terminal.
It can print images and play videos in almost every format in your terminal.
Build bin and install dependencies: cargo build --release
Bin location: ./target/release/batimg
- ffmpeg - Required for video playback
- yt-dlp (optional) - Required for YouTube URL support
- Install:
pip install yt-dlpor download from https://github.com/yt-dlp/yt-dlp
- Install:
USAGE:
batimg [OPTIONS] <FILE>
ARGS:
<FILE> Path to the media or YouTube URL
OPTIONS:
-d, --debug Print debug stats
-a, --audio Play video audio (unstable)
-h, --help Print help information
-l, --loop Loop the video
-s, --size <u32> Canvas size
-r, --resolution Disable high resolution mode (half pixel character)
-p, --prerender Export frames first (unstable)
-t, --timesync Disable realtime synchronization
-V, --version Print version information
EXAMPLES:
batimg img.png
batimg img.jpg -s 100
batimg video.mp4 -a
batimg animation.gif
batimg https://www.youtube.com/watch?v=dQw4w9WgXcQ
batimg https://youtu.be/dQw4w9WgXcQ -a
- Show images
- Play videos
- Play audio
- Improve the resolution
- Improve cleaning escape codes
- Getting rid of FFmpeg high CPU usage (Frame extraction)
| batimg | catimg | |
|---|---|---|
| creation date | 2021 | 2013 |
| language | rust | shell/c |
| format | almost all | png/jpg/gif |
| dependencies | ffmpeg (videos), yt-dlp (optional, for YouTube) | imagemagick |
| resize algorithm | nearest neighbor | nearest color |
| resolution | ▀ / █ | ▀ / ██ |
| video support | yes | no |
| audio support | yes | no |
| CPU usage | medium (images) high (videos) | medium |
| prerendering | Disabled by default | Always enabled |
| time sync | Enabled by default | Seems enabled, but not on every gif |
Rendering comparison on pixel arts.

