TA的每日心情 | 无聊 昨天 07:30 |
---|
签到天数: 2200 天 [LV.Master]伴坛终老
星辰大海
- 积分
- 458454
|
本帖最后由 EdveR 于 2018-12-5 17:54 编辑
确实界面都有些土,不是很喜欢,最麻烦的是它默认的快捷键还和mpv不一样,刚习惯了mpv的快捷键。。还是老老实实用mpv了。
嗯,是这个意思。自己简单粗暴地改了一下,能用,也不知道对不对。后面title和lang都没写(其实是没搞清楚)。可以把打开文件窗口对话的路径定义到视频的上一层文件夹吗?现在打开窗口默认是上一次打开过的路径。还有,我发现scripts文件夹放在mpv安装目录下也可以正常运行。
sub-add "<file>" [<flags> [<title> [<lang>]]]
Load the given subtitle file. It is selected as current subtitle after loading.
The flags args is one of the following values:
<select>
Select the subtitle immediately.
<auto>
Don't select the subtitle. (Or in some special situations, let the default stream selection mechanism decide.)
<cached>
Select the subtitle. If a subtitle with the same filename was already added, that one is selected, instead of loading a duplicate entry. (In this case, title/language are ignored, and if the was changed since it was loaded, these changes won't be reflected.)
The title argument sets the track title in the UI.
The lang argument sets the track language, and can also influence stream selection with flags set to auto. - utils = require 'mp.utils'
- function open_sub_dialog()
- local was_ontop = mp.get_property_native("ontop")
- if was_ontop then mp.set_property_native("ontop", false) end
- local res = utils.subprocess({
- args = {'powershell', '-NoProfile', '-Command', [[& {
- Trap {
- Write-Error -ErrorRecord $_
- Exit 1
- }
- Add-Type -AssemblyName PresentationFramework
- $u8 = [System.Text.Encoding]::UTF8
- $out = [Console]::OpenStandardOutput()
- $ofd = New-Object -TypeName Microsoft.Win32.OpenFileDialog
- $ofd.Multiselect = $true
- If ($ofd.ShowDialog() -eq $true) {
- ForEach ($filename in $ofd.FileNames) {
- $u8filename = $u8.GetBytes("$filename`n")
- $out.Write($u8filename, 0, $u8filename.Length)
- }
- }
- }]]},
- cancellable = false,
- })
- if was_ontop then mp.set_property_native("ontop", true) end
- if (res.status ~= 0) then return end
- local first_file = true
- for filename in string.gmatch(res.stdout, '[^\n]+') do
- mp.commandv('sub-add', filename, first_file and 'select')
- first_file = false
- end
- end
- mp.add_key_binding('ctrl+l', 'open-sub-dialog', open_sub_dialog)
复制代码 还有两个问题:
1、在播放有些字幕时,特效会不对,如下图。OP过渡效果应该是逐字变色的,MPC-BE播放正常,用mpv就变成下面这样了。
2、播放4K HDR 60fps时卡顿掉帧,4K HDR 24fps时流畅不掉帧,CPU占用不超过60%。之前用MPC-BE+madVR播放60fps也不掉帧,mpv默认设置。
|
|