Skip to content

Commit d1310d9

Browse files
authored
Merge pull request #11 from QiaoKes/develop
[opt] 重构mpv播放器相关,抽为单独仓库
2 parents ecb2872 + 1def12c commit d1310d9

4 files changed

Lines changed: 58 additions & 24 deletions

File tree

README.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
## 更新记录
2525

26+
* 2025.8.24 - v1.6.4 mpv配置管理抽为单独仓库,支持Anime4K着色器预设方案
2627
* 2025.8.23 - v1.6.3 优化mpv启动参数,固定启动时的初始窗口大小
2728
* 2025.8.22 - v1.6.2 修改部分快捷键为potplayer常用键位,mpv播放器改为无边框
2829
* 2025.8.21 - v1.6.1 修复缓存目录过大,超过100m自动清理
@@ -43,7 +44,10 @@
4344

4445
### 2. mpv播放器功能有点少,怎么客制化,想添加补帧滤镜等?
4546

46-
打开你安装目录的third_party,只修改third_party\mpv\portable_config下面的插件,其余的不要动。其中input.conf是快捷键。
47+
1. 自动方法
48+
克隆fntv-mpv仓库,自己改一下相关配置:[fntv-mpv-config](https://github.com/QiaoKes/fntv-mpv-config)
49+
2. 手动方法
50+
打开你安装目录的third_party,只修改third_party\fntv-mpv\portable_config下面的插件,其余的不要动。其中input.conf是快捷键。
4751

4852
注意重新安装或者更新,会清空安装目录,注意备份你的mpv插件目录。
4953

@@ -79,14 +83,32 @@ go的二进制压缩会被误报。可以查看这个issue,二进制由dandanp
7983

8084
去C:\\Users\\{你的计算机用户名}\\.fntv 下面把config.json删除了,因为连接成功后实际上加载的还是飞牛网页端,没响应当然会透明了。
8185

82-
## ⌨️ MPV播放器快捷键
86+
### 10.打开弹幕视频掉帧
87+
88+
打开弹幕时,默认开启fps平滑滤镜,比较吃性能,不需要可以去安装目录下的third_party\fntv-mpv\portable_config\script-opts下uosc_danmaku.conf关闭相关配置
89+
90+
### 11.双显卡,调用时发现使用核显
91+
92+
以下两种方法任选其一:
93+
94+
1) NVIDIA控制面板-管理3D设置-程序设置-添加飞牛影视-应用
95+
2) 设置-系统-屏幕-图形显示-添加飞牛影视-选择高性能
96+
97+
## ⌨️ MPV播放器
98+
99+
1. 快捷键
83100

84101
```text
85102
部分快捷键兼容potpolyer
86103
查看安装目录下
87-
third_party\mpv\portable_config\input.conf
104+
third_party\fntv-mpv\portable_config\input.conf
88105
```
89106

