思考的轨迹 - 搜索怎么把mpv播放器变成绿色便携版本



思考的过程很有意思,趁着自己还没犯懒,记录一例,思路的延展结合搜索结果的收敛,最终获取到想要的信息(或知识)。

: : :


起因是在简书上看到如下介绍:“windows下默认的配置文件位置是 %APPDATA%/mpv/mpv.conf... 也可以通过环境变量的方式进行指定”
(点击三角号展开内容)



01


01.配置文件路径

windows下默认的配置文件位置是 %APPDATA%/mpv/mpv.conf

如果需要按用户进行区分,那么可以用C:\users\USERNAME\AppData\Roaming\mpv\mpv.conf这个目录

另外还有一种就是:

也可以通过环境变量的方式进行指定,相对来说,还是直接在mpv目录下创建比较方便。



作者:mudssky
链接:https://www.jianshu.com/p/3dfd11a9c2a7
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


: : :


然后就在网上搜索“mpv 环境变量”,“mpv conf 目录”等关键字,然后发现了进一步的线索:“MPV的便携版非常好生成, 在mpv.exe的同一目录下建立目录portable_config...”
(点击三角号展开内容)




无标题 (4)


MPV的便携版非常好生成, 在mpv.exe的同一目录下建立目录portable_config,然后将input.conf和mpv.conf放到这个目录就定制完成了。


: : :


自己一直有考据的喜好,于是就一步搜索“mpv 便携版”,“mpv portable config”等关键字,终于找到了官方的本源
(点击三角号展开内容)



FILES ON WINDOWS

On win32 (if compiled with MinGW, but not Cygwin), the default config file locations are different. They are generally located under %APPDATA%/mpv/. For example, the path to mpv.conf is %APPDATA%/mpv/mpv.conf, which maps to a system and user-specific path, for example

C:\users\USERNAME\AppData\Roaming\mpv\mpv.conf

You can find the exact path by running echo %APPDATA%\mpv\mpv.conf in cmd.exe.

Other config files (such as input.conf) are in the same directory. See the FILES section above.

The environment variable MPVHOME</tt><span></span>completelyoverridesthese,likeonUNIX.</p><pstyle="color:rgb(63,63,63);fontfamily:"HelveticaNeue",Helvetica,Arial,sansserif;fontsize:0.875rem;backgroundcolor:rgb(245,245,245);">Ifadirectorynamed<span></span><ttclass="docutilsliteral">portableconfig</tt><span></span>nexttothempv.exeexists,allconfigwillbeloadedfromthisdirectoryonly.Watchlaterconfigfilesarewrittentothisdirectoryaswell.(ThisexistsonWindowsonlyandisredundantwith<span></span><ttclass="docutilsliteral">MPV_HOME. However, since Windows is very scripting unfriendly, a wrapper script just setting $MPV_HOME, like you could do it on other systems, won't work. portable_config is provided for convenience to get around this restriction.)

Config files located in the same directory as mpv.exe are loaded with lower priority. Some config files are loaded only once, which means that e.g. of 2 input.conf files located in two config directories, only the one from the directory with higher priority will be loaded.

A third config directory with the lowest priority is the directory named mpv in the same directory as mpv.exe. This used to be the directory with the highest priority, but is now discouraged to use and might be removed in the future.

Note that mpv likes to mix / and \ path separators for simplicity. kernel32.dll accepts this, but cmd.exe does not.


According to mpv's documentation, the CONF file is stored in the "\AppData\Roaming\mpv". But in case the folder is empty (like it was for me), you have to manually create a CONF file to begin customizing the settings. You don't necessarily have to create it in that specific folder. There is a better alternative.

Go to the folder where your mpv.EXE is located. Create a new folder in it, and name it "portable_config" and place the file inside that folder. This is where mpv will read your settings from.



posted @ 2020-12-07 00:06  柠檬茶多放糖  阅读(322)  评论(0编辑  收藏  举报