7

I know the console (outside X11, e.g. /dev/tty1) works in text-mode, but I think if it is possible to play music using programs like cvlc and mplayer, it should be possible to view pictures and watch videos by launching the viewer program in a single process too.

I am aware of some programs that convert media to ASCII or display media in terminals, but I am only interested about a graphical display in the console without any conversion to ASCII art.

easl
  • 2,008
  • Do you mean on a terminal using ASCII art? Or do you mean in a console, i.e. without X? “Tty” is any terminal, but the way you've worded your question makes it sound like you're interested in getting graphics outside X. P.S. DON'T shout. – Gilles 'SO- stop being evil' Jun 14 '13 at 23:18
  • I was interested in doing so without X, without pseudoterminal (pty) in GUI. PS corrected the post, I'm sorry if it felt like i was shouting. – easl Jun 14 '13 at 23:29
  • Please see this answer. Also note that the console and pseudo-terminals are not necessarily contraindicative. Please see kmscon. – mikeserv Jun 17 '14 at 21:09
  • YFTR: You can get a clue of the image using ascii-art: apt install jp2a; jp2a --colors test.jpg – rubo77 Nov 04 '19 at 08:55

5 Answers5

3

X is the standard way to display graphics on Unix, so you're getting off the beaten path.

Linux gives access to the graphics console via SVGAlib. Applications using SVGAlib must be setuid root.

Your choice of applications is somewhat limited. You can use zgv to view pictures and mplayer to play movies. Also there is an SVGAlib backend in SDL, so any application that uses SDL can use SVGAlib.

“SVGAlib is far from dead”, as it says in the FAQ — last updated in 1999. Unless your computer is from the last century, you won't save a significant amount of memory by not running X. You won't get better speed either, probably worse than X as a lot more effort goes into optimizing X drivers than SVGAlib drivers. You're also exposing yourself to more driver bugs, especially if you switch between SVGAlib and X.

2

Well you always have the aa-library (ascii-art). For the virtual terminals (on Alt-F1 to Alt-F6) you can also use svga-lib to show viewers for movies pr pictures (though I don't think it'll work in xterm or similar programs). If your VTs are set-up to use frame-buffer, I believe that too will allow them to show graphics.

2

The libcaca library is possibly the more advanced software in this ascii art niche domain.

http://caca.zoy.org/wiki/libcaca

jlliagre
  • 61,204
1

It's important to remember what we a TTY is and does. Generally, we're talking about an emulator for a text terminal device. These devices process ASCII or some other encoding scheme and output specific characters. This means that it can only display characters that are represented in the code, which is usually not a single pixel (otherwise it would be a graphical terminal).

So, in order to view images and videos, you would need to convert theme to the character encoding supported by your terminal (e.g. asciiart).

zje
  • 2,311
  • I've installed fbi and fbgs packages, and now i can view pictures and pdf files in /dev/tty1 without startx or init 6. – easl Jun 14 '13 at 23:14
  • 1
    Those packages write to the framebuffer (hence the fb) via a graphics driver, not strictly the Linux text terminal driver - but it is the "graphics console" in one sense (not sure if that counts as tty). Either way, great find :-) – zje Jun 20 '13 at 22:49
0

Yes, use a terminal with Sixel support and show images directly in the terminal:

apt install libsixel-bin mlterm
mlterm
img2sixel test.jpg

works on Ubuntu 19.10!

enter image description here

rubo77
  • 28,966
  • 1
    actually sixel support rely on the terminal emulator support, xterm works fine, but in the default tty outside Xorg, I'm not sure if it's possible. – ton Sep 16 '20 at 21:07