分享
 
 
 

HOWTO MPlayer

王朝other·作者佚名  2006-01-27
窄屏简体版  字體: |||超大  

Contents

[hide]

1 Introduction

2 Emerge MPlayer

3 Command-Line Arguments

4 Configuration Files

5 Watching Videos

5.1 Keyboard Navigation

5.2 General Playback Options

5.3 Video Out Drivers

5.4 Video Out Options

6 Watching DVDs

6.1 DVD Audio Languages

6.2 DVD Surround Sound

6.3 Regional Support

7 Misc. Tips and Tricks

7.1 Get File Details

[edit]

Introduction

MPlayer is a high quality media player with a rich set of options that can playback almost every media file you can throw at it.

For more information see MPlayer Features and the quite extensive mplayer documentation.

This guide will attempt to explain how to setup MPlayer on your Gentoo system, provide some documentation for the most common uses, and cover some lesser-known features that may come in handy.

Feel free to add your own tips and tricks. Examples are also welcome.

[edit]

Emerge MPlayer

Complete instructions on how to emerge MPlayer and what USE flags to use can be found in HOWTO Emerge MPlayer.

[edit]

Command-Line Arguments

MPlayer has a lot of options for playback. See man mplayer if you're ambitious. :)

Note: If you have Konqueror installed, you can read the manpage in the browser by opening the URL man:/mplayer

As a general rule, the order of the arguments you pass to mplayer won't matter. If you've seen some examples before, you can switch around the options in any order, and things will work fine.

So, something like this:

mplayer dvd://5 -chapter 12 -ao oss -vo svga

would be the same as this:

mplayer -chapter 12 -vo svga dvd://5 -ao oss

The examples included in this guide will try to display them in a logical and consistent presentation so you can more easily distinguish which options are being passed

[edit]

Configuration Files

MPlayer stores per-user config files in the ~/.mplayer directory. For mplayer, you want to modify the file ~/.mplayer/config

Arguments that you would normally pass with mplayer would be put in the config file in format argument=option,option. If an argument has suboptions, each one is separated with a colon.

For example, if we always wanted to use these playback options:

mplayer dvd:// -vo xv -ao alsa -channels 4 -alang=en,es

this is what your ~/.mplayer/config would include:

File: ~/.mplayer/config

vo=xv

ao=alsa

channels=4

alang=en,es

and you would then get the same result when running this command:

mplayer dvd://

[edit]

Watching Videos

Once you have MPlayer installed, you're ready to watch something! All you will need to do is run mplayer, and then the file you want to watch.

mplayer movie.avi

[edit]

Keyboard Navigation

For those of you who don't like looking through MAN pages, here are some of the keys to control playback:

<- and -> seeks backward/forward 10 seconds

up and down seeks backward/forward 1 minute

pgup and pgdown seeks backward/forward 10 minutes

< and > backward and forward in playlist

p or spacebar pause / unpause

q or ESC stop playing and quit

/ and * or 9 and 0 to decrease/increase volume

m mutes sound

# cycles through available audio tracks

f toggles fullscreen (see also -fs)

T toggles stay-on-top (see also -ontop)

b and j toggles through available subtitles

[edit]

General Playback Options

Once again, these are only a few of the many options available that most people might be looking for. See the MAN page for more details. Almost all of these descriptions are taken straight from the man.

-quiet to display less console output

-v or -verbose to display more console output

-loop <number> loops movie playback <number> times. 0 means forever.

-playlist <filename> plays a filelist. May be required for some streaming video.

-cache <kBytes> sets "how much memory (in kBytes) to use when precaching a file or URL. Especially useful on slow media."

-cache-min <percentage> - "Playback will start when the cache has been filled up to <percentage> of the total."

-channels <number> changes the number of playback channels. See the man for a lengthier explanation on how this one works.

2 - stereo (default)

4 - surround

6 - full 5.1

-forceidx - "Force index rebuilding. Useful for files with broken index (A/V desync, etc). This will enable seeking in files where seeking was not possible."

-srate <Hz> - "Selects the output sample rate to be used (of course sound cards have limits on this)."

-ss <time> - "Seek to given time position." In other words, starts playback at the specified time index.

Seeks to 56 seconds:

mplayer movie.avi -ss 56

seeks to 1 hour 10 minutes:

mplayer movie.avi -ss 01:10:00

[edit]

Video Out Drivers

MPlayer has a lot of video out options. This will cover some of the more basic ones.

First of all, when you installed mplayer, there are a number of video output drivers you can use. You can see your list of possibilities by running mplayer -vo help

For example, if you compiled it with X in your USE flags, then you will see x11 in the list.

In each option below, if you want to use that video-out option, use -vo on the command line, or add vo=<value> to your config file.

Here is a short explanation on some of the video output options.

x11 is the most basic of video out options for display on X11 displays (your window manager). From the man page, "Shared memory video output driver without hardware acceleration that works whenever X11 is present."

xv is the next step up if did want to use hardware acceleration, and your video card supports it, and you installed mplayer with the xv USE flag. "If you cannot use a hardware specific driver, this is probably the best option." If unsure, use this option as your default.