107+
2. MPV配置由以下仓库单独管理:
108+
[fntv-mpv-config](https://github.com/QiaoKes/fntv-mpv-config)
109+
3. 预设着色器方案
110+
[mpv.conf](https://github.com/QiaoKes/fntv-mpv-config/blob/release/custom_config/mpv/mpv.conf)
111+
90112
## 🙏 特别感谢
91113

92114
本项目参考以下开源项目:
@@ -120,29 +142,39 @@ third_party\mpv\portable_config\input.conf
120142
```bash
121143
git clone https://github.com/QiaoKes/fntv-electron.git
122144
cd fntv-electron
123-
# 下载https://github.com/QiaoKes/fntv-electron/releases中的third_party.zip
124-
#解压到third_party中
145+
# 下载https://github.com/QiaoKes/fntv-electron/releases/tag/v0.0.0中的electron-v36.2.1-patch-win32-x64.zip
146+
#解压到third_party中的electron文件夹中
147+
```
148+
149+
2. 下载第三方依赖
150+
151+
```bash
152+
# Windows
153+
# 1.下载https://github.com/QiaoKes/fntv-electron/releases/tag/v0.0.0中的electron-v36.2.1-patch-win32-x64.zip
154+
# 解压到third_party中的electron文件夹中
155+
# 2.下载https://github.com/QiaoKes/fntv-mpv-config/releases
156+
# 解压到third_party中的fntv-mpv文件夹中
125157
```
126158

127-
2. 安装依赖:
159+
3. 安装依赖:
128160

129161
```bash
130162
npm i
131163
```
132164

133-
3. 运行开发模式:
165+
4. 运行开发模式:
134166

135167
```bash
136168
npm start
137169
```
138170

139-
4. 构建安装包:
171+
5. 构建安装包:
140172

141173
```bash
142174
# Windows
143175
# 进入到C:\Users\{your_user_name}\AppData\Local\electron\Cache
144176
# 创建文件夹b3ef7c180a968a1775be99205920d296f99e12cd36db5a1b9a5a2a3bb292f8ae
145-
# 将third_party下的electron-v36.2.1-patch-win32-x64.zip拷贝到文件夹内
177+
# 将electron-v36.2.1-patch-win32-x64.zip拷贝到文件夹内
146178
npm run build
147179
```
148180

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fntv",
3-
"version": "1.6.3",
3+
"version": "1.6.4",
44
"description": "A fntv app built with Electron",
55
"main": "src/main/main.js",
66
"scripts": {
@@ -42,8 +42,8 @@
4242
],
4343
"extraFiles": [
4444
{
45-
"from": "third_party/mpv",
46-
"to": "third_party/mpv",
45+
"from": "third_party/fntv-mpv",
46+
"to": "third_party/fntv-mpv",
4747
"filter": [
4848
"**/*"
4949
]

src/main/eventHandlers.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ async function playMovie(event, { id, token }) {
112112
// 创建播放器实例
113113
const player = new MpvPlayer({
114114
url: playUrl,
115-
mpvPath: 'third_party\\mpv\\mpv.exe',
115+
mpvPath: 'third_party\\fntv-mpv\\mpv.exe',
116116
title: title,
117117
headers: {
118118
Authorization: token,
119119
},
120120
extraArgs: [
121121
// '--ontop',
122-
'--force-window=immediate',
122+
'--force-window=immediate', // 强制窗口立即显示
123123
`--start=${startPosition}`, // 设置起始播放位置
124124
'--cache-secs=20', // 缓冲20秒,防止网络波动卡顿
125125
subArgs // 添加所有字幕文件参数
@@ -141,6 +141,7 @@ async function playMovie(event, { id, token }) {
141141
onExit: (code, progress) => {
142142
if (code !== 0 && code !== null) {
143143
console.error(`播放器异常退出 (code ${code})`);
144+
refreshWindow();
144145
return;
145146
}
146147
console.log('MPV exited with code:', code);

src/modules/mpv/mpv.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,17 @@ class MpvPlayer {
6868
const args = [];
6969

7070
// Windows平台特殊参数
71-
if (os.platform() === 'win32') {
72-
args.push(
73-
'--border=no', // 无边框窗口
74-
'--vo=gpu-next', // <gpu/gpu-next/libmpv> 视频输出驱动。许多后续选项也只能在此三项下正常工作。当前版本默认值即 gpu-next
75-
'--gpu-api=d3d11',
76-
'--hwdec=auto-copy',
77-
// 统一窗口大小设置 - 保持一致的初始窗口大小
78-
'--geometry=1280x720', // 固定窗口大小为 1280x720
79-
);
80-
}
71+
// 改为使用mpv.conf
72+
// if (os.platform() === 'win32') {
73+
// args.push(
74+
// '--border=no', // 无边框窗口
75+
// '--vo=gpu-next', // <gpu/gpu-next/libmpv> 视频输出驱动。许多后续选项也只能在此三项下正常工作。当前版本默认值即 gpu-next
76+
// '--gpu-api=d3d11',
77+
// '--hwdec=auto-copy',
78+
// // 统一窗口大小设置 - 保持一致的初始窗口大小
79+
// '--geometry=1280x720', // 固定窗口大小为 1280x720
80+
// );
81+
// }
8182

8283
// 添加请求头
8384
const headerArgs = [];

0 commit comments

Comments
 (0)