LinuxTOY 是一个致力于提供 Linux 相关资讯的专题站点。如果您发现了好用好玩的 Linux 东东并愿意发扬自由、分享的精神,可以点击顶部导航 Contact 按钮进行投稿。

Related entries

玩转 MPlayer

改变采样率

使用 -srate 选项你可以改变 MPlayer 输出的采样率:

mplayer -srate 48000 <somefile>

将音频输出为 wav 文件

你可以将视频文件中的音频部分输出为 wav 文件:

mplayer -ao pcm <somefile>

这将输出名为 audiodump.wav 的音频文件。你也可以为输出的 wav 文件指定名称:

mplayer -ao pcm:file=<filename>.wav <somefile>

使用 ASCII 方式观看电影

虽然无用,但却很好玩。有两个库文件支持该特性:aa 和 caca。使用 libaa,你只能在黑白 ASCII 中观看电影。而 libcaca 支持色彩。然而,libaa 支持更广泛。你可以像这样使用 libaa 观看电影:

mplayer -vo aa <somefile>

如果你想使用 libcaca:

mplayer -vo caca <somefile>

将电影输出为系列图片

MPlayer 也能将电影输出为一系列的图片:

mplayer -vo jpeg <somefile>

注意:上面的命令将产生数量巨大的 jpeg 文件。输出的 jpeg 文件名看起来像这样:00000001.jpg、00000002.jpg、00000003.jpg 等等。

你也可以输出其他的格式。只需将命令中的 jpeg 替换成 ppm、png、tga 等。

指定纵横比

当你在宽屏中播放电影时,可能想要使用 16:9 的纵横比:

mplayer -aspect 16:9 <somefile>

在非宽屏中,你可以使用 4:3 的纵横比。

将选项放置到 MPlayer 的配置文件中

对于一般用户来说,该配置文件位于 ~/.mplayer/config;全局的配置文件在 /etc/mplayer/config。不同的值使用行分隔,如:

# MPlayer config file
srate=48000
ao="pcm:file=dumpedaudio.wav"

[via]

Pages: 1 2 3

署名 • 注明出处 • 非商业性使用

18 Comments

  1. 1 nowa Commented @ 2007-02-12 10:45 amReply to this comment

    超强的软件,超强的文章,谢谢toy~~

  2. 2 puNk!d Commented @ 2007-02-12 1:16 pmReply to this comment

    非常实用的mplayer tutorial

  3. 3 linuxcoffee Commented @ 2007-02-12 1:52 pmReply to this comment

    看了下,懂得很多mplayer的其他用处,和技巧,顶一下

  4. 4 有點小ゞ壞 Commented @ 2007-02-12 5:48 pmReply to this comment

    mplayer不愧为最强的媒体播放器~~~

  5. 5 Rechosen Commented @ 2007-02-12 10:24 pmReply to this comment

    Hey, thanks for linking to my tutorial =)!

    May I ask where you found the link (so I know what kinds of promotion work well)?

    With regards,

    Rechosen

  6. 6 oliver Commented @ 2007-02-13 4:35 amReply to this comment

    不过貌似MPlayer不适合用看作为英语学习型DVD播放程序。例如一个播放过程中切换字幕的操作都会导致视频回复到段落的开首。而且没有书签功能,下次播放也只能够手动找寻上次看的位置。

  7. 7 Toy Commented @ 2007-02-13 11:47 amReply to this comment

    @Rechosen: I have seen your post from digg.com. Thanks again!

  8. 8 船长 Commented @ 2007-02-14 9:56 pmReply to this comment

    怎样装载SUB字幕文件?

  9. 9 A New Day Has Come » Blog Archive » 玩转 MPlayer Pingbacked @ 2007-03-22 4:18 pmReply to this comment

    [...] [转自LinuxToy] [...]

  10. 10 张闽 Commented @ 2007-05-19 11:17 amReply to this comment

    我的mplayer 播放东西跟快进一样 前两天也不知道怎么拉死拉一次机器 就变成这个样子了 郁闷 好久
    不是speed 的问题 播放一两秒就跳一两秒
    能速回我的问题吗 发油件给我哦

  11. 11 huyang Commented @ 2007-06-10 3:55 pmReply to this comment

    太全面了,超级厉害。呵呵

  12. 12 晚秋作物·梓 Commented @ 2007-06-26 7:12 pmReply to this comment

    安装mplayer后在gnome下打开或在命令行中输入#gmplayer ,系统会提示其skin中的.png图片不可读该怎么办??

  13. 13 hyboo Commented @ 2007-07-09 3:23 pmReply to this comment

    我刚刚下了部电影,mkv格式的,音频好像是eac3的,我已经装了最新的w32codecs,但是totem不能放,mplayer能放,但是没有声音,怎么回事

  14. 14 Safirst C. Ke Commented @ 2007-07-10 11:44 amReply to this comment

    请问有人知道Mplayer如何放大缩小视频吗?

    像KMplayer中的zoom in/out.默认快捷键:+/-

  15. 15 fcicq Commented @ 2007-10-09 10:49 pmReply to this comment

    字幕方面的补充:
    mplayer xxx.mkv
    显示:
    [mkv] Track ID 1: video (V_MS/VFW/FOURCC) “Video”, -vid 0
    [mkv] Track ID 2: audio (A_AC3) “Audio”, -aid 0, -alang jpn
    [mkv] Track ID 3: subtitles (S_TEXT/UTF8) “SRT [CHS]”, -sid 0, -slang chi
    [mkv] Track ID 4: subtitles (S_TEXT/UTF8) “SRT [CHT]”, -sid 1, -slang chi
    [mkv] Track ID 5: subtitles (S_TEXT/ASS) “ASS [CHS]”, -sid 2, -slang chi
    [mkv] Track ID 6: subtitles (S_TEXT/ASS) “ASS [CHT]”, -sid 3, -slang chi

    停止播放,重新用这个命令选择需要的字幕.
    mplayer xxx.mkv -sid 0

    用快捷键应该也是可以的.

  16. 16 vvvxy Commented @ 2007-12-24 1:25 amReply to this comment

    楼上 注意,播ass字幕,必须加上 -ass 参数

  17. 17 Ggarlic’s » Blog Archive » linuxtoy评选的2007最受读者欢迎的文章 Pingbacked @ 2008-01-05 12:44 amReply to this comment

    [...] 玩转 MPlayerMPlayer 是我在 Linux 系统中用到的相当好的媒体播放程序,它因支持播放广泛的音频/视频文件格式而著称。本文所要探讨的,除却一般的使用方法之外,更包括一些鲜为人知的提示和诀窍。相信在阅读此文后,你的多媒体播放体验将会增色不少。 [...]

  18. 18 iseu Commented @ 2008-05-03 9:02 amReply to this comment

    觉得它的鼠标支持不好呀,现在用smplayer