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.
- package/docker-compose.yml +1 -1
- package/package.json +1 -1
- package/src/routes/merge.js +11 -2
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
package/src/routes/merge.js
CHANGED
|
@@ -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
|
-
|
|
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';
|