sdl goes through the libsdl layer. SDL stands for Simple Directmedia Layer and is actually just a wrapper library that will use probably your best options anyway, assuming you installed the SDL libraries with the correct USE flags. You can always use this one if you want, and let SDL decide on the best output device to use for you.

See the man page for more options specific to using SDL.

gl and gl2 use the OpenGL video output driver. "Intended to work even with the most simple OpenGL implementations." see the man for more options specific to this driver.

There are also a few framebuffer output devices: fbcon for using /dev/fb0, vesa for any VESA VBA 2.0 compatible card, svga for using the svga library, and directfb for using DirectFB.

If you don't want to output any video at all (for whatever reason), just use the null driver.

aa and caca for ASCII art and color ASCII, respectively, which actually look pretty good sometimes.

There are still a few more drivers, but most desktop users will want to use one of the above.

[edit]

Video Out Options

Along with a wide selection of output drivers, MPlayer also offers you lots of ways to tweak the visual experience as well. Here are a few of the more common options available. Please note that some of these are only available while using certain video output drivers. See the man page for details.

-display <name> (X11 only)

"Specify the hostname and display number of the X server you want to display on." The default will, of course, use the display you are already in.

-fs enables fullscreen playback.

-ontop keeps MPlayer playback on top of other windows.

"Supported by video output drivers which use X11, except SDL, as well as directx and gl2."

-panscan <0.0-1.0> for pan and scan playback.

"Enables pan-and-scan functionality (cropping the sides of e.g. a 16:9 movie to make it fit a 4:3 display without black bands). The range controls how much of the image is cropped. Only works with the xv, xmga, mga, gl, quartz and xvidix video output drivers."

-rootwin plays the movie in the desktop background.

"Desktop background images may cover the movie window, though. Only works with the x11, xv, xmga, xvidix, quartz and directx video output drivers."

-stop-xscreensaver (X11 only)

"Turns off xscreensaver at startup and turns it on again on exit."

If you want to add any of these options to your ~/.mplayer/config just add =1 to the option.

stop-xscreensaver=1

[edit]

Watching DVDs

If you installed MPlayer with support for DVD playback, then you have a few more options.

First, playing a DVD:

mplayer dvd://

MPlayer will look for the longest title on the DVD and playback that file. In most cases the longest title will be the actual movie (on a DVD movie), and it will show that video.

If you want to play a different title other than the default one, you can specify it as a number after the dvd:// option. This example will play title three:

mplayer dvd://3

Most DVDs that are movies will also be split up into chapters. You can specify a chapter for playback by passing the -chapter argument. This example will play the default title, and the second chapter:

mplayer dvd:// -chapter 2

[edit]

DVD Audio Languages

A lot of movie DVDs these days come with more than one audio track in different languages.

Si quieres escuchar a tu disco favorito in castellano, es ray facil! Si el disco lo apoya, claro. :)

MPlayer will (usually) default to first audio language track (I think), but if you need to change it, you can use the -alang argument along with the language code.

This example will always play the English audio track:

mplayer dvd:// -alang en

Este ejemplo usa la lengua española:

mplayer dvd:// -alang es

You can also pass more than one language with the argument, so if the first is not available, it will fall back to the second, and then the next available:

mplayer dvd:// -alang hu,en,es

For more information about languages, see Demuxer/Stream Options in the man page.

[edit]

DVD Surround Sound

As you are probably aware, a lot of DVDs have their audio stream in surround sound stereo, or more than two channels. By default, MPlayer will downplay all the extra channels to stereo (two channel). This can be changed by using the -channels argument.

This example is the same as the default -- play a DVD in 2-channel stereo mode:

mplayer dvd:// -channels 2

For surround sound, change the number to four:

mplayer dvd:// -channels 4

For full 5.1 surround sound, change the number to six:

mplayer dvd:// -channels 6

For more information about how MPlayer handles channels, see Demuxer/Stream Options in the man page.

For help with sending the audio stream straight to your receiver, see HOWTO Dolby Digital Out (AC3, SPDIF)

[edit]

Regional Support

If you get errors like this when watching DVDs:

libdvdread: Invalid IFO for title 2 (VTS_02_0.IFO).

Cannot open the IFO file for DVD title 2.

then you can install regionset:

emerge regionset

Run it and follow the prompts to set your player's region code correctly (note there is a hardware limitation on your drive how many times you can change the region code, just running regionset will show you this information):

Code: regionset

regionset version 0.1 -- reads/sets region code on DVD drives

Current Region Code settings:

RPC Phase: II

type: NONE

vendor resets available: 4

user controlled changes resets available: 5

drive plays discs from region(s):, mask=0xFF

Would you like to change the region setting of your drive? [y/n]:y

Enter the new region number for your drive [1..8]:2

New mask: 0xFFFFFFFD, correct? [y/n]:y

Region code set successfully!

See http://linvdr.org/projects/regionset/ for more information.

[edit]

Misc. Tips and Tricks

[edit]

Get File Details

Use midentify to see some details about your media file.

midentify movie.avi

For some more generic info, you can also run:

file movie.avi

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有