MPlayer/Başlatma ve dosyaları çalma

Vikikitap, özgür kütüphane
Gezinti kısmına atla Arama kısmına atla

MPlayer'ı başlatmak oldukça basittir. MPlayer'ı başlatmak için komut satırında aşağıdaki komutu verin:

mplayer <dosya adı>

Eğer MPlayer'a ulaşılamıyorsa yolu tam olarak belirtmeniz gerekebilir:

/usr/bin/mplayer <dosyanın yolu>

veya Windows kullanıyorsanız

C:\Program Files\mplayer\mplayer.exe <dosyanın yolu>

Ayrıca GMPlayer'ı kullanarak MPlayer'a görsel olarak erişebilirsiniz. GMPlayer'ı açtığınızda iki pencere açılır:

  • Görüntüleme penceresi - buradan DVD'ler/videolar çalınır.
  • Kontrol penceresi - buradan MPlayer'ın en sık kullanılan komutlarını tek tıklamayla çalıştırırsınız.

Herhangi bir dosyayı çalmak için görüntüleme penceresinde herhangi bir yeri sağ tıklayın, açılan menüden "Open"ın üzerine gelin ve açılan alt menüden "Play file"ı tıklayın. Ekrana bir dosya açma penceresi gelecektir. Varsayılan durumda bu dosya açma penceresinde sadece videolar gözükür, çünkü pencerenin aşağısındaki tür filtresi varsayılan durumda "Video files" olarak ayarlıdır. Bu pencerede ses dosyalarını da göstermek için dosya türü seçicisinin sağ ucundaki aşağı bakan oka tıklayıp açılan listenin en altındaki "All files"ı seçin. Sonra bu pencerede istediğiniz dosyayı seçin ve "OK" düğmesine tıklayın. Dosya çalınmaya başlayacaktır.

Windows komut satırı (grafik arayüz yok):

En kolay yol temel MPlayer paket ve kodeklerini MPlayer'ın ana sitesinden indirmektir (isminde GUI olan hiçbir şeyi indirmeyin). İndirdiğiniz sıkıştırılmış dosyanın içeriğini istediğiniz bir klasöre çıkarın. Sonra izlemek istediğiniz videoyu sağ tıklayıp "Birlikte Aç"ın üzerine gelip "Program seç"i tıklayın. Açılan pencerede az önceki sıkıştırılmış dosyanın içeriğini çıkardığınız klasöre gidin, MPlayer'ı seçin ve ilgili video dosyasını her çift tıklayışınızda MPlayer'ın açılması için "Bu tür dosyaları açmak için her zaman seçili programı kullan" onay kutusunu işaretleyin.

Eğer sorunla karşılaşırsanız sorunun ne olduğunu anlamak için mplayer'ı Windows komut satırı ile çalıştırın. Dosyayı komut satırına sürükleyip bırakırsanız ilgili dosyanın adı komut satırında çıkacaktır, bu sayede dosyanın adını ve yolunu tam olarak yazmak zorunda kalmayacaksınız. Komut satırında mplayer'ın bütün fonksiyonlarını kullanabilirsiniz.

(adjust content locations and continue cleanup from here -- kokushibyou).

This shows a file that starts properly; there are some errors (no subtitle fonts, which is easily fixed if required) and other interesting feedback you might be interested in.

