Universal player in Linux-mplayer

Source: Internet
Author: User
Tags high cpu usage
ArticleDirectory
    • 1. Preface
    • 2. Compile and install mplayer
    • 3. Configuration File
    • 4. Play ape
    • 5. Global shortcut
    • 6. Todo
1. In the preface, mplayer is not only available in Linux, but also in windows, and has many users. This article mainly records some problems and solutions I encountered during configuration and use of mplayer. Mplayer itself is very powerful, but the powerful features often need to be tuned to make it easy to use (sigh... this is not good for Linux software ......). 2. Compile and install mplayer. Most Linux distributions can install mplayer directly from the source, for example, Debian: Sudo apt-Get install mplayer However, the software in the source is generally not the latest. At the same time, the author has a little bit of "Cleanliness". Many software prefer to compile it by themselves, it is mainly to remove those features that I don't need during compilation (should I use Gentoo ?). Mplayer home page: http://www.mplayerhq.hu/design7/dload.html I am directly downloading SVN source code:

SVN checkout SVN: // SVN. mplayerhq. hu/mplayer/trunk mplayer

Let's take a brief look at the README file and start Compilation: ./Configure -- libdir =/usr/lib/-- enable-Gui -- language = EN, zh_cn -- enable-menu
Make-J 2
Make install The parameters are not explained, as shown in./configure -- help. After compilation and installation, I found that-vo cannot use XV but X11, which is obviously a bit uncomfortable. At the beginning, I thought it was my own video card (915 set display, really bad ......), Later, I checked the configure. Log File and found the Section checking for XV. I found that the header file X11/xlib. h was not found, so

Apt-file search xlib. h

Find the libx11-dev package, install it, and re-configure & make,-vo can use XV.

The main reason for writing down the above section is to emphasize one point, When encountering a problem, you should learn to find the root cause of the problem and solve it by yourself. This is often more efficient than Google. 3. configuration file ~ /. Mplayer/config, new by yourself. The content of my file is as follows: Vo = XV, gl_nosw, X11
Ao = ALSA, OSS

Font = 'wenquanyi micro hei'
Sub-Fuzziness = 1
# Subcp = enca: Zh: cp936
Subcp = cp936
Subfont-autoscale = 2
Subfont-OSD-scale = 2.5
Subfont-text-scale = 3
Ass = true
Embeddedfonts = true
Slang = EN, ZH
SID = 0

Cache = 8192
Skin = iTunes here, for instructions on subtitles, see: http://blog.chinaunix.net/u1/53025/showart_1737097.html skin files can be obtained from the above mplayer download page. Download and decompress the package ~ /. Mplayer/skins. Skin is used for gmplayer. When gmplayer is started for the first time, several guis are generated based on the config file. * configuration file. Later, these configurations will be independent of the root config, so modifying the config will not affect the GUI. * If you want to modify it, you must modify it in two ways.

Some common shortcut keys are detailed in manpages. Here is a brief introduction.

4. audacious, which has been used to play back an ape before, has a high CPU usage. It plays the same ape on my computer and uses more than 20% of the CPU, while mplayer only occupies about 5% of the memory, it immediately uninstalls audacious ...... However, there is a problem that mplayer does not recognize the cue sheet, so it is impossible to split the video. After searching for an archive on the internet, it seems that there is no solution, so I decided to split the ape file. You can search for shntool on the Internet. For details, refer to this article. 5. I think this may be the focus of this article. The previous content can be found on the Internet. I don't seem to have any good solutions on the Internet. I just used xdotool over the past two days and found that I could simulate the send button action to the window. So I tried it. But when I encountered a problem, mplayer did not modify the terminal title of it, I usually open several terminal statements, so I cannot find the mplayer window through the title. Why do I have to use the terminal mplayer instead of the gmplayer after half a day of epiphany? Try gmplayer now, with a separate window, and pass

Xdotool search -- title "mplayer"

Here is a simple control script:

#! /Bin/bash

WID = 'xdotool search -- title mplayer | head-N 1'
If ["x $ widx" = "XX"]; then Echo "No mplayer window found." fi
Case $1 in
Play)
Xdotool type -- window $ WID ""
;;
Pause)
Xdotool type -- window $ WID ""
;;
Next)
Xdotool type -- window $ WID ">"
;;
PREV)
Xdotool type -- window $ WID ">"
;;
Vup)
Xdotool type -- window $ WID "0"
;;
Vdown)
Xdotool type -- window $ WID "9"
;;
Quit)
Xdotool type -- window $ WID "Q"
;;
*)
Echo "unknow Arg: $1"
;;
Esac

 

With this script, you can easily control mplayer: Control-mplayer Prev/next/... and then use the gnome metacity to bind a global hot key! 6. The next step of todo is to study how to extract the Google music list and the corresponding music address, write a script, and open the specified list played by mplayer directly on the command line.

 

Reprinted please indicate the source:Http://www.cnblogs.com/stephenjy/archive/2010/03/02/1676762.html 

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.