Multimedia Applications on Linux Terminals

Source: Internet
Author: User
Tags time in milliseconds

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:

  1. $ 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 yourselfvideoUser Group.

Second, confirm/etc/modprobe.d/blacklist-framebuffer.confThe 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/modulesAdd two modules at the end:vesafbAndfbconAnd update the iniramfs image:

  1. $ sudonano/etc/initramfs-tools/modules
  2. #List of modules that you want to includein your initramfs.
  3. #They will be loaded at boot timein the order below.
  4. fbcon
  5. vesafb
  6. $ 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 composedvesafbModule.

Next, you need to modify your GRUB2 configuration. In/etc/default/grubYou will see a line similar to the following:

  1. GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

It may also have some other parameters. You don't need to worry about it.vga=789:

  1. GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=789"

After the restart, enter your terminal (Ctrl+Alt+F1) (LCTT note: In some releasesCtrl+Alt+F1The graphical interface is used by default. You can tryCtrl+Alt+F2), And then you can try to play a video. The following command specifiesfbdev2For 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:

  1. $ 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

fbiIs 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:

  1. $ Fbi file name

You can use the arrow keys to move the field of view in a large image.+And-Or userOrlTo Rotate 90 degrees to the right or left.EscapeYou can disable the image you want to view. You can alsofbiOne file list to enable playback of the magic lamp:

  1. $ Fbi --listfile example .txt

fbiAuto scaling is also supported. You can also use-aOption to control the scaling ratio.--autoupAnd--autodownIs used to notifyfbiOnly zoom in or out. You can use-- Blend [time]To specify the length of time in milliseconds. UsekAndjYou can switch the previous or next image in the file list.

fbiIt 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 fbiTo 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 entercmatrixAnd then you can useCtrl+CTo stop running. Runcmatrix -sThe screen saver mode is enabled. In this way, press any key to exit directly.-CYou 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.

-BAll 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.fbgsYesfbidaA PDF reader provided in the package. It can set the page size, resolution, specified page number, and mostfbiProvided options, except for someman fbgsThe unavailable options listed in. I mainly use the page size option. You can select-l,xlOrxxl:

  1. $ 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.