Full screen video playback on the console

You can play back video on the console of without installing a graphical interface providing you enable the framebuffer.

Start by making sure your system it up to date and then install mplayer if it is not already installed.

# apt-get clean;apt-get update;apt-get upgrade
Hit http://security.debian.org jessie/updates InRelease
  :
  :
  :
Fetched 157 kB in 2s (57.5 kB/s)
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
# apt-get install mplayer –no-install-recommends
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘mplayer2’ instead of ‘mplayer’
The following extra packages will be installed:
  liba52-0.7.4 libavformat56 libbs2b0 libgif4 liblircclient0 liblua5.2-0
  libmad0 libmpg123-0 libpostproc52 libquvi-scripts libquvi7 libswscale3
Suggested packages:
lirc
The following NEW packages will be installed:
  liba52-0.7.4 libavformat56 libbs2b0 libgif4 liblircclient0 liblua5.2-0
  libmad0 libmpg123-0 libpostproc52 libquvi-scripts libquvi7 libswscale3
  mplayer2
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,176 kB of archives.
After this operation, 5,661 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
  :
  :
  :
Setting up mplayer2 (2.0-728-g2c378c7-4+b1) …
Processing triggers for libc-bin (2.19-18+deb8u10) …

The next thing we need to do is enable the framebuffer device.

# nano /etc/initramfs-tools/modules

# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax: module_name [args …]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod
fbcon
vesafb

Then update the system.

# update-initramfs -u

When playing video on the console you really need to clear the screen first and redirect stderr and stdout to the null device. This will still allow you to control playback using the normal mplayer keys.

# clear;mplayer -vo fbdev2 video.mpg 2>/dev/null 1>&2

To start mplayer in the background as a detached process you need to redirect stderr, stdout and stdin.

# mplayer -vo fbdev2 video.mpg 2>/dev/null 1>&2 /dev/null 1>&2 </dev/null &

Advertisements
This entry was posted in Linux and tagged . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s