Multimedia Applications on Linux Terminals
The Linux terminal supports multimedia, so you can listen to music, watch movies, watch pictures, or even read PDF files on the terminal.
In my previous article, we learned that Linux terminals support multimedia. Yes, this is true! You can use Mplayer, fbi, and fbgs to listen to music, watch movies, view photos, and even read PDF without opening X sessions. In addition, you can use CMatrix to experience Matrix Screen Protection.
However, you may need to make some modifications to the system to achieve the preceding objectives. The following operations are performed on Ubuntu 16.04.
MPlayer
You may be familiar with MPlayer with many features. It supports almost all formats of video and audio and can run on most existing platforms, such as Linux, Android, Windows, Mac, Kindle, OS/2, and even AmigaOS. However, to run MPlayer on your terminal, you may need to do more work, which is related to your Linux release. Let's try to play a video first:
$ Mplayer [video file name]
If the above command is executed normally, it is very good. Next you can focus on the common options of MPlayer, such as setting the video size. However, some Linux distributions have different processing methods for Frame Buffer framebuffer, so you need to make some additional settings to make it work properly. The following are some operations that need to be done on the latest Ubuntu release.
First, add yourselfvideo
User Group.
Second, confirm/etc/modprobe.d/blacklist-framebuffer.conf
The file contains the following line:#blacklist vesafb
. This line should be commented out by default. If not, manually comment out it. In addition, other module lines must be confirmed not to be commented out so that other modules are not loaded. Note: If you want to use frame buffer framebuffer more deeply, these modules for your graphics card can help you achieve better performance.
Then/etc/initramfs-tools/modules
Add two modules at the end:vesafb
Andfbcon
And update the iniramfs image:
$ sudonano/etc/initramfs-tools/modules
#List of modules that you want to includein your initramfs.
#They will be loaded at boot timein the order below.
fbcon
vesafb
$ sudo update-initramfs -u
Fbcon is a Linux frame buffer framebuffer terminal. It runs on frame buffer framebuffer and adds graphic functions to it. It requires a frame buffer framebuffer device, which is composedvesafb
Module.
Next, you need to modify your GRUB2 configuration. In/etc/default/grub
You will see a line similar to the following:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
It may also have some other parameters. You don't need to worry about it.vga=789
:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=789"
After the restart, enter your terminal (Ctrl+Alt+F1
) (LCTT note: In some releasesCtrl+Alt+F1
The graphical interface is used by default. You can tryCtrl+Alt+F2
), And then you can try to play a video. The following command specifiesfbdev2
For the video output device, although I haven't figured out how to choose which input device to use, I have used it successfully. The default video size is 320x240. Here I scale it to 960:
$ mplayer -vo fbdev2 -vf scale -zoom -xy 960AlienSong_mp4.mov
See figure 1. The rough picture is because the quality of my original video is not high, not the problem of MPlayer display.
Figure 1 Video Playback
MPlayer can play CD, DVD, and network video streams, and has a series of playback options, which will be left as a task for you to discover.
Fbi Image Viewer
fbi
Is a frame buffer Image Viewer. In most Linux distributions, it is included in the fbida package. It supports some common image formats.convert
(From Image Magick), it can also open some other formats. The simplest method is to view an image file:
$ Fbi file name
You can use the arrow keys to move the field of view in a large image.+
And-
Or user
Orl
To Rotate 90 degrees to the right or left.Escape
You can disable the image you want to view. You can alsofbi
One file list to enable playback of the magic lamp:
$ Fbi --listfile example .txt
fbi
Auto scaling is also supported. You can also use-a
Option to control the scaling ratio.--autoup
And--autodown
Is used to notifyfbi
Only zoom in or out. You can use-- Blend [time]
To specify the length of time in milliseconds. Usek
Andj
You can switch the previous or next image in the file list.
fbi
It also provides commands to create a file list for the files you have browsed, export your commands to files, and a series of other great options. You can useman fbi
To view the complete list of options.
CMatrix terminal screen saver
The Matrix screensaver is still one of my favorite Screensaver (2), second only to bouncing cow. CMatrix can be run on a terminal. To run it, just entercmatrix
And then you can useCtrl+C
To stop running. Runcmatrix -s
The screen saver mode is enabled. In this way, press any key to exit directly.-C
You can set the color of the parameter, for example, Green (green
), Red (red
), Blue (blue
), Yellow (yellow
), White (white
), Purple (magenta
), Blue (cyan
) Or black (black
).
Figure 2 black guest empire Screensaver
CMatrix also supports asynchronous buttons, which means you can change the setting options when it is running.
-B
All settings are in bold, while-b
(LCTT: the original text is accidentally-B
.
Fbgs PDF Reader
It seems that PDF documents are popular and unavoidable, and PDF is much better than its previous functions, such as hyperlinks, copy and paste, and better text search functions.fbgs
Yesfbida
A PDF reader provided in the package. It can set the page size, resolution, specified page number, and mostfbi
Provided options, except for someman fbgs
The unavailable options listed in. I mainly use the page size option. You can select-l
,xl
Orxxl
:
$ fbgs -xl annoyingpdf.pdf
You are welcome to learn more about Linux Through the Linux Foundation and the Free "Linux getting started" course provided by edX.
Https://www.bkjia.com/Linux/2018-02/150954.htm