A video player for your terminal that generates a standalone executable that plays your video.

Overview

Szmelc Player

Szmelc Player is a program that converts any video you give it to a standalone executable that plays the video in the terminal. It uses FFmpeg to decode the video, so you can feed it any format you'd like - it's pretty much guaranteed to support it.

The end user does not need FFmpeg because the video frames are embedded as raw pixel data into the final executable.

Szmelc Player requires a C99-compliant C compiler to function. Only Unix-based systems are supported because they're based and Windows is cringe because of poor ANSI escape sequence support on Windows. Yes, I know Windows Terminal supports them, but there are other problems preventing Szmelc Player from running on Windows such as the lack of usleep.

What does "szmelc" mean?

Szmelc in Polish means junk, trash. It's pronounced like shmeltz. The program is called that because it's an absolutely horrible way to watch videos.

Alright shut up, how do I use it?

Well first you need to compile it:

$ cargo build --release
# To install the executable in ~/.cargo/bin:
$ cargo install --path .

Then the usage is as follows:

$ szmelc-player <input file> <output file>
# It is strongly recommended to scale the video down as the "pixels" output by szmelc-player are
# quite large (each pixel is 1x0.5 characters in your terminal).
# Thus, to make the video fill up an 80x24 terminal window, you need to double the height.
$ szmelc-player input.webm output --resize 80x48

It's possible to only generate the C code, without compiling, by using the --generate-c flag.

$ szmelc-player input.webm output.c --resize 20x12 --generate-c
$ head output.c -c1000
// “Dr. Szmelc is back, baby.”
// Generated by szmelc-player version 0.1.0

#define VIDEO_WIDTH (80)
#define VIDEO_HEIGHT (48)
#define SLEEP_INTERVAL (33366)
const unsigned char video_data[] = {103,103,103,103,103,103,103,103,103,103,103,103,104,104,104,107,107,107,109,109,109,110,110,110,111,111,111,112,112,112,113,113,113,113,113,113,113,115,120,115,116,122,115,116,122,115,116,122,115,116,122,115,116,122,115,116,122,115,116,122,116,117,123,116,117,123,116,117,123,116,117,123,116,117,123,116,117,123,116,117,123,116,117,123,117,117,122,117,117,122,126,118,115,127,119,116,131,119,113,131,119,113,131,119,113,131,119,113,131,119,113,131,119,113,131,119,113,131,119,113,131,119,113,131,119,113,130,118,112,130,118,112,130,118,112,130,118,112,130,118,112,130,118,112,130,118,112,129,117,111,129,117,111,129,117,111,127,116,110,127,116,110,127,116,110,126,115,109,126,115,109,125,113,108,125,113,108,125,113,108,124,112,107,123,111,105,123,111,105,122,110,104,120,109,103,120,109,103,119,108,10

By default, Szmelc Player will compile the C code using the default system compiler cc (usually symlinked to gcc). It is possible to specify a different compiler (eg. clang) by using the $SZMELC_CC or $CC environment variables (the former will take priority).

gcc and clang are quite resource hungry, but unfortunately it's not possible to use tcc quite yet, as it fails to compile miniaudio (which Szmelc Player uses for audio output). At some point a better solution involving compiling miniaudio separately might get added.

You might also like...
Small, compact music player written with Rust.

trill Small, compact music player based on rodio. Usage Run the program with --help to see the available options. To just play a sound file: trill -p

Very simple, efficient, task oriented, low cognitive, Midi player and jukebox for midi instruments
Very simple, efficient, task oriented, low cognitive, Midi player and jukebox for midi instruments

Midi and Virtual Book jukebox Player A cross-platform MIDI and virtual book jukebox player. It only includes the necessary functionalities to play MID

Spotify for the terminal written in Rust 🚀
Spotify for the terminal written in Rust 🚀

Spotify TUI A Spotify client for the terminal written in Rust. The terminal in the demo above is using the Rigel theme. Spotify TUI Installation Homeb

Midnote is a terminal application that reads a MIDI file and displays you its notes bar-by-bar, while playing it.

MIDNOTE Midnote is a terminal application that reads a MIDI file and displays you its notes bar-by-bar, while playing it. Goals As a blind musician my

A small program to feed the audio from your QRP-Labs QDX digital transceiver through to your computer's speakers

A small program to feed the audio from your QRP-Labs QDX digital transceiver through to your computer's speakers. Also gives you a small user interface in which you can see a signal-strength meter, control the output volume coming from your speakers, and to tune the QDX to a particular frequency (receive SSB and other signals!).

Polaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device.
Polaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device.

Polaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device. Polaris works by streami

Your musical pokedex, Plex for music
Your musical pokedex, Plex for music

Musidex Your musical pokedex, Plex for music. Add songs from youtube videos or youtube playlist to your library, or import them from your local files.

Encrypt and decrypt files by playing melodies on your MIDI keyboard.

midicrypt Encrypt and decrypt files by playing melodies on your MIDI keyboard. Written in Rust. ❯ ./midicrypt -h midicrypt 0.1.0 NINNiT Encrypts and D

Effortlessly beautify your Spotify playlists with just a single, enchanting script 💫 🎵

harmonia harmonia, effortlessly beautify your Spotify playlists with just a single, enchanting script. 💫 🎵 HANDLE WITH LOVE: Since harmonia is bloss

Comments
Owner
I make software nobody uses.
null
A terminal music player written in the Rust language.

A terminal music player written in the Rust language. (Windows) Requirements Configuration file path: C:\Users\xxx\.config\music_player\config.yml # P

xiao hui 162 Nov 12, 2022
A next-generation music player and manager

ouverture A next-generation music player and manager Very much at Work-In-Planning stage now Planned features GUI (localizable) Backend (something lik

Michael B 9 Nov 17, 2022
MRVN is a Discord music player bot.

MRVN is a Discord music player bot. It has a few neat features: Supports a wide array of sites, including Youtube, Soundcloud, Twitch and many mo

Tom Barham 17 Jan 1, 2023
A simple CLI audio player with strange features.

legacylisten legacylisten is a simple CLI audio player I wrote because no existing one fulfilled my needs. The main feature is that you can change how

Matthias Kaak 3 Jun 8, 2022
A simple GUI audio player written in Rust with egui. Inspired by foobar2000.

Music Player A simple GUI music player inspired by foobar2000 written in Rust using egui. The goal of this project is to learn about making gui/ nativ

Ryan Blecher 5 Sep 16, 2022
Rust Audio Player Daemon

Rust Audio Player Daemon Cause mpd was annoying What rapd trys to do Rapd is not a spotify client, or an advanced music player. Its an audio/music dae

ash 3 Nov 1, 2022
VR media player for linux

VR media player for linux Very early development access version. I'll drop more notes here once it's ready for more publicity. Some details: Uses wgpu

null 4 Oct 7, 2022
Arexibo is an Rust Linux Xibo player

Arexibo is an alternate Digital Signage Player for Xibo, implemented in Rust with the GTK GUI components, for Linux platforms.

Georg Brandl 2 Dec 6, 2022
The definitive e-book reader music player (Kobo, Kindle)

Introduction E-ink devices have traditionally been only for reading... well no more! Buck is a fully-fledged music player for e-ink devices (tested fu

BillK 11 Oct 28, 2022
Template project for the The Bombercrab Challenge game, a stub Rust WASM player

The Bombercrab Challenge (Player Template) Welcome to the 2022 Tokyo Game Hack bombercrab challenge! If you're based in Tokyo and planning to attend i

Tonari, Inc 10 Sep 4, 2022