(move this to the bottom soon)
C:\Documents and Settings\DL.UNIVERSE>G:\mplayer\mplayer.exe "N:\testfile.rmvb"
MPlayer dev-CVS-050626-17:02-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred (Family: 6, Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.

Cannot load font: C:\mplayer\font-arial-iso-8859-1\font-arial-14-iso-8859-1\font.desc
Playing N:\testfile.rmvb.
REAL file format detected. 
Stream description: Audio Stream
Stream mimetype: audio/x-pn-realaudio
Stream description: Video Stream
Stream mimetype: video/x-pn-realvideo
Stream mimetype: logical-fileinfo
VIDEO:  [RV40]  640x368  24bpp  23.000 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
name: testfile.rmvb
Opening audio decoder: [realaud] RealAudio decoder
opening win32 dll 'cook3260.dll'
Audio codec: [24] 64 kbps Stereo Music - RA8
Audio bitrate: 64.083 kbit/s (8010 bps)
AUDIO: 44100 Hz, 2 ch, s16le, 64.1 kbit/4.54% (ratio: 8010->176400)
Selected audio codec: [racookwin] afm:realaud (Win32 RealAudio COOK) 
<vo_directx><ERROR>Your card doesn't support overlay
Opening video decoder: [realvid] RealVideo decoder
opening win32 dll 'drv43260.dll'
Selected video codec: [rv40win] vfm:realvid (Win32 RealPlayer 9 RV40 decoder)
Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??...
AO: [dsound] 44100Hz 2ch s16le (2 bps)
Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
Starting playback...
VDec: vo config request - 640 x 368 (preferred csp: Planar I420)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar I420 as output csp (no 0)
Movie-Aspect is 1.74:1 - prescaling to correct movie aspect.
SwScaler: using unscaled Planar YV12 -> BGR 16-bit special converter
VO: [directx] 640x368 => 640x368 BGR 16-bit
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.

(and movie launches in its own window, with the cmd window in the background).


Playing CDs, DVDs and VCDs[değiştir]

GMplayer's menus allow access to your CD/DVD drive for playing most on disk video files. On the command prompt you can simply refer to the DVD:// device or if you have an image of a disk on your hard drive you can use the BIN:// or ISO:// devices. A win32 example is mplayer -dvd-device e: dvd://1 (for title 1).

If the disk does not play, then the system may not have a CDDA extractor such as cdparanoia, or MPlayer was not compiled from source with the correct option enabled. The CDDA extractor is only needed at compile time.

Codecs[değiştir]

In most cases mplayer will automatically recognize the video's format and the environment it is running in. It will then show the video as best it can. If you are running a graphical interface (XWindow, MS Windows) you may wish to start MPlayer's GUI. This can also be started at a command line or from your desktop's "Run file" option or via its menu system. In all cases above the command is; gmplayer.

If you start running into issues with trying to determine why video/sound isn't working, try a few of the following things:

  • Try running mplayer command-line only - your prompt will usually output good information about errors.
  • Be sure you have the full codec pack from http://www.mplayerhq.hu ; or any other codec packs that aren't included there (pretty much everything you'd ever need is already available on their site).

While Watching[değiştir]

Keyboard shortcuts for MPlayer include:

  • q = quit
  • r = sub position -
  • t = sub position +y
  • T = enable/disable stay on top mode
  • y = sub delay reset to 0
  • o/O = toggle on-screen display (enabled, disabled, time lapsed, time lapsed/remaining)
  • p = play/pause
  • [ = speed -10%
  • ] = speed +10%
  • { = speed x 1/2
  • } = speed x 2
  • a = sub alignment
  • d = toggle framedropping (on, hard, off)
  • f = toggle full-screen
  • j = toggle subtitle (off, language 1, language 2, etc...)
  • l = load file to playlist (GUI only)
  • z = sub delay -
  • x = sub delay +
  • c = skin browser
  • v = enable/disable subtitles
  • b = toggle subtitle (off, language 1, language 2, etc...)
  • m = mute on/off
  • / = volume down,
  • 0 = play
  • . = frame advance
  • 1 = contrast -
  • 2 = contrast +
  • 3 = brightness -
  • 4 = brightness +
  • 5 = tint - (green)
  • 6 = tint + (red)
  • 7 = color -
  • 8 = color +
  • / = volume -
  • * = volume +
  • - = audio-video delay -
  • + = audio-video delay +
  • up = forward 1 minute
  • down = back 1 minute
  • left = rewind
  • right = fast forward
  • home = beginning
  • end = end
  • pg up = forward 10 mins
  • pg dn = back 10 mins
  • # = toggle audio


OSD Menu[değiştir]

Mplayer has a freely configurable OSD menu. Unfortunately it is not well documented (or rather, not at all...). The following is an example menu.conf (to be put in ~/.mplayer on GNU/Linux systems):

<keybindings name="default">
   <binding key="UP" cmd="menu up" />
   <binding key="DOWN" cmd="menu down" />
   <binding key="LEFT" cmd="menu left" />
   <binding key="RIGHT" cmd="menu right" />
   <binding key="ENTER" cmd="menu ok" />
   <binding key="ESC" cmd="menu cancel" />
   <binding key="HOME" cmd="menu home" />
   <binding key="END" cmd="menu end" />
   <binding key="PGUP" cmd="menu pageup" />
   <binding key="PGDWN" cmd="menu pagedown" />
   <binding key="JOY_UP" cmd="menu up" />
   <binding key="JOY_DOWN" cmd="menu down" />
   <binding key="JOY_LEFT" cmd="menu left" />
   <binding key="JOY_RIGHT" cmd="menu right" />
   <binding key="JOY_BTN0" cmd="menu ok" />
   <binding key="JOY_BTN1" cmd="menu cancel" />
   <binding key="AR_VUP" cmd="menu up" />
   <binding key="AR_VDOWN" cmd="menu down" />
   <binding key="AR_PREV" cmd="menu left" />
   <binding key="AR_NEXT" cmd="menu right" />
   <binding key="AR_PLAY" cmd="menu ok" />
   <binding key="AR_MENU" cmd="menu cancel" />
   <binding key="AR_PREV_HOLD" cmd="menu home" />
   <binding key="AR_NEXT_HOLD" cmd="menu end" />
   <binding key="MOUSE_BTN3" cmd="menu up" />
   <binding key="MOUSE_BTN4" cmd="menu up" />
   <binding key="MOUSE_BTN0" cmd="menu click" />
   <binding key="MOUSE_BTN2" cmd="menu cancel" />
</keybindings>
<keybindings name="list" parent="default">
   <binding key="AR_PREV" cmd="menu pageup" />
   <binding key="AR_NEXT" cmd="menu pagedown" />
</keybindings>
<keybindings name="filesel" parent="list">
   <binding key="BS" cmd="menu left" />
</keybindings>
<keybindings name="chapsel" parent="list" />
<keybindings name="cmdlist" parent="list">
   <binding key="AR_PREV" cmd="menu left" />
   <binding key="AR_NEXT" cmd="menu right" />
</keybindings>
<keybindings name="txt" parent="list" />
<keybindings name="pt" parent="list" />
<keybindings name="pref" parent="list">
   <binding key="AR_PREV" cmd="menu left" />
   <binding key="AR_NEXT" cmd="menu right" />
   <binding key="AR_PREV_HOLD" cmd="menu left" />
   <binding key="AR_NEXT_HOLD" cmd="menu right" />
</keybindings>
<filesel name="open_file"/>
<filesel name="open_list" file-action="loadlist '%p'" auto-close="yes"
        title="Open a playlist: %p"
        filter="/etc/mplayer/extensions_filter"
        actions="d:run 'mp_loader \'%p\' d',c:run 'mp_loader \'%p\' c'" />
<chapsel name="select_chapter" />
<pt name="jump_to"/>
<console name="console0" height="80" vspace="0">Welcome to MPlayer</console>
<txt name="man" file="manpage.txt"/>
<pref name="general_pref" title="General">
     <e property="osdlevel" name="OSD level"/>
     <e property="speed" name="Speed"/>
     <e property="loop" name="Loop"/>
</pref>
<pref name="demuxer_pref" title="Demuxer">
</pref>
<pref name="osd_sub_pref" title="Subtitles">
     <e property="sub" name="Subtitles"/>
     <e property="sub_visibility" name="Visibility"/>
     <e property="sub_forced_only" name="Forced sub only"/>
     <e property="sub_alignment" name="Alignment"/>   
     <e property="sub_pos" name="Position"/>
     <e property="sub_delay" name="Delay"/>
     <e property="sub_scale" name="Scale"/>
</pref>
<pref name="audio_pref" title="Audio">
     <e property="volume" name="Volume"/>
     <e property="balance" name="Balance"/>
     <e property="mute" name="Mute"/>
     <e property="audio_delay" name="Delay"/>
</pref>
<pref name="colors_pref" title="Colors">
     <e property="gamma" name="Gamma"/>
     <e property="brightness" name="Brightness"/>
     <e property="contrast" name="Contrast"/>
     <e property="saturation" name="Saturation"/>
     <e property="hue" name="Hue"/>
</pref>
<pref name="video_pref" title="Video">
     <e property="fullscreen" name="Fullscreen"/>
     <e property="panscan" name="Panscan"/>
     <menu menu="colors_pref" name="Colors ..."/>
     <e property="ontop" name="Always on top"/>
     <e property="rootwin" name="Root window"/>
     <e property="framedropping" name="Frame dropping"/>
     <e property="vsync" name="VSync"/>
</pref>
<cmdlist name="pref_main" title="Preferences" ptr="<>" >
   <e name="General ..." ok="set_menu general_pref"/>
   <e name="Audio ..." ok="set_menu audio_pref"/>
   <e name="Video ..." ok="set_menu video_pref"/>
   <e name="Subtitles ..." ok="set_menu osd_sub_pref"/>
   <e name="Back" ok="menu cancel"/>
</cmdlist>
<pref name="properties" title="Stream Properties">
     <e txt="${filename}" name="Name"/>
     <e txt="${video_format}" name="Video Codec"/>
     <e txt="${video_bitrate}" name="Video Bitrate"/>
     <e txt="${width} x ${height}" name="Resolution"/>
     <e txt="${audio_codec}" name="Audio Codec"/>
     <e txt="${audio_bitrate}" name="Audio Bitrate"/>
     <e txt="${samplerate}, ${channels}" name="Audio Samples"/>
     <e txt="${metadata/Title}" name="Title"/>
     <e txt="${metadata/Artist}" name="Artist"/>
     <e txt="${metadata/Album}" name="Album"/>
     <e txt="${metadata/Year}" name="Year"/>
     <e txt="${metadata/Comment}" name="Comment"/>
     <e txt="${metadata/Track}" name="Track"/>
     <e txt="${metadata/Genre}" name="Genre"/>
     <e txt="${metadata/Software}" name="Software"/>
</pref>
<cmdlist name="main" title="Menu" ptr="<>" >
     <e name="Pause" ok="pause"/>
     <e name="Chapter ..." ok="set_menu select_chapter"
                           left="seek_chapter -1" right="seek_chapter +1"/>
     <e name="Prev/Next ..." ok="set_menu jump_to"
                           left="pt_step -1" right="pt_step 1"/>
     <e name="Open ..." ok="set_menu open_file"/>
     <e name="Open playlist ..." ok="set_menu open_list"/>
     <e name="Help" ok="set_menu man"/>
     <e name="Pref" ok="set_menu pref_main"/>
     <e name="Properties" ok="set_menu properties"/>
     <e name="Console" ok="set_menu console0"/>
     <e name="Quit" ok="quit"/>
</cmdlist>

To enable it you must include something like the following keybinding in the 'input.conf' file in the same directory as 'menu.conf':

m menu main

'm' can be any key (or mouse button (i.e MOUSE_BTN2)). Then start mplayer with the -menu switch (alternatively you can put menu=yes in the 'config' file.

Preferences[değiştir]

Mencoder[değiştir]

MEncoder is a command line video decoding, encoding and filtering tool that is included with most MPlayer packages. It is a close sibling to MPlayer and can convert all the formats that MPlayer understands into a variety of compressed and uncompressed formats using different codecs.

Capabilities[değiştir]

As it is built from the same code as MPlayer, it can read from every source which MPlayer can read, decode all media which MPlayer can decode and it supports all filters which MPlayer can use. MPlayer can also be used to view the output of most of the filters (or of a whole pipeline of filters) before running MEncoder. If the system is not able to process this in realtime, audio can be disabled using -nosound to allow a smooth review of the video filtering results.

It is also possible to copy audio and/or video unmodified into the output file to avoid quality loss because of re-encoding for example, to only modify the audio or video, or to simply put the audio/video data unmodified into a different container format.

Since it uses the same code as MPlayer, it also features the same huge number of highly-configurable video and audio filters to transform the video and audio stream: Filters include Cropping, Scaling, Vertical Flipping, horizontal mirroring, expanding to create letterboxes, rotating, brightness/contrast, changing the aspect ratio of a video, colorspace conversion, hue/saturation, color-specific Gamma correction, filters for reducting the visibility of compression artifacts caused by MPEG compression (deblocking, deringing), automatic brightness/contrast enhancement (autolevel), sharpness/blur, denoising filters, several different ways of de-interlacing, and reversing telecine.

Frame rate conversions and slow-motion[değiştir]

Also, changing the frame rate is possible using the -ofps or -speed options and, in addition, by using the framestep filter for skipping frames. Reducing the frame rate can be used to create fast-motion "speed" effects which are sometimes seen in films.

Doubling the frame rate of interlaced footage without duplicating or morphing frames is possible using the tfields filter to create two different frames from each of the two fields in one frame of interlaced video. This allows playback on progressive displays, while preserving the full resolution and framerate of interlaced video, unlike any de-interlacing method. It also makes the footage more usable for framerate conversion, and creating slow-motion scenes from footage taken at standard video/TV frame rates, e.g. using cheap consumer camcorders. If the filter gets wrong information about the top/bottom field order, the resulting output video will have juddering motion, because the two frames created would be displayed in the wrong order.

Common tasks[değiştir]

Create an animation from a series of static images[değiştir]

To combine all png images in a directory to create an avi movie do this:

mencoder mf://*.png -mf w=400:h=400 -ovc lavc -lavcopts vcodec=xvid -of avi -o output.avi

Split a video in a series of static images[değiştir]

To split up an input movie into a subdir "dirname" with a special quality.

mplayer input.avi -vo jpeg:outdir=dirname:quality=80

Split a large video into small videos[değiştir]

note the mb suffix in the -endpos switch:

mencoder -ovc copy -oac copy -ss 0 -endpos 700mb -o movie_part1.avi movie.avi

Join multiple videos[değiştir]

To join two or more video files into one, do this:

mencoder -oac copy -ovc copy -idx -o whole.avi part1.avi part2.avi ...

This will only work if the video contained in the files have the same resolution and use the same codec. Of course, this works for any file format that MPlayer can play, not just AVI files. If your files are not AVI files you have to specify the output format -of. Otherwise your joined mpeg movies will reside in an AVI container. This is because AVI is the default output format. (To see the available output formats, type mencoder -of help.)

Rip DVD into avi[değiştir]

To perform a two-pass encode of the second title on a DVD to an MPEG-4 AVI while copying the audio track, execute these two commands in this order:

mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o /dev/null
mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 -oac copy -o output.avi

The first pass creates some temporary files (having names ending with .log) with a size of few megabytes. Do not delete these temporary files between the two passes. In the second pass, the output file is created using the bitrate data from the temporary file. The resulting file will have much better image quality than a one-pass encoding would produce, since the extra step allows for more bitrate for those moments that need it and less for those that don't in order to keep a stable quality level as opposed to having a stable bitrate, and while still keeping the desired average bitrate.

For subtitles, use the -slang (for example, to have English subtitles along with the video do -slang en) or -sid (eg. -sid 0) switch. When more than one language is used for dialogue subtitles may appear for all dialogue including the primary language. −forcedsubsonly may, depending on how the DVD was authored, because only dialogue that is not in the primary language to be subtitled. e.g. In a movie with both english and german dialogue with the primary language being english, using -forcedsubsonly may stop english dialogue being subtitled as well as german.

For changing the audio (such is the case in Canada where videos are often available in French and English) specify the -alang or -switch (eg. -alang en)

Split/sub-section videos[değiştir]

You can use the -ss and -endpos parameters to specify start and end point, but it can only start on the nearest keyframe. So, depending on how frequently keyframes were placed into the video, the actual start time may be as much as 10 seconds off.

Suppose you want to split video_input.avi such that you skip the first 3.2 seconds and will take 2 seconds of video (until second 5.2)

mencoder -ss 3.2 -endpos 2 -oac copy -ovc copy video_input.avi -o video_output.avi

In general

mencoder -ovc copy -oac copy -ss hh:mm:ss -endpos hh:mm:ss video_input.avi -o video_output.avi

This copy part of video_input.avi to video_output.avi. Part start from -ss time and stops to -endpos time. Those time could also be megabytes with mb-postfix.


If your audio/video codecs support exact positioning (e.g. a full-frame codec like MJPEG, huffyuv, regular PCM for audio, etc.), mencoder is able to losslessly cut an audio/video container into segments.

The following command can be used for losslessly cutting a video in 1-minute segments:

mencoder -ss 0 -endpos 59.999 -oac copy -ovc copy video_input.avi -o video_output-001.avi
mencoder -ss 60 -endpos 59.999 -oac copy -ovc copy video_input.avi -o video_output-002.avi
mencoder -ss 120 - endpos 59.999 ...

Convert FLV to AVI[değiştir]

You can use mencoder to convert FLV files from sites like YouTube and Google Video to AVI with mencoder.

mencoder input.flv -ovc lavc -oac mp3lame -o output.avi


Using filters[değiştir]

Increase or decrease gamma, contrast , brightness, saturation[değiştir]
mencoder -oac copy -ovc copy input.flv -vf eq2=gamma:contrast:brightnes:saturation -o output.avi

where gamma 0.1 - 10 (default 1.0), contrast -2 − 2 (default 1.0), brightnes -1 - 1 (default 0.0), saturation 0 − 3 (default 1.0),

Şablon:Subjects Şablon:Alphabetical Şablon:Status