dsh-ffmpeg 0.7.0 → 0.7.2
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 +10 -0
- package/README.en.md +8 -2
- package/README.md +8 -2
- 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,16 @@
|
|
|
4
4
|
|
|
5
5
|
[历史英文记录](docs/CHANGELOG.en.md)
|
|
6
6
|
|
|
7
|
+
## 0.7.2 (2026-10-29)
|
|
8
|
+
|
|
9
|
+
- 补齐中英文使用流程:准备、入口、具体操作与结果核对;新增累计 npm 下载徽章并保留月统计。
|
|
10
|
+
- Add practical getting-started workflows and lifetime npm download badges alongside monthly counts.
|
|
11
|
+
|
|
12
|
+
## 0.7.1 (2026-10-29)
|
|
13
|
+
|
|
14
|
+
- 修复极短、分数帧率视频的采样时间取整越过最后一帧:向下取微秒精度,源文件保持不变。
|
|
15
|
+
- Avoid rounding past the final frame when sampling short fractional-frame-rate clips.
|
|
16
|
+
|
|
7
17
|
## 0.7.0 (2026-10-29)
|
|
8
18
|
|
|
9
19
|
- 新增 ffmpeg_storyboard:均匀采样并拼成单张 PNG 总览图,附每格采样目标时间;可指定片段范围,保留原视频与已有成品。失败或取消会清理临时采样,不发布半成品。
|
package/README.en.md
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
Use local FFmpeg from DSH to trim, join, encode and process existing media, including subtitles, audio, GIFs and frame extraction. For authoring new video projects, use the HyperFrames or Remotion plugin.
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/dsh-ffmpeg) [](https://www.npmjs.com/package/dsh-ffmpeg)
|
|
9
|
+
[](https://www.npmjs.com/package/dsh-ffmpeg) [](https://www.npmjs.com/package/dsh-ffmpeg) [](https://www.npmjs.com/package/dsh-ffmpeg)
|
|
10
|
+
|
|
11
|
+
[Download statistics](https://github.com/STARDUSTLC666/dsh-suite/blob/npm-downloads/README.md)
|
|
10
12
|
|
|
11
13
|
Feedback and contributions are welcome: report [issues](https://github.com/STARDUSTLC666/dsh-ffmpeg/issues) or submit [pull requests](https://github.com/STARDUSTLC666/dsh-ffmpeg/pulls).
|
|
12
14
|
|
|
@@ -30,7 +32,11 @@ For the web version, replace `desktop` with `web`. Restart DSH after installatio
|
|
|
30
32
|
|
|
31
33
|
## Start using it
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
1. Install FFmpeg/ffprobe and run ffmpeg_health in DSH to check the executables.
|
|
36
|
+
2. Place the input in your workspace or provide its exact local path, and describe the clip and output requirements.
|
|
37
|
+
3. Use ffmpeg_storyboard to inspect a contact sheet first; locate segments using the returned cell sample times.
|
|
38
|
+
4. Choose trimming, joining, encoding or extraction. Source files are protected and existing output gets a new name by default.
|
|
39
|
+
5. Open the returned output, inspect it with ffmpeg_probe, and play it to check both picture and sound.
|
|
34
40
|
|
|
35
41
|
## Requirements and configuration
|
|
36
42
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
通过 DSH 调用本机 FFmpeg,处理已有音视频文件:裁切、拼接、转码、字幕、音轨、GIF 与帧提取。适合媒体后期处理;创作新的视频工程可选 HyperFrames 或 Remotion 插件。
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/dsh-ffmpeg) [](https://www.npmjs.com/package/dsh-ffmpeg)
|
|
9
|
+
[](https://www.npmjs.com/package/dsh-ffmpeg) [](https://www.npmjs.com/package/dsh-ffmpeg) [](https://www.npmjs.com/package/dsh-ffmpeg)
|
|
10
|
+
|
|
11
|
+
[下载统计说明](https://github.com/STARDUSTLC666/dsh-suite/blob/npm-downloads/README.md)
|
|
10
12
|
|
|
11
13
|
欢迎使用,遇到问题或有改进建议,请提交 [issues](https://github.com/STARDUSTLC666/dsh-ffmpeg/issues) 和 [PR](https://github.com/STARDUSTLC666/dsh-ffmpeg/pulls)。
|
|
12
14
|
|
|
@@ -30,7 +32,11 @@ dsh plugin --profile desktop add dsh-ffmpeg
|
|
|
30
32
|
|
|
31
33
|
## 开始使用
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
1. 安装 FFmpeg/ffprobe,并在 DSH 中运行 ffmpeg_health 检查可执行文件。
|
|
36
|
+
2. 把输入文件放在当前工作区或提供准确的本地路径,说明想要的片段和输出规格。
|
|
37
|
+
3. 想先看内容时,让助手用 ffmpeg_storyboard 生成总览图,按每格采样时间定位片段。
|
|
38
|
+
4. 选择裁切、拼接、转码或抽帧等操作;默认保留源文件,重名成品另取文件名。
|
|
39
|
+
5. 按返回路径打开成品,用 ffmpeg_probe 检查参数,并实际播放核对画面和声音。
|
|
34
40
|
|
|
35
41
|
## 依赖与配置
|
|
36
42
|
|
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.2","label":"FFmpeg","labelEn":"FFmpeg","suiteComponent":true}));
|
|
441
441
|
|
|
442
442
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_END */
|
|
443
443
|
})();
|