mplayer最全的命令

本文介绍了如何使用mplayer播放器,特别是针对其命令行操作进行了详尽的阐述,包括打开视频文件和图片文件的功能。尽管mplayer在处理图片支持上存在局限,但作为一款强大的多媒体播放工具,其在视频播放方面的表现得到了认可。
摘要由CSDN通过智能技术生成

前段时间做过qt内嵌mplayer的一个小程序,感觉mplayer还行不过不支持打开图片感觉有点无力。话不多说上代码:

    QString path="d:/1.mkv";
    QWidget *vw=new QWidget(this);
    vw->resize(400,300);
    QString common = "E:/testmplayer/debug/mplayer/MPlayer.exe -slave -quiet -vo direct3d   -wid " + QString::number(reinterpret_cast<qlonglong>(vw->winId())) + " "+ (path);
    process=new QProcess();
    process->start(common);

这样一个小的播放器就做好了,通过命令方式启动 myplayer.exe  其中  -slave就是用后台命令控制的意思
process->write("xxx \n"); //xxx为操作指令必须要有\n
在mplayer官网上,可以看到下面的命令:
-------------------

The -slave option switches on slave mode, in which MPlayer works as a backend
for other programs. Instead of intercepting keyboard events, MPlayer will read
commands separated by a newline (\n) from stdin.

To try slave mode out by hand, run

  mplayer -slave -quiet <movie>

and type slave commands into the console window.

You can also use a fifo file (named pipe):

  mkfifo </tmp/fifofile>
  mplayer -slave -input file=</tmp/fifofile> <movie>

Most slave mode commands are equivalent to command line options, though not
necessarily under the same name. Detailed descriptions can be found in the
man page.

All commands can be prefixed with one of "pausing ", "pausing_keep ", or
"pausing_toggle ". "pausing " tells MPlayer to pause as soon as possible
after processing the command. "pausing_keep " tells MPlayer to do so only if
it was already in paused mode. "pausing_toggle " tells MPlayer to do so
only if it was not already in paused mode. Please note that "as soon as
possible" can be before the command is fully executed.
As a temporary hack, there is also the _experimental_ "pausing_keep_force "
prefix, with which MPlayer will not exit the pause loop at all.
Like this you can avoid the "frame stepping" effect of "pausing_keep "
but most commands will either not work at all or behave in unexpected ways.
For "set_mouse_pos" and "key_down_event", "pausing_keep_force" is the default
since other values do not make much sense for them.


Various tips and tricks (please help expand it!):

- Try using something like
    pausing_keep_force pt_step 1
    get_property pause
  to switch to the next file. It avoids audio playback starting to play
  the old file for a short time before switching to the new one.
- To ensure the user can't control MPlayer "behind your back" use
  something like -input nodefault-bindings -noconfig all


Available commands ('mplayer -input cmdlist' will print a list):

af_add <filter_arguments_list>  (comma separated list of audio filters with parameters)
    (experimental) Load the given list of audio filters.

af_clr
    (experimental) Unload all loaded audio filters.

af_cmdline <filter_name> <filter_arguments>
    (experimental) Send new command-line options to a filter with the given name.

af_del <filter_name_list> (comma separated list of audio filter's names)
    (experimental) Unload the first occurrence of the filters, if loaded.

af_switch <filter_arguments_list> (comma separated list of audio filters with parameters)
    (experimental) Remove all the audio filters and replace them with the given list.

alt_src_step <value> (ASX playlist only)
    When more than one source is available it selects the next/previous one.

audio_delay <value> [abs]
    Set/adjust the audio delay.
    If [abs] is not given or is zero, adjust the delay by <value> seconds.
    If [abs] is nonzero, set the delay to <value> seconds.

[brightness|contrast|gamma|hue|saturation] <value> [abs]
    Set/adjust video parameters.
    If [abs] is not given or is zero, modifies parameter by <value>.
    If [abs] is non-zero, parameter is set to <value>.
    <value> is in the range [-100, 100].

capturing [value]
    Toggle/set capturing the primary stream like -dumpstream.
    Requires the -capture parameter to be given.

change_rectangle <val1> <val2>
    Change the position of the rectangle filter rectangle.
        <val1>
            Must be one of the following:
                0 = width
                1 = height
                2 = x position
                3 = y position
        <val2>
            If <val1> is 0 or 1:
                Integer amount to add/subtract from the width/height.
                Positive values add to width/height and negative values
                subtract from it.
            If <v
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值