V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
uuair
V2EX  ›  MacBook Pro

有关 mpv.conf 的配置,我这里是最新的,其他都作废了

  •  1
     
  •   uuair · 2017-01-08 01:33:31 +08:00 · 9654 次点击
    这是一个创建于 2665 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我更新到了 0.23.0 版本,rmbp2012 款---这是前提

    为什么说其他的都作废了呢?因为到了 0.23.0 版本,修改了几个参数,我这个配置肯定不是最好的,但绝对是不出错的。。

    --profile=opengl-hq
    hwdec=auto
    #osd message, you can press o to display the osd message
    osd-status-msg="${time-pos/full} / ${length/full} (${percent-pos}%)"
    #makes the player window stay on top of other windows
    ontop=yes
    #always save the current playback position on quit
    save-position-on-quit=yes
    #adjust the initial window size to 50%
    geometry=50%
    #for network play
    cache=8192
    #choose the default subtitle to chinese (选择默认显示的字幕为中文)
    slang=zh,chi
    #for GB2312 GBK BIG5 charset, use enca convert them to utf8 (将非 utf8 编码的字幕转换成 utf8 ,一招解决所有乱码问题,依赖 enca )
    sub-codepage=enca:zh:utf8
    

    这个配置是以前知乎大神的,我已经找不到链接了。 修改的地方是以前的 vo 参数,现在没有了,变成了--profile 参数。 其他网上的配置或多或少都有问题,这个就没事。。是不是发热我就不保证了。。

    为了测试没问题,我用了这个命令:

    mpv https://www.douyu.com/chenyifaer  
    

    肯定是可以看的,但是you-get -p mpv 'https://www.douyu.com/chenyifaer'这是不成的,哎。

    还有,如果碰到各种小问题无法运行,比如dyld: Library not loaded: /usr/local/opt/libass/lib/libass.5.dylib这种的,我搜了n多地方,最后有个最终的解决办法,肯定好用,俩命令:brew reinstall ffmpeg && brew reinstall mpv,绝对解决任何烦恼!

    哦,对了,发姐有毒,少看。。。。

    第 1 条附言  ·  2017-01-08 02:35:20 +08:00

    第一,现在的profile参数里面,只能有这些参数了:

    Available profiles:
    	opengl-hq	
    	encoding	
    	libmpv	
    	builtin-pseudo-gui	
    	pseudo-gui	
    	default
    

    第二,我有个问题没搞定,就是streaming的时候,用mpv和you-get是不成的,只能用这个复杂的命令:

    youtube-dl -o - "https://www.youtube.com/watch?v=Ytb7J0ciBcE” | mpv - --force-seekable=yes
    

    -o代表streaming,mpv是用这个打开,后面的--force-seekable是打开拖放功能。。

    用这个在线播放有一个好处,就是某些网站对非会员限速了,而这样播放是不受限制的,我不知道为什么,老司机是不是有用呢?

    不过这样播放能简单点么。。。我实在看不懂这些配置了:(

    第 2 条附言  ·  2017-01-09 15:29:57 +08:00

    @lcdtyph 感谢,又明白了一个配置的问题

    --vo=opengl
    hwdec=auto
    #osd message, you can press o to display the osd message
    osd-status-msg="${time-pos/full} / ${length/full} (${percent-pos}%)"
    #makes the player window stay on top of other windows
    ontop=yes
    #always save the current playback position on quit
    save-position-on-quit=yes
    #adjust the initial window size to 50%
    geometry=50%
    #for network play
    cache=8192
    #choose the default subtitle to chinese(选择默认显示的字幕为中文)
    slang=zh,chi
    #for GB2312 GBK BIG5 charset, use enca convert them to utf8(将非utf8编码的字幕转换成utf8,一招解决所有乱码问题,依赖enca)
    sub-codepage=enca:zh:utf8
    

    其中--vo=opengl或者使用--profile=opengl-hq这两个参数选择一个。我一直用opengl-hq参数,所以不能用vo了。。感谢感谢!

    21 条回复    2017-01-09 10:07:50 +08:00
    drackzy
        1
    drackzy  
       2017-01-08 01:49:32 +08:00
    字幕编码问题我都是 alias encaa="sudo enca -L zh -x UTF-8" 解决的。
    ZRS
        2
    ZRS  
       2017-01-08 02:12:18 +08:00
    opengl-hq 用了烫烫烫
    lotux
        3
    lotux  
       2017-01-08 10:20:41 +08:00
    消除字幕乱码同样用的是 sub-codepage=enca:zh:utf8
    可是终端提示:
    [lavf] This syntax for the --sub-codepage option is deprecated.
    估计 0.23 是不支持外挂 enca 转码了?
    每更新一个版本就要重新折腾配置文件,真心淡疼
    jindawei
        4
    jindawei  
       2017-01-08 10:44:42 +08:00
    @lotux 为了个播放器浪费这么多时间,值得吗?不如用 movist 省心
    laxapple
        5
    laxapple  
       2017-01-08 12:03:28 +08:00
    r#4 @jindawei Movist 不支持特效字幕是硬伤,外观不好看是软伤。 mpv 几乎所有配置支持自定义,尤其是 Vim-like 快捷键是一大杀器。
    JackBlack2006
        6
    JackBlack2006  
       2017-01-08 12:16:28 +08:00
    字幕编码不是有 sub-codepage=gb18030 的么

    0.23 最烦的是把全屏时候另一个屏黑屏的功能取消了

    讲真,从 16 用到 23 完全没差别,特别是全默认看个熟肉
    IamJ
        7
    IamJ  
       2017-01-08 12:24:26 +08:00 via iPhone
    @jindawei movist 对 ass 字幕的支持不忍直视
    jindawei
        8
    jindawei  
       2017-01-08 12:33:23 +08:00
    @laxapple 你真的每天都在用吗 播放器...
    laxapple
        9
    laxapple  
       2017-01-08 12:46:31 +08:00
    r#8 @jindawei 又不是每天都看电影,只要用的时候, h j k l 调节进度音量, s 字幕, a 音轨, q 退出,还有截图、快进、帧进、 AB 循环等等等等,视频播放和操作都异常流畅,毫不拖泥带水。至于解码什么的, mpv 表现同样出色,只是这不是我关注的重点。
    jedrek
        10
    jedrek  
       2017-01-08 13:18:39 +08:00
    IINA
    lcdtyph
        11
    lcdtyph  
       2017-01-08 14:32:06 +08:00
    @ZRS opengl-hq 烫的话可以不用 profile 的
    vo=opengl
    hwdec=videotoolbox
    这样配置就和原来的一样了

    profile=opengl-hq
    相当于
    vo=opengl-hq
    scale=spline36
    cscale=spline36
    dscale=mitchell
    dither-depth=auto
    correct-downscaling=yes
    sigmoid-upscaling=yes
    deband=yes
    的 alias

    可以用 mpv --profile=help 查看所有可用的 profile
    然后再用 mpv --show-profile=xxx 查看具体 profile 的配置
    Lattez
        12
    Lattez  
       2017-01-08 14:35:51 +08:00
    好像要改动的不是很多...我记得只有一个 opengl-hq 改动了...
    现在唯一的问题是, macOS 下找不到一个可以流畅播放 4K 的播放器, MPV 开 opengl-hq 与 opengl 都是卡...
    anguslg
        13
    anguslg  
       2017-01-08 15:13:52 +08:00
    我的 profile=vdpau ,虽然 mpv 可用的 Profile 并没有这个值,但并不影响播放,而且不发热
    ynyounuo
        14
    ynyounuo  
       2017-01-08 15:22:47 +08:00
    youtube-dl -o - "
    " | mpv - --force-seekable=yes
    ----
    mpv "
    "

    后者会从你的
    '~/.config/mpv/youtube-dl'
    '~/.mpv/youtube-dl'
    '/usr/local/bin/youtube-dl'

    这几个地方找 youtube-dl 然后再 pipe 到 mpv

    其次 mpv 的配置有很多可以动的地方,比如说 auto_profile 对于不同质量的视频进行不同的解码和 deband 等
    还有对于 osd 的调整和操作

    @Lattez
    2K 以上分辨率视频试试加上 opengl-pbo=yes 会流畅一些,然后 scale 用 bilinear 不要用 ewa_lanczossharp 之类的, scale-antiring 为 0
    ynyounuo
        15
    ynyounuo  
       2017-01-08 15:23:22 +08:00
    @ynyounuo = =
    忘记会自动 embed 了 - -
    spicery
        16
    spicery  
       2017-01-08 21:11:13 +08:00
    我的 mpv 的倍速播放有时候就不起效果 。按下去没用 。 " [ " " ] "
    uuair
        17
    uuair  
    OP
       2017-01-09 00:23:01 +08:00
    @lcdtyph 现在没有 vo 参数了,你加一个 vo ,然后用 mpv 播放一下斗鱼看看错误提示吧。
    @ynyounuo 你的意思是说, profile 这个参数,用 default 是最好的了么?还有, mpv youtube 哪个,是有错误提示的。
    ```
    Can not open external file https://r5---sn-npoe7n7z.googlevideo.co
    ```
    等等,我怀疑是 mpv 调用的代理有问题,可能 youtube-dl 有代理设置什么的吧,反正我用 ss 的,应该可以打开。。



    @jindawei 我在尝试用 mpv 远程播放网页上的视频啊,,,这个功能 movist 也有么?
    @jedrek IINA 是 mpv 装了一个壳,不知道能否串流视频,我不想为了看个东西,装一大堆软件一个一个测试了,有一个,就用好吧。以前用 mplayer ,但是问题好多,现在 mpv 起码都能看了啊,我研究明白一个就 ok 了。
    lcdtyph
        18
    lcdtyph  
       2017-01-09 00:40:58 +08:00 via Android
    @uuair 我经常看 timo ,没有错误提示呀,最新版 mpv
    在 man 里也能看到有 vo 参数的呀~
    uuair
        19
    uuair  
    OP
       2017-01-09 00:55:37 +08:00
    @lcdtyph

    --vo=opengl-hq is deprecated! Use --profile=opengl-hq instead.

    你看到这个提示了么?
    lcdtyph
        20
    lcdtyph  
       2017-01-09 09:55:59 +08:00 via Android
    @uuair 我上面写的是用 vo=opengl
    opengl-hq 要用 profile 指定,我没用 hq 的原因是发烫。
    lcdtyph
        21
    lcdtyph  
       2017-01-09 10:07:50 +08:00
    @uuair
    $ mpv --vo=help
    Available video outputs:
    opengl : Extended OpenGL Renderer
    null : Null video output
    image : Write video frames to image files
    tct : true-color terminals
    caca : libcaca

    我的机器上可用的 vo 是上面这些,其中 opengl 是默认值

    $ mpv --show-profile=opengl-hq
    Profile opengl-hq:
    scale=spline36
    cscale=spline36
    dscale=mitchell
    dither-depth=auto
    correct-downscaling=yes
    sigmoid-upscaling=yes
    deband=yes

    可以看到没指定 vo ,用的是默认的 opengl
    vo 参数是没有弃用的,只是把 opengl-hq 变成了一个配置
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1488 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:31 · PVG 01:31 · LAX 10:31 · JFK 13:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.