I'm experimenting with doing as much as possible from a Linux TTY. Can I display images and play video there without starting a desktop or compositor?
Can I view images and play videos from a Linux TTY?
Answers
Yes. For video, try mpv --vo=drm followed by the file path from a TTY. That uses the kernel's Direct Rendering Manager to display video without X11 or Wayland. You can also try mpv without specifying the output driver, since it may select DRM automatically.
This depends on DRM support, your mpv build, and access to the graphics device. The video is drawn to the display, not rendered as text inside the console.
Reply to this answer
There's a distinction worth making here. A graphical terminal emulator can display images using a supported graphics protocol, but that doesn't mean the same image viewer will work in a plain Linux console. Tools such as timg rely on the capabilities of the terminal they're running in.
Reply to this answer
For a more old school route, look into framebuffer output. Some media players have framebuffer backends that can draw without a desktop. Check the options supported by your installed player and system, since the exact setup varies.
Reply to this answer
If actual pixels aren't a requirement, ASCII video is another option. MPlayer can render video as characters in the terminal. The result is more of a novelty than a substitute for normal playback, but it fits the text console challenge.
Reply to this answer
Add your answer
Answers are reviewed before publication.
208pages_unbound:
That sounds like what I was hoping for. So there's no need to start a compositor just for playback?
91b!throttle:
Right. The DRM output talks to the graphics device directly, so a compositor isn't required for that route.