Skip to content

Commit

Permalink
feat
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed Feb 13, 2025
1 parent 0dabb5c commit 0c0767b
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 5,640 deletions.
10 changes: 5 additions & 5 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type FFmpegLogger = (
**Arguments:**

- `_options`: an object of customized options :
- `core`: path to `core.js` of FFmpeg.wasm core (default: `@ffmpeg.wasm/core-mt`)
- `core`: path to `core.js` of FFmpeg.wasm core (default: `@ntsilkwasm/core-mt`)
- `coreOptions`: Normally, Emscripten looks for other files in the folder where core.js is located. You can change the default behaviour with the following options:
- `locateFile()` `locateFile` function of [Emscripten module object](https://emscripten.org/docs/api_reference/module.html#Module.locateFile)(**NOTE**: this setting overrides `wasmPath` and `workerPath`)
- `wasmPath`: path to `core.wasm` of FFmpeg.wasm core
Expand All @@ -55,7 +55,7 @@ type FFmpegLogger = (

```ts
const ffmpeg = FFmpeg.create({
core: "@ffmpeg.wasm/core-mt",
core: "@ntsilkwasm/core-mt",
log: true,
});
```
Expand Down Expand Up @@ -91,9 +91,9 @@ interface FFmpegFlags {
**Examples:**

```ts
import { FFmpeg } from "@ffmpeg.wasm/main";
const ffmpeg1 = await FFmpeg.create({ core: "@ffmpeg.wasm/core-mt" });
const ffmpeg2 = await FFmpeg.create({ core: "@ffmpeg.wasm/core-st" });
import { FFmpeg } from "@ntsilkwasm/main";
const ffmpeg1 = await FFmpeg.create({ core: "@ntsilkwasm/core-mt" });
const ffmpeg2 = await FFmpeg.create({ core: "@ntsilkwasm/core-st" });

console.log(ffmpeg1.flags); // { simd: false, thread: true, wasi: false }
console.log(ffmpeg2.flags); // { simd: false, thread: false, wasi: false }
Expand Down
6 changes: 3 additions & 3 deletions docs/migrate/from-ffmpegwasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
> If feasible, it is recommended to continue to migrate to a newer version for better performance and experience.
1. Change package names and update imports:
- `@ffmpeg/ffmpeg` => `@ffmpeg.wasm/main`
- `@ffmpeg/core` & `@ffmpeg/core-mt` => `@ffmpeg.wasm/core-mt`
- `@ffmpeg/core-st` => `@ffmpeg.wasm/core-st`
- `@ffmpeg/ffmpeg` => `@ntsilkwasm/main`
- `@ffmpeg/core` & `@ffmpeg/core-mt` => `@ntsilkwasm/core-mt`
- `@ffmpeg/core-st` => `@ntsilkwasm/core-st`
- `@ffmpeg/types` has not been migrated, you can use the original package (which should be fully compatible)
2. Update version to `^0.12.0`
2 changes: 1 addition & 1 deletion examples/node/concatDemuxer.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from "path";
import { assetsDir, outDir } from "./utils.mjs";

const ffmpeg = await FFmpeg.create({
core: "@ffmpeg.wasm/core-mt",
core: "@ntsilkwasm/core-mt",
log: true,
});

Expand Down
2 changes: 1 addition & 1 deletion examples/node/hstack.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from "path";
import { assetsDir, outDir } from "./utils.mjs";

const ffmpeg = await FFmpeg.create({
core: "@ffmpeg.wasm/core-mt",
core: "@ntsilkwasm/core-mt",
log: true,
});

Expand Down
2 changes: 1 addition & 1 deletion examples/node/image2video.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from "path";
import { assetsDir, outDir } from "./utils.mjs";

const ffmpeg = await FFmpeg.create({
core: "@ffmpeg.wasm/core-mt",
core: "@ntsilkwasm/core-mt",
log: true,
});

Expand Down
2 changes: 1 addition & 1 deletion examples/node/multiple-output.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from "path";
import { assetsDir, outDir } from "./utils.mjs";

const ffmpeg = await FFmpeg.create({
core: "@ffmpeg.wasm/core-mt",
core: "@ntsilkwasm/core-mt",
log: true,
});

Expand Down
2 changes: 1 addition & 1 deletion examples/node/transcode.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from "path";
import { assetsDir, outDir } from "./utils.mjs";

const ffmpeg = await FFmpeg.create({
core: "@ffmpeg.wasm/core-mt",
core: "@ntsilkwasm/core-mt",
log: true,
});

Expand Down
4 changes: 2 additions & 2 deletions packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
},
"devDependencies": {
"@types/node": "^20.4.4",
"@ffmpeg.wasm/core-mt": "workspace:*",
"@ffmpeg.wasm/core-st": "workspace:*",
"@ntsilkwasm/core-mt": "workspace:*",
"@ntsilkwasm/core-st": "workspace:*",
"tsup": "^7.1.0"
},
"release-it": {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface FFmpegInitOptions {
}

const defaultInitOptions: Required<FFmpegInitOptions> = {
core: "@ffmpeg.wasm/core-mt",
core: "@ntsilkwasm/core-mt",
coreOptions: {},
defaultArgs: ["-nostdin", "-y", "-hide_banner"],
log: false,
Expand Down
Loading

0 comments on commit 0c0767b

Please sign in to comment.