How to watch films/images without X?

For Images:

You can watch images with fbi:

NAME
       fbi - linux framebuffer imageviewer

SYNOPSIS
       fbi [ options ] file ...

DESCRIPTION
       fbi  displays  the  specified  file(s) on the linux console using the framebuffer device.  PhotoCD, jpeg, ppm,
       gif, tiff, xwd, bmp and png are supported directly.  For other formats fbi tries to use ImageMagick's convert.

Example command:

$ fbi path/to/file.jpg

For videos:

  • You can use vlc from tty/console:

    Example command:

    $ vlc /path/to/file.mp4
    
  • You can also use mplayer:

    $ mplayer /path/to/file.mp4
    

    Note: Video output drivers can be set by -vo option e.g caca, fbdev.(This external article may help)


It's availability depends on the kernel features, but by using the Linux framebuffer provided by the kernel (or Direct Framebuffer library, which allows hardware acceleration) it should be possible to play video on the console, too.

For example, using MPlayer: mplayer -vo fbdev filename.avi or mplayer -vo directfb filename.avi should do the trick if all the required pieces are in place. As pointed out in the other answer, vlc might be easier to get working and it also supports both the old FB and DirectFB.

Wikipedia article says the following about the framebuffer:

There are three applications of the Linux framebuffer.

  • An implementation of text Linux console that doesn't use hardware text mode (useful when that mode is unavailable, or to overcome its restrictions on glyph size, number of code points etc.). One popular aspect of this is the ability to have console show the Tux logo at boot up.
  • A possible graphic output method for a display server, independent of video adapter hardware and its drivers.

  • Graphic programs avoiding the heavy overhead of the X Window System.

The last item includes several Linux programs such as MPlayer, links2, Netsurf, fbida and libraries such as GGI, SDL, GTK+ and Qt Extended can use the framebuffer directly. This is particularly popular in embedded systems.

There is now a library DirectFB which provides a framework for hardware acceleration of the Linux framebuffer.

There's also a Q & A exactly on this topic on this very same forum, and of course the old Framebuffer HOWTO.

Most notably, you should have /dev/fb0 character device available (or more than one if there are multiple framebuffer devices available). At the bare minimum, the output of zcat /proc/config.gz |grep FB should contain CONFIG_FB=y, but I'm not quite sure if the modern GPUs with DRM also need a sort of a legacy driver to make FBDEV work (in my case, I seem to have CONFIG_DRM_I915_FBDEV=y for the Intel GPU).

Tags:

Linux

Graphics