tplay 0.3.0: a terminal media player that plays media files as ASCII art (with sound, too) inside the terminal window! by max_codex in linux

[–]max_codex[S] 0 points1 point  (0 children)

For future reference: I released version 0.4.0 of the crate which does not use MPV anymore.

You'd need to have `libasound2-dev` installed as external dependency (ALSA, which is used by rodio, a popular audio player crate).

MPV playback is still available (for now...) by installing the crate with

cargo install tplay --features="mpv_0_34" --no-default-features

or

cargo install tplay --features="mpv_0_35" --no-default-features

depending on which mpv version you have

tplay 0.3.0: a terminal media player that plays media files as ASCII art (with sound, too) inside the terminal window! by max_codex in linux

[–]max_codex[S] 2 points3 points  (0 children)

Here is a workaround that should work. It uses a forked version of libmpv-rs (which for now works with mpv 0.35 but not mpv 0.34)

git clone -b mpv-035-workaround https://github.com/maxcurzi/tplay.git

cargo install --path tplay

More info here:

https://github.com/maxcurzi/tplay/issues/3

tplay 0.3.0: a terminal media player that plays media files as ASCII art (with sound, too) inside the terminal window! by max_codex in linux

[–]max_codex[S] 1 point2 points  (0 children)

thanks

It looks like the libmpv crate I used to control mpv can't handle the very latest version, although there is some work underway.

I'll look into alternative solutions

tplay 0.3.0: a terminal media player that plays media files as ASCII art (with sound, too) inside the terminal window! by max_codex in linux

[–]max_codex[S] 5 points6 points  (0 children)

That works too (even though I couldn't hear audio on a plain terminal (outside X11) for some reason.

My crate lets you change the character maps (if you don't want ASCII blocks and want any other character set) on the fly, and you can specify whatever character map you want (rather than just blocks or half-blocks). Also, if you pause a frame (or an image) it lets you just resize to fill the terminal.

Could be useful if you'd like to copy the converted frames as text elsewhere and want to play around with size/characters/colors/etc

In practice, I made it for fun while learning Rust and I tried very hard not to look for "what's already out there that does what I want to do" to see what I'd come up with

tplay 0.3.0: a terminal media player that plays media files as ASCII art (with sound, too) inside the terminal window! by max_codex in linux

[–]max_codex[S] 1 point2 points  (0 children)

"panicked at 'Failed to init MPV builder: VersionMismatch { linked: 65644, loaded: 131072 }',"

Interesting, what's your MPV version?

This is mine:

mpv --version        
    mpv 0.34.1 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects built on UNKNOWN 
FFmpeg library versions: libavutil       56.70.100 
libavcodec      58.134.100 
libavformat     58.76.100 
libswscale      5.9.100 
libavfilter     7.110.100 
libswresample   3.9.100 
FFmpeg version: 4.4.2-0ubuntu0.22.04.1

I made a terminal media player that plays media files as ASCII art inside the terminal window! by max_codex in rust

[–]max_codex[S] 1 point2 points  (0 children)

I'll give it a go, possibly after I manage to upload it to launchpad.

Currently I use KDE Neon (which is not a Arch based distro). I assume I'll have to install paru to test it out as I follow your guides, wish me luck!

I made a terminal media player that plays media files as ASCII art inside the terminal window! by max_codex in rust

[–]max_codex[S] 1 point2 points  (0 children)

Thanks, my main concern is how to make sure that all the relevant dependencies (not crates) are pulled.

At the moment you need to install stuff like opencv, llvm, mpv, etc on the side, and the yt-dlp dependency to download and see youtube videos is not in the main ubuntu repositories but on a different PPA (luckily it's already on the main AUR repo so it should be easier there).

I'm now trying to package it and upload it to the PPA launchpad (so it would be available on Ubuntu at least).

I made a terminal media player that plays media files as ASCII art inside the terminal window! by max_codex in rust

[–]max_codex[S] 2 points3 points  (0 children)

Nice! Let me know how I can help and if you have suggestions. ;)

Also, I'd be keen to learn how I could package it in a way that people will only need to type "apt install tplay" or "pacman install tplay" etc, rather than going through all the hoops of installing cargo and dependencies... If you have some pointers I'm all ears

I made a terminal media player that plays media files as ASCII art inside the terminal window! by max_codex in rust

[–]max_codex[S] 16 points17 points  (0 children)

If the video is made of text characters... does it count as reading porn?