dsh-ffmpeg 0.7.0 → 0.7.1
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/CHANGELOG.md +5 -0
- package/docs/USAGE.en.md +1 -1
- package/docs/USAGE.md +1 -1
- package/lib/storyboard.js +5 -3
- package/lib/update-client.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
[历史英文记录](docs/CHANGELOG.en.md)
|
|
6
6
|
|
|
7
|
+
## 0.7.1 (2026-10-29)
|
|
8
|
+
|
|
9
|
+
- 修复极短、分数帧率视频的采样时间取整越过最后一帧:向下取微秒精度,源文件保持不变。
|
|
10
|
+
- Avoid rounding past the final frame when sampling short fractional-frame-rate clips.
|
|
11
|
+
|
|
7
12
|
## 0.7.0 (2026-10-29)
|
|
8
13
|
|
|
9
14
|
- 新增 ffmpeg_storyboard:均匀采样并拼成单张 PNG 总览图,附每格采样目标时间;可指定片段范围,保留原视频与已有成品。失败或取消会清理临时采样,不发布半成品。
|
package/docs/USAGE.en.md
CHANGED
package/docs/USAGE.md
CHANGED
package/lib/storyboard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { constants, copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, rmSync } from 'node:fs';
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
3
|
import { dirname, extname, join } from 'node:path';
|
|
4
|
-
import {
|
|
4
|
+
import { probeArgs } from './args.js';
|
|
5
5
|
import { parseTimeArg } from './config.js';
|
|
6
6
|
import { parseProbeJson } from './ffprobe.js';
|
|
7
7
|
import { assertInputFile, assertOutputNotSource, resolveOutputPath } from './paths.js';
|
|
@@ -79,13 +79,15 @@ export function createStoryboardTool(config, runner) {
|
|
|
79
79
|
const lastFrame = info.video.fps && info.video.fps > 0 ? Math.max(0, duration - 1 / info.video.fps) : duration;
|
|
80
80
|
if (start > lastFrame)
|
|
81
81
|
throw new Error('所选范围太靠近结尾,无法取得视频帧;请提前 start。');
|
|
82
|
-
|
|
82
|
+
// Round down to FFmpeg's microsecond clock. Millisecond rounding can seek
|
|
83
|
+
// beyond the final frame of a short fractional-frame-rate video.
|
|
84
|
+
const frames = Array.from({ length: count }, (_, i) => ({ index: i + 1, row: Math.floor(i / columns) + 1, column: i % columns + 1, seconds: Math.floor(Math.min(lastFrame, start + (end - start) * i / count) * 1e6) / 1e6 }));
|
|
83
85
|
const scratch = mkdtempSync(join(tmpdir(), 'dsh-ffmpeg-storyboard-'));
|
|
84
86
|
try {
|
|
85
87
|
for (const frame of frames) {
|
|
86
88
|
const image = join(scratch, 'frame-' + String(frame.index).padStart(3, '0') + '.png');
|
|
87
89
|
const filter = 'scale=' + cellWidth + ':' + cellHeight + ':force_original_aspect_ratio=decrease,pad=' + cellWidth + ':' + cellHeight + ':(ow-iw)/2:(oh-ih)/2:color=black,setsar=1';
|
|
88
|
-
await invoke([config.ffmpegPath, '-nostdin', '-v', 'error', '-n', '-ss',
|
|
90
|
+
await invoke([config.ffmpegPath, '-nostdin', '-v', 'error', '-n', '-ss', frame.seconds.toFixed(6), '-i', input, '-map', '0:v:0', '-frames:v', '1', '-an', '-vf', filter, '-update', '1', image], '采样 #' + frame.index);
|
|
89
91
|
if (!existsSync(image) || !lstatSync(image).isFile() || lstatSync(image).size === 0)
|
|
90
92
|
throw new Error('无法取得第 ' + frame.index + ' 格(' + frame.seconds + ' 秒)的画面,请缩短采样范围后重试。');
|
|
91
93
|
}
|
package/lib/update-client.js
CHANGED
|
@@ -437,7 +437,7 @@ function __stardustUpdatesClient(ctx, React, require, shared) {
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_START */
|
|
440
|
-
window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-ffmpeg",factory:require=>({apply(){}})},{"name":"dsh-ffmpeg","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.7.
|
|
440
|
+
window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-ffmpeg",factory:require=>({apply(){}})},{"name":"dsh-ffmpeg","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.7.1","label":"FFmpeg","labelEn":"FFmpeg","suiteComponent":true}));
|
|
441
441
|
|
|
442
442
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_END */
|
|
443
443
|
})();
|