mb-rrvideo-server 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ services:
12
12
 
13
13
  volumes:
14
14
  # 配置文件(必须)
15
- - ./config.json:/app/config/config.json:ro
15
+ - ./config.json:/app/config/config.json
16
16
  # 日志目录
17
17
  - ./logs:/app/logs
18
18
  # 临时文件目录
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mb-rrvideo-server",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "视频转码服务 - 接收可回溯机请求,执行转码/合并,上传MinIO/本地存储",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -43,9 +43,18 @@ async function handleMerge(inputData, res, logFileName) {
43
43
  }
44
44
 
45
45
  const taskId = mergeId;
46
- const videos = Array.isArray(inputData.videos) ? inputData.videos : [];
46
+ const videos = (Array.isArray(inputData.videos) ? inputData.videos : [])
47
+ .filter(v => v && typeof v === 'string' && v.trim())
48
+ .map(v => v.trim());
47
49
  // 兼容 output 和 output_name 两种参数名
48
- const output = inputData.output || inputData.output_name || '';
50
+ let output = (inputData.output || inputData.output_name || '').trim();
51
+
52
+ // 如果 output 只是文件名(不是绝对路径),则拼接到配置的视频目录
53
+ if (output && !path.isAbsolute(output)) {
54
+ const videoDir = config.get('storage.local.video_dir') || path.join(__dirname, '../../Video');
55
+ output = path.join(videoDir, output);
56
+ }
57
+
49
58
  const format = inputData.format || 'mp4';
50
59
  const method = inputData.method || 'concat';
51
60
  const autoMode = inputData.auto_mode || 'smart';