mplayer

来自百合仙子's Wiki
跳转到导航 跳转到搜索

播放控制

命令行

-loop N
循环 N 次,0 表示一直循环
-fs
全屏(把影片置于屏幕中央,并不缩放)
-ss
指定开始播放的时间
-vo null
只播放音频部分,不播放视频部分
-sub
指定字幕文件
-subcp
指定字幕文件的编码
-ass
Turn on ASS subtitle rendering. 默认启用 fontconfig 支持。实际测试时只有使用此选项时才有 fontconfig 支持。此选项似乎只更改了使用的字幕渲染库,与使用何种格式的字幕无关。

交互

<-,->; Down, Up; PgDn, PgUp
后退/快进10秒/1分/10分
9,0; /,*
降低/提高音量
<,>
播放列表中的上/下一曲
j,J
切换字幕
v
切换字幕的显示

使用 FIFO 文件

使用 -input file=fifo_file 来指定 mplayer 将读取的命令文件。

过滤器

沿Y轴翻转,比如把摄像头当镜子用:

mplayer -vf mirror tv://

格式转换

wma 格式音频转化为 wav 以便进一步转换

mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader file.wma

配置

用户配置文件位于 ~/.mplayer/config

配置使用 PulseAudio,在配置文件中添加ao=pulse[1]

问题处理

中文字幕显示为下划线的解决办法

mplayer -subcp gbk -font 文泉驿正黑 FILE

其它

在终端下全屏播放影片

mplayer -vo fbdev -vf scale=1024:768 Chap2_english.mov

顺时针旋转90°

mplayer -vf rotate=1 movie

播放摄像头的数据

mplayer tv://

使用摄像头拍照,在当前目录下存为.jpg文件。最开始 20 多帧时摄像头可能未准备好。

mplayer tv:// -frames 40 -vo jpeg

获取媒体信息(midentify[2]

#!/bin/sh
#
# This is a wrapper around the -identify functionality.
# It is supposed to escape the output properly, so it can be easily
# used in shellscripts by 'eval'ing the output of this script.
#
# Written by Tobias Diedrich <ranma+mplayer@tdiedrich.de>
# Licensed under GNU GPL.

if [ -z "$1" ]; then
        echo "Usage: midentify.sh <file> [<file> ...]"
        exit 1
fi

mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
        sed -ne '/^ID_/ {
                          s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p
                        }'

参见

外部链接

参考资料