@bylqwjc/media-editor-react 1.0.12
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/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/index.cjs +282 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +54 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +240 -0
- package/dist/index.js.map +1 -0
- package/filerobot.css +1669 -0
- package/node_modules/@media-editor/client/LICENSE +21 -0
- package/node_modules/@media-editor/client/README.md +27 -0
- package/node_modules/@media-editor/client/dist/index.cjs +60 -0
- package/node_modules/@media-editor/client/dist/index.cjs.map +1 -0
- package/node_modules/@media-editor/client/dist/index.d.cts +24 -0
- package/node_modules/@media-editor/client/dist/index.d.ts +24 -0
- package/node_modules/@media-editor/client/dist/index.js +35 -0
- package/node_modules/@media-editor/client/dist/index.js.map +1 -0
- package/node_modules/@media-editor/client/package.json +23 -0
- package/node_modules/@media-editor/core/LICENSE +21 -0
- package/node_modules/@media-editor/core/README.md +14 -0
- package/node_modules/@media-editor/core/dist/browser.cjs +505 -0
- package/node_modules/@media-editor/core/dist/browser.cjs.map +1 -0
- package/node_modules/@media-editor/core/dist/browser.d.cts +100 -0
- package/node_modules/@media-editor/core/dist/browser.d.ts +100 -0
- package/node_modules/@media-editor/core/dist/browser.js +883 -0
- package/node_modules/@media-editor/core/dist/browser.js.map +1 -0
- package/node_modules/@media-editor/core/dist/chunk-MGKYVYOH.js +371 -0
- package/node_modules/@media-editor/core/dist/chunk-MGKYVYOH.js.map +1 -0
- package/node_modules/@media-editor/core/dist/chunk-USY6UDGL.js +87 -0
- package/node_modules/@media-editor/core/dist/chunk-USY6UDGL.js.map +1 -0
- package/node_modules/@media-editor/core/dist/chunk-XCBM7P7N.js +592 -0
- package/node_modules/@media-editor/core/dist/chunk-XCBM7P7N.js.map +1 -0
- package/node_modules/@media-editor/core/dist/engine.cjs +540 -0
- package/node_modules/@media-editor/core/dist/engine.cjs.map +1 -0
- package/node_modules/@media-editor/core/dist/engine.d.cts +325 -0
- package/node_modules/@media-editor/core/dist/engine.d.ts +359 -0
- package/node_modules/@media-editor/core/dist/engine.js +315 -0
- package/node_modules/@media-editor/core/dist/engine.js.map +1 -0
- package/node_modules/@media-editor/core/dist/filerobot.cjs +818 -0
- package/node_modules/@media-editor/core/dist/filerobot.cjs.map +1 -0
- package/node_modules/@media-editor/core/dist/filerobot.d.cts +88 -0
- package/node_modules/@media-editor/core/dist/filerobot.d.ts +88 -0
- package/node_modules/@media-editor/core/dist/filerobot.js +473 -0
- package/node_modules/@media-editor/core/dist/filerobot.js.map +1 -0
- package/node_modules/@media-editor/core/dist/index.cjs +1276 -0
- package/node_modules/@media-editor/core/dist/index.cjs.map +1 -0
- package/node_modules/@media-editor/core/dist/index.d.cts +242 -0
- package/node_modules/@media-editor/core/dist/index.d.ts +264 -0
- package/node_modules/@media-editor/core/dist/index.js +682 -0
- package/node_modules/@media-editor/core/dist/index.js.map +1 -0
- package/node_modules/@media-editor/core/dist/platform-presets-B-o4C6uY.d.cts +80 -0
- package/node_modules/@media-editor/core/dist/platform-presets-B-o4C6uY.d.ts +80 -0
- package/node_modules/@media-editor/core/dist/state-B85vkf7_.d.cts +936 -0
- package/node_modules/@media-editor/core/dist/state-B85vkf7_.d.ts +1027 -0
- package/node_modules/@media-editor/core/node_modules/zod/LICENSE +21 -0
- package/node_modules/@media-editor/core/node_modules/zod/README.md +208 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.cjs +33 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.js +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/package.json +118 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.js +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.js +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/index.js +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4-mini/index.js +1 -0
- package/node_modules/@media-editor/core/package.json +42 -0
- package/node_modules/@media-editor/image/LICENSE +21 -0
- package/node_modules/@media-editor/image/README.md +48 -0
- package/node_modules/@media-editor/image/dist/chunk-5TBO732O.js +1 -0
- package/node_modules/@media-editor/image/dist/index-CU3vkvDR.d.ts +44 -0
- package/node_modules/@media-editor/image/dist/index.css +1 -0
- package/node_modules/@media-editor/image/dist/index.d.ts +2 -0
- package/node_modules/@media-editor/image/dist/index.js +364 -0
- package/node_modules/@media-editor/image/dist/lazy.css +1 -0
- package/node_modules/@media-editor/image/dist/lazy.d.ts +8 -0
- package/node_modules/@media-editor/image/dist/lazy.js +1 -0
- package/node_modules/@media-editor/image/package.json +29 -0
- package/node_modules/@media-editor/video/LICENSE +21 -0
- package/node_modules/@media-editor/video/README.md +55 -0
- package/node_modules/@media-editor/video/dist/chunk-EK7ODJWE.js +1 -0
- package/node_modules/@media-editor/video/dist/index-CX2iAapm.d.ts +51 -0
- package/node_modules/@media-editor/video/dist/index.d.ts +4 -0
- package/node_modules/@media-editor/video/dist/index.js +16919 -0
- package/node_modules/@media-editor/video/dist/lazy.d.ts +10 -0
- package/node_modules/@media-editor/video/dist/lazy.js +1 -0
- package/node_modules/@media-editor/video/dist/legacy.js +65 -0
- package/node_modules/@media-editor/video/package.json +29 -0
- package/package.json +48 -0
- package/style.css +1 -0
- package/theme.css +1214 -0
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
import { findFilterPreset, normalizeDeg, outputSize } from './chunk-USY6UDGL.js';
|
|
2
|
+
export { DEG2RAD, FILTER_PRESETS, buildFilterCss, centeredMaxRect, clampRect, evenize, findFilterPreset, fitRects, normalizeDeg, outputSize, rotatedSize } from './chunk-USY6UDGL.js';
|
|
3
|
+
export { AudioClip, Clip, MIN_CLIP, Overlay, VideoEditState, canRedo, canUndo, clampAudioClip, clipDuration, clipStartsAt, contentDuration, createHistory, defaultVideoEditState, duplicateClip, locateOutput, pushHistory, redo, remapSrcIndices, removeClip, reorderClips, replacePresent, splitAtOutput, totalDuration, trimClipEdge, undo, usedVideoSrcIndices } from './chunk-MGKYVYOH.js';
|
|
4
|
+
export { DEFAULT_PLATFORM_TARGETS, EDITOR_MESSAGES, IMAGE_PLATFORM_PRESETS, IMAGE_RATIO_PRESETS, VIDEO_PLATFORM_RATIO_PRESETS, VIDEO_RATIO_PRESETS, VIDEO_SIZE_PRESETS, buildImagePlatformPresets, buildVideoPlatformRatioPresets, buildVideoSizePresets, compensateAnnotationRotation, parseRatio, tEditor, toHant } from './chunk-XCBM7P7N.js';
|
|
5
|
+
|
|
6
|
+
// src/ffmpeg-args.ts
|
|
7
|
+
function rotationFilters(deg) {
|
|
8
|
+
const norm = normalizeDeg(deg);
|
|
9
|
+
if (norm === 0) return [];
|
|
10
|
+
if (norm === 90) return ["transpose=1"];
|
|
11
|
+
if (norm === 180) return ["transpose=1", "transpose=1"];
|
|
12
|
+
if (norm === 270) return ["transpose=2"];
|
|
13
|
+
const rad = `${norm}*PI/180`;
|
|
14
|
+
return [`rotate=${rad}:ow=rotw(${rad}):oh=roth(${rad}):c=black`];
|
|
15
|
+
}
|
|
16
|
+
function clampFilterAdjustment(value) {
|
|
17
|
+
return Math.max(-1, Math.min(1, Number(value) || 0));
|
|
18
|
+
}
|
|
19
|
+
function clampFilterUnit(value) {
|
|
20
|
+
return Math.max(0, Math.min(1, Number(value) || 0));
|
|
21
|
+
}
|
|
22
|
+
function clampExportNumber(value, min, max, fallback) {
|
|
23
|
+
const next = Math.round(Number(value));
|
|
24
|
+
if (!Number.isFinite(next)) return fallback;
|
|
25
|
+
return Math.min(max, Math.max(min, next));
|
|
26
|
+
}
|
|
27
|
+
function clampAudioSpeed(value) {
|
|
28
|
+
return Math.min(Math.max(Number(value) || 1, 0.5), 2);
|
|
29
|
+
}
|
|
30
|
+
function buildAudioTempoFilters(speed) {
|
|
31
|
+
const filters = [];
|
|
32
|
+
let next = clampAudioSpeed(speed);
|
|
33
|
+
while (next < 0.5 - 1e-6 || next > 2 + 1e-6) {
|
|
34
|
+
if (next < 0.5) {
|
|
35
|
+
filters.push("atempo=0.5");
|
|
36
|
+
next /= 0.5;
|
|
37
|
+
} else {
|
|
38
|
+
filters.push("atempo=2");
|
|
39
|
+
next /= 2;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (Math.abs(next - 1) > 1e-4) {
|
|
43
|
+
filters.push(`atempo=${next.toFixed(4).replace(/0+$/, "").replace(/\.$/, "")}`);
|
|
44
|
+
}
|
|
45
|
+
return filters;
|
|
46
|
+
}
|
|
47
|
+
function evenizeExportDimension(value, fallback) {
|
|
48
|
+
const normalized = clampExportNumber(value, 2, 8192, fallback);
|
|
49
|
+
return normalized % 2 === 0 ? normalized : normalized - 1;
|
|
50
|
+
}
|
|
51
|
+
function getExportSettings(state) {
|
|
52
|
+
return state?.exportSettings ?? null;
|
|
53
|
+
}
|
|
54
|
+
function getExportFormat(state) {
|
|
55
|
+
const value = String(getExportSettings(state)?.format ?? "mp4").toLowerCase();
|
|
56
|
+
return value === "mov" || value === "mxf" ? value : "mp4";
|
|
57
|
+
}
|
|
58
|
+
function getExportFrameRate(state) {
|
|
59
|
+
return clampExportNumber(getExportSettings(state)?.frameRate, 12, 120, 30);
|
|
60
|
+
}
|
|
61
|
+
function getExportOutputSize(state) {
|
|
62
|
+
const base = outputSize(state.canvas, state);
|
|
63
|
+
const settings = getExportSettings(state);
|
|
64
|
+
if (!settings) return base;
|
|
65
|
+
const hasWidth = Number.isFinite(Number(settings.width)) && Number(settings.width) > 0;
|
|
66
|
+
const hasHeight = Number.isFinite(Number(settings.height)) && Number(settings.height) > 0;
|
|
67
|
+
if (!hasWidth && !hasHeight) return base;
|
|
68
|
+
const aspect = base.w > 0 && base.h > 0 ? base.w / base.h : 1;
|
|
69
|
+
if (hasWidth && hasHeight) {
|
|
70
|
+
return {
|
|
71
|
+
w: evenizeExportDimension(settings.width, base.w),
|
|
72
|
+
h: evenizeExportDimension(settings.height, base.h)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (hasWidth) {
|
|
76
|
+
const width = evenizeExportDimension(settings.width, base.w);
|
|
77
|
+
return {
|
|
78
|
+
w: width,
|
|
79
|
+
h: evenizeExportDimension(width / aspect, base.h)
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const height = evenizeExportDimension(settings.height, base.h);
|
|
83
|
+
return {
|
|
84
|
+
w: evenizeExportDimension(height * aspect, base.w),
|
|
85
|
+
h: height
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function getExportVideoBitrateKbps(state) {
|
|
89
|
+
const value = Number(getExportSettings(state)?.videoBitrateKbps);
|
|
90
|
+
return Number.isFinite(value) && value >= 100 ? Math.round(value) : 0;
|
|
91
|
+
}
|
|
92
|
+
function getExportAudioBitrateKbps(state) {
|
|
93
|
+
const value = Number(getExportSettings(state)?.audioBitrateKbps);
|
|
94
|
+
return Number.isFinite(value) && value >= 32 ? Math.round(value) : 0;
|
|
95
|
+
}
|
|
96
|
+
function getExportAudioCodec(state) {
|
|
97
|
+
return getExportSettings(state)?.audioCodec === "mp3" ? "libmp3lame" : "aac";
|
|
98
|
+
}
|
|
99
|
+
function getProjectOutputSize(state) {
|
|
100
|
+
return outputSize(state.canvas, state);
|
|
101
|
+
}
|
|
102
|
+
function buildExportScaleFilters(state) {
|
|
103
|
+
const baseOutput = getProjectOutputSize(state);
|
|
104
|
+
const exportOutput = getExportOutputSize(state);
|
|
105
|
+
if (exportOutput.w === baseOutput.w && exportOutput.h === baseOutput.h) return [];
|
|
106
|
+
return [`scale=${exportOutput.w}:${exportOutput.h}`];
|
|
107
|
+
}
|
|
108
|
+
function eqFilter(f) {
|
|
109
|
+
const brightness = clampFilterAdjustment(f?.brightness);
|
|
110
|
+
const contrast = clampFilterAdjustment(f?.contrast);
|
|
111
|
+
const saturation = clampFilterAdjustment(f?.saturation);
|
|
112
|
+
const gamma = clampFilterAdjustment(f?.gamma);
|
|
113
|
+
if (brightness === 0 && contrast === 0 && saturation === 0 && gamma === 0) return null;
|
|
114
|
+
const filters = [];
|
|
115
|
+
if (brightness !== 0 || contrast !== 0) {
|
|
116
|
+
const brightnessFactor = formatFilterNumber(Math.max(0, 1 + brightness));
|
|
117
|
+
const contrastFactor = formatFilterNumber(Math.max(0, 1 + contrast));
|
|
118
|
+
const rgbExpr = `clip(((val*${brightnessFactor})-128)*${contrastFactor}+128,0,255)`;
|
|
119
|
+
filters.push(`lutrgb=r='${rgbExpr}':g='${rgbExpr}':b='${rgbExpr}'`);
|
|
120
|
+
}
|
|
121
|
+
const eqParts = [];
|
|
122
|
+
if (saturation !== 0) eqParts.push(`saturation=${1 + saturation}`);
|
|
123
|
+
if (gamma !== 0) eqParts.push(`gamma=${(1 + gamma * (gamma > 0 ? 1 : 0.5)).toFixed(3)}`);
|
|
124
|
+
if (eqParts.length) filters.push(`eq=${eqParts.join(":")}`);
|
|
125
|
+
return filters.join(",");
|
|
126
|
+
}
|
|
127
|
+
function formatFilterNumber(value) {
|
|
128
|
+
return `${Math.round(value * 1e3) / 1e3}`;
|
|
129
|
+
}
|
|
130
|
+
function colorBalanceFilter(f) {
|
|
131
|
+
const temperature = clampFilterAdjustment(f?.temperature);
|
|
132
|
+
const tint = clampFilterAdjustment(f?.tint);
|
|
133
|
+
if (temperature === 0 && tint === 0) return null;
|
|
134
|
+
const rs = clampFilterAdjustment(temperature * 0.18 + tint * 0.08);
|
|
135
|
+
const gs = clampFilterAdjustment(temperature * 0.02 - tint * 0.12);
|
|
136
|
+
const bs = clampFilterAdjustment(-temperature * 0.18 + tint * 0.08);
|
|
137
|
+
return `colorbalance=rs=${formatFilterNumber(rs)}:gs=${formatFilterNumber(gs)}:bs=${formatFilterNumber(bs)}`;
|
|
138
|
+
}
|
|
139
|
+
function vibranceFilter(f) {
|
|
140
|
+
const vibrance = clampFilterAdjustment(f?.vibrance);
|
|
141
|
+
if (vibrance === 0) return null;
|
|
142
|
+
return `vibrance=intensity=${formatFilterNumber(vibrance)}`;
|
|
143
|
+
}
|
|
144
|
+
function smoothstep(edge0, edge1, value) {
|
|
145
|
+
if (edge0 === edge1) return value < edge0 ? 0 : 1;
|
|
146
|
+
const t = Math.max(0, Math.min(1, (value - edge0) / (edge1 - edge0)));
|
|
147
|
+
return t * t * (3 - 2 * t);
|
|
148
|
+
}
|
|
149
|
+
function midtoneWeight(value) {
|
|
150
|
+
const rise = smoothstep(0.08, 0.4, value);
|
|
151
|
+
const fall = 1 - smoothstep(0.6, 0.92, value);
|
|
152
|
+
return Math.max(0, Math.min(1, rise * fall * 2.2));
|
|
153
|
+
}
|
|
154
|
+
function toneCurveSample(value, adjustments) {
|
|
155
|
+
const shadowWeight = 1 - smoothstep(0.18, 0.62, value);
|
|
156
|
+
const blackWeight = 1 - smoothstep(0.04, 0.32, value);
|
|
157
|
+
const highlightWeight = smoothstep(0.38, 0.84, value);
|
|
158
|
+
const whiteWeight = smoothstep(0.7, 0.98, value);
|
|
159
|
+
const midWeight = midtoneWeight(value);
|
|
160
|
+
const delta = adjustments.shadows * shadowWeight * 0.28 + adjustments.highlights * highlightWeight * 0.24 + adjustments.blacks * blackWeight * 0.2 + adjustments.whites * whiteWeight * 0.2 + adjustments.lightSense * midWeight * 0.18 + adjustments.fade * (0.12 + shadowWeight * 0.06);
|
|
161
|
+
return Math.max(0, Math.min(1, value + delta));
|
|
162
|
+
}
|
|
163
|
+
function toneCurveFilter(f) {
|
|
164
|
+
const adjustments = {
|
|
165
|
+
highlights: clampFilterAdjustment(f?.highlights),
|
|
166
|
+
shadows: clampFilterAdjustment(f?.shadows),
|
|
167
|
+
whites: clampFilterAdjustment(f?.whites),
|
|
168
|
+
blacks: clampFilterAdjustment(f?.blacks),
|
|
169
|
+
lightSense: clampFilterAdjustment(f?.lightSense),
|
|
170
|
+
fade: clampFilterUnit(f?.fade)
|
|
171
|
+
};
|
|
172
|
+
const hasToneAdjustments = Object.values(adjustments).some((value) => Math.abs(value) > 1e-4);
|
|
173
|
+
if (!hasToneAdjustments) return null;
|
|
174
|
+
const points = [0, 0.18, 0.36, 0.5, 0.68, 0.84, 1].map((point) => `${formatFilterNumber(point)}/${formatFilterNumber(toneCurveSample(point, adjustments))}`);
|
|
175
|
+
return `curves=master='${points.join(" ")}'`;
|
|
176
|
+
}
|
|
177
|
+
function detailFilters(f) {
|
|
178
|
+
const filters = [];
|
|
179
|
+
const clarity = clampFilterUnit(f?.clarity);
|
|
180
|
+
const sharpen = clampFilterUnit(f?.sharpen);
|
|
181
|
+
if (clarity > 1e-4) {
|
|
182
|
+
filters.push(`unsharp=lx=7:ly=7:la=${formatFilterNumber(clarity * 1.8)}:cx=7:cy=7:ca=0`);
|
|
183
|
+
}
|
|
184
|
+
if (sharpen > 1e-4) {
|
|
185
|
+
filters.push(`unsharp=lx=3:ly=3:la=${formatFilterNumber(0.35 + sharpen * 2.1)}:cx=3:cy=3:ca=${formatFilterNumber(sharpen * 0.55)}`);
|
|
186
|
+
}
|
|
187
|
+
return filters;
|
|
188
|
+
}
|
|
189
|
+
function grainFilter(f) {
|
|
190
|
+
const grain = clampFilterUnit(f?.grain);
|
|
191
|
+
if (grain <= 1e-4) return null;
|
|
192
|
+
return `noise=alls=${Math.round(6 + grain * 26)}:allf=t`;
|
|
193
|
+
}
|
|
194
|
+
function vignetteFilter(f) {
|
|
195
|
+
const vignette = clampFilterUnit(f?.vignette);
|
|
196
|
+
if (vignette <= 1e-4) return null;
|
|
197
|
+
const angle = Math.max(0.12, 0.42 - vignette * 0.22);
|
|
198
|
+
return `vignette=angle=${formatFilterNumber(angle)}*PI`;
|
|
199
|
+
}
|
|
200
|
+
function buildVideoFilters(state, options = {}) {
|
|
201
|
+
const vf = [];
|
|
202
|
+
if (state.flipX) vf.push("hflip");
|
|
203
|
+
if (state.flipY) vf.push("vflip");
|
|
204
|
+
vf.push(...rotationFilters(state.rotation));
|
|
205
|
+
if (state.crop) {
|
|
206
|
+
const { x, y, width, height } = state.crop;
|
|
207
|
+
vf.push(`crop=${width}:${height}:${x}:${y}`);
|
|
208
|
+
}
|
|
209
|
+
if (state.scale) {
|
|
210
|
+
const { width, height, fit } = state.scale;
|
|
211
|
+
if (fit === "force") {
|
|
212
|
+
vf.push(`scale=${width}:${height}`);
|
|
213
|
+
} else if (fit === "cover") {
|
|
214
|
+
vf.push(`scale=${width}:${height}:force_original_aspect_ratio=increase`, `crop=${width}:${height}`);
|
|
215
|
+
} else {
|
|
216
|
+
vf.push(
|
|
217
|
+
`scale=${width}:${height}:force_original_aspect_ratio=decrease`,
|
|
218
|
+
`pad=${width}:${height}:(ow-iw)/2:(oh-ih)/2`
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const eq = eqFilter(state.filters);
|
|
223
|
+
if (eq) vf.push(eq);
|
|
224
|
+
const colorBalance = colorBalanceFilter(state.filters);
|
|
225
|
+
if (colorBalance) vf.push(colorBalance);
|
|
226
|
+
const vibrance = vibranceFilter(state.filters);
|
|
227
|
+
if (vibrance) vf.push(vibrance);
|
|
228
|
+
const toneCurve = toneCurveFilter(state.filters);
|
|
229
|
+
if (toneCurve) vf.push(toneCurve);
|
|
230
|
+
vf.push(...detailFilters(state.filters));
|
|
231
|
+
const grain = grainFilter(state.filters);
|
|
232
|
+
if (grain) vf.push(grain);
|
|
233
|
+
const vignette = vignetteFilter(state.filters);
|
|
234
|
+
if (vignette) vf.push(vignette);
|
|
235
|
+
const preset = findFilterPreset(state.filterPreset);
|
|
236
|
+
if (preset) vf.push(preset.vf);
|
|
237
|
+
if (options.includeExportScale !== false) vf.push(...buildExportScaleFilters(state));
|
|
238
|
+
vf.push(`fps=${getExportFrameRate(state)}`);
|
|
239
|
+
const norm = normalizeDeg(state.rotation);
|
|
240
|
+
if (norm % 90 !== 0 && !state.scale) {
|
|
241
|
+
vf.push("scale=trunc(iw/2)*2:trunc(ih/2)*2");
|
|
242
|
+
}
|
|
243
|
+
return vf;
|
|
244
|
+
}
|
|
245
|
+
var TRANSITION_FFMPEG_MAP = {
|
|
246
|
+
fade: "fade",
|
|
247
|
+
slide: "slideleft",
|
|
248
|
+
wipe: "wipeleft",
|
|
249
|
+
flip: "horzopen",
|
|
250
|
+
clockWipe: "radial",
|
|
251
|
+
star: "pixelize",
|
|
252
|
+
circle: "circleopen",
|
|
253
|
+
rectangle: "rectcrop"
|
|
254
|
+
};
|
|
255
|
+
var TRANSITION_AUDIO_CURVE_MAP = {
|
|
256
|
+
fade: "qsin",
|
|
257
|
+
slide: "tri",
|
|
258
|
+
wipe: "tri",
|
|
259
|
+
flip: "exp",
|
|
260
|
+
clockWipe: "qsin",
|
|
261
|
+
star: "tri",
|
|
262
|
+
circle: "qsin",
|
|
263
|
+
rectangle: "qsin"
|
|
264
|
+
};
|
|
265
|
+
function clipSpanDuration(clip) {
|
|
266
|
+
return clip.out - clip.in;
|
|
267
|
+
}
|
|
268
|
+
function resolveTransition(transition, leftDuration, rightDuration) {
|
|
269
|
+
const type = transition && typeof transition.type === "string" ? transition.type : "none";
|
|
270
|
+
const mapped = TRANSITION_FFMPEG_MAP[type] ? type : "none";
|
|
271
|
+
const maxDuration = Math.max(0, Math.min(1.2, leftDuration - 0.05, rightDuration - 0.05));
|
|
272
|
+
if (mapped === "none" || maxDuration <= 0.05) {
|
|
273
|
+
return { type: "none", duration: 0, effect: "fade", curve: "tri" };
|
|
274
|
+
}
|
|
275
|
+
const rawDuration = Number(transition?.duration);
|
|
276
|
+
const duration = Math.min(Math.max(Number.isFinite(rawDuration) ? rawDuration : 0.4, 0.1), maxDuration);
|
|
277
|
+
return {
|
|
278
|
+
type: mapped,
|
|
279
|
+
duration,
|
|
280
|
+
effect: TRANSITION_FFMPEG_MAP[mapped],
|
|
281
|
+
curve: TRANSITION_AUDIO_CURVE_MAP[mapped] ?? "tri"
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function hasActiveTransitions(transitions, clips) {
|
|
285
|
+
if (!Array.isArray(clips) || clips.length < 2) return false;
|
|
286
|
+
for (let i = 0; i < clips.length - 1; i++) {
|
|
287
|
+
const transition = resolveTransition(transitions?.[i], clipSpanDuration(clips[i]), clipSpanDuration(clips[i + 1]));
|
|
288
|
+
if (transition.type !== "none" && transition.duration > 0) return true;
|
|
289
|
+
}
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
function buildTransitionSegments(clips, transitions) {
|
|
293
|
+
const segments = [];
|
|
294
|
+
let start = 0;
|
|
295
|
+
for (let i = 0; i < clips.length - 1; i++) {
|
|
296
|
+
const transition = resolveTransition(transitions?.[i], clipSpanDuration(clips[i]), clipSpanDuration(clips[i + 1]));
|
|
297
|
+
if (transition.type !== "none" && transition.duration > 0) {
|
|
298
|
+
segments.push({ start, end: i, transition });
|
|
299
|
+
start = i + 1;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
segments.push({ start, end: clips.length - 1, transition: null });
|
|
303
|
+
return segments;
|
|
304
|
+
}
|
|
305
|
+
function segmentClipDuration(clips, start, end) {
|
|
306
|
+
let total = 0;
|
|
307
|
+
for (let i = start; i <= end; i++) total += clipSpanDuration(clips[i]);
|
|
308
|
+
return total;
|
|
309
|
+
}
|
|
310
|
+
function buildTransitionTimeline(parts, clips, transitions, keepAudio) {
|
|
311
|
+
const segments = buildTransitionSegments(clips, transitions);
|
|
312
|
+
const builtSegments = segments.map((segment, segmentIndex) => {
|
|
313
|
+
const duration = segmentClipDuration(clips, segment.start, segment.end);
|
|
314
|
+
if (segment.start === segment.end) {
|
|
315
|
+
return {
|
|
316
|
+
vLabel: `[v${segment.start}]`,
|
|
317
|
+
aLabel: keepAudio ? `[a${segment.start}]` : "",
|
|
318
|
+
duration,
|
|
319
|
+
transition: segment.transition
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
const inputs = [];
|
|
323
|
+
for (let i = segment.start; i <= segment.end; i++) {
|
|
324
|
+
inputs.push(keepAudio ? `[v${i}][a${i}]` : `[v${i}]`);
|
|
325
|
+
}
|
|
326
|
+
const vLabel = `[sgv${segmentIndex}]`;
|
|
327
|
+
const aLabel = keepAudio ? `[sga${segmentIndex}]` : "";
|
|
328
|
+
parts.push(
|
|
329
|
+
`${inputs.join("")}concat=n=${segment.end - segment.start + 1}:v=1:a=${keepAudio ? 1 : 0}${keepAudio ? `${vLabel}${aLabel}` : vLabel}`
|
|
330
|
+
);
|
|
331
|
+
return { vLabel, aLabel, duration, transition: segment.transition };
|
|
332
|
+
});
|
|
333
|
+
let currentV = builtSegments[0].vLabel;
|
|
334
|
+
let currentA = keepAudio ? builtSegments[0].aLabel : "";
|
|
335
|
+
let currentDuration = builtSegments[0].duration;
|
|
336
|
+
for (let i = 1; i < builtSegments.length; i++) {
|
|
337
|
+
const transition = builtSegments[i - 1].transition;
|
|
338
|
+
const next = builtSegments[i];
|
|
339
|
+
const vOut = `[vx${i}]`;
|
|
340
|
+
const offset = Math.max(0, currentDuration - transition.duration);
|
|
341
|
+
parts.push(`${currentV}${next.vLabel}xfade=transition=${transition.effect}:duration=${transition.duration}:offset=${offset}${vOut}`);
|
|
342
|
+
currentV = vOut;
|
|
343
|
+
if (keepAudio) {
|
|
344
|
+
const aOut = `[ax${i}]`;
|
|
345
|
+
parts.push(`${currentA}${next.aLabel}acrossfade=d=${transition.duration}:c1=${transition.curve}:c2=${transition.curve}${aOut}`);
|
|
346
|
+
currentA = aOut;
|
|
347
|
+
}
|
|
348
|
+
currentDuration = currentDuration + next.duration - transition.duration;
|
|
349
|
+
}
|
|
350
|
+
return { vLabel: currentV, aLabel: currentA, duration: currentDuration };
|
|
351
|
+
}
|
|
352
|
+
function codecArgs(withAudio, state) {
|
|
353
|
+
const format = getExportFormat(state);
|
|
354
|
+
const args = format === "mxf" ? ["-c:v", "mpeg2video", "-pix_fmt", "yuv422p"] : ["-c:v", "libx264", "-preset", "veryfast", "-pix_fmt", "yuv420p", "-movflags", "+faststart"];
|
|
355
|
+
const videoBitrateKbps = getExportVideoBitrateKbps(state);
|
|
356
|
+
if (videoBitrateKbps > 0) {
|
|
357
|
+
args.push("-b:v", `${videoBitrateKbps}k`, "-maxrate", `${videoBitrateKbps}k`, "-bufsize", `${Math.max(videoBitrateKbps * 2, 512)}k`);
|
|
358
|
+
} else if (format === "mxf") {
|
|
359
|
+
args.push("-q:v", "2");
|
|
360
|
+
}
|
|
361
|
+
if (withAudio) {
|
|
362
|
+
if (format === "mxf") {
|
|
363
|
+
args.push("-c:a", "pcm_s16le");
|
|
364
|
+
} else {
|
|
365
|
+
args.push("-c:a", getExportAudioCodec(state));
|
|
366
|
+
const audioBitrateKbps = getExportAudioBitrateKbps(state);
|
|
367
|
+
if (audioBitrateKbps > 0) args.push("-b:a", `${audioBitrateKbps}k`);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (format === "mxf") args.push("-f", "mxf");
|
|
371
|
+
return args;
|
|
372
|
+
}
|
|
373
|
+
var AFORMAT = "aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo";
|
|
374
|
+
var ANULL = "anullsrc=r=44100:cl=stereo";
|
|
375
|
+
function declick(dur) {
|
|
376
|
+
if (!(dur > 0.02)) return "";
|
|
377
|
+
const st = Math.round((dur - 0.01) * 1e3) / 1e3;
|
|
378
|
+
return `,afade=t=in:st=0:d=0.01,afade=t=out:st=${st}:d=0.01`;
|
|
379
|
+
}
|
|
380
|
+
var LIMITER = "alimiter=limit=0.95:level=disabled:latency=1";
|
|
381
|
+
var DEFAULT_TIMED_EFFECT_DURATION = 3;
|
|
382
|
+
var MIN_TIMED_EFFECT_DURATION = 0.5;
|
|
383
|
+
function evenFloor(value, min = 0) {
|
|
384
|
+
const next = Math.max(min, Math.floor(Number(value) || 0));
|
|
385
|
+
return next % 2 === 0 ? next : next - 1;
|
|
386
|
+
}
|
|
387
|
+
function normalizeTimedOverlayWindow(overlay) {
|
|
388
|
+
const startAt = Number.isFinite(overlay?.startAt) ? Math.max(0, Number(overlay.startAt)) : 0;
|
|
389
|
+
const explicitEnd = Number(overlay?.endAt);
|
|
390
|
+
if (Number.isFinite(explicitEnd)) {
|
|
391
|
+
return {
|
|
392
|
+
startAt,
|
|
393
|
+
endAt: Math.max(startAt + MIN_TIMED_EFFECT_DURATION, explicitEnd)
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
return {
|
|
397
|
+
startAt,
|
|
398
|
+
endAt: startAt + DEFAULT_TIMED_EFFECT_DURATION
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function normalizeEffectOverlayRect(_overlay, bounds) {
|
|
402
|
+
const w = Math.max(2, evenFloor(bounds.w, 2));
|
|
403
|
+
const h = Math.max(2, evenFloor(bounds.h, 2));
|
|
404
|
+
if (!(w > 1) || !(h > 1)) return null;
|
|
405
|
+
return { x: 0, y: 0, w, h };
|
|
406
|
+
}
|
|
407
|
+
function buildEffectOverlayFilters(overlay) {
|
|
408
|
+
if (overlay?.type === "filter") {
|
|
409
|
+
const preset = findFilterPreset(overlay.filterPreset);
|
|
410
|
+
return preset ? [preset.vf] : [];
|
|
411
|
+
}
|
|
412
|
+
if (overlay?.type !== "adjust") return [];
|
|
413
|
+
const filters = [];
|
|
414
|
+
const eq = eqFilter(overlay);
|
|
415
|
+
if (eq) filters.push(eq);
|
|
416
|
+
const colorBalance = colorBalanceFilter(overlay);
|
|
417
|
+
if (colorBalance) filters.push(colorBalance);
|
|
418
|
+
const vibrance = vibranceFilter(overlay);
|
|
419
|
+
if (vibrance) filters.push(vibrance);
|
|
420
|
+
const toneCurve = toneCurveFilter(overlay);
|
|
421
|
+
if (toneCurve) filters.push(toneCurve);
|
|
422
|
+
filters.push(...detailFilters(overlay));
|
|
423
|
+
const grain = grainFilter(overlay);
|
|
424
|
+
if (grain) filters.push(grain);
|
|
425
|
+
const vignette = vignetteFilter(overlay);
|
|
426
|
+
if (vignette) filters.push(vignette);
|
|
427
|
+
return filters;
|
|
428
|
+
}
|
|
429
|
+
function listEffectOverlays(overlays, bounds) {
|
|
430
|
+
const next = [];
|
|
431
|
+
for (const overlay of overlays ?? []) {
|
|
432
|
+
if (overlay?.type !== "filter" && overlay?.type !== "adjust") continue;
|
|
433
|
+
const rect = normalizeEffectOverlayRect(overlay, bounds);
|
|
434
|
+
if (!rect) continue;
|
|
435
|
+
const filters = buildEffectOverlayFilters(overlay);
|
|
436
|
+
if (!filters.length) continue;
|
|
437
|
+
next.push({
|
|
438
|
+
rect,
|
|
439
|
+
filters,
|
|
440
|
+
...normalizeTimedOverlayWindow(overlay)
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
return next;
|
|
444
|
+
}
|
|
445
|
+
function listTimedTextOverlayWindows(overlays, maxCount = Infinity) {
|
|
446
|
+
const next = [];
|
|
447
|
+
for (const overlay of overlays ?? []) {
|
|
448
|
+
if (overlay?.type !== "pen" && overlay?.type !== "line" && overlay?.type !== "arrow" && overlay?.type !== "rect" && overlay?.type !== "ellipse" && overlay?.type !== "text" && overlay?.type !== "sticker") continue;
|
|
449
|
+
const startAt = Number(overlay.startAt);
|
|
450
|
+
const endAt = Number(overlay.endAt);
|
|
451
|
+
if (!Number.isFinite(startAt) || !Number.isFinite(endAt) || endAt <= startAt) continue;
|
|
452
|
+
next.push({
|
|
453
|
+
startAt: Math.max(0, startAt),
|
|
454
|
+
endAt: Math.max(startAt + 0.01, endAt)
|
|
455
|
+
});
|
|
456
|
+
if (next.length >= maxCount) break;
|
|
457
|
+
}
|
|
458
|
+
return next;
|
|
459
|
+
}
|
|
460
|
+
function appendTimedTextOverlayFilters(parts, baseLabel, inputIndexStart, overlayWindows) {
|
|
461
|
+
let vLabel = baseLabel;
|
|
462
|
+
overlayWindows.forEach((overlay, index) => {
|
|
463
|
+
const nextLabel = `[vtxt${inputIndexStart + index}]`;
|
|
464
|
+
parts.push(
|
|
465
|
+
`${vLabel}[${inputIndexStart + index}:v]overlay=0:0:enable='between(t,${overlay.startAt.toFixed(3)},${overlay.endAt.toFixed(3)})'${nextLabel}`
|
|
466
|
+
);
|
|
467
|
+
vLabel = nextLabel;
|
|
468
|
+
});
|
|
469
|
+
return vLabel;
|
|
470
|
+
}
|
|
471
|
+
function appendEffectOverlayFilters(parts, baseLabel, overlays) {
|
|
472
|
+
let vLabel = baseLabel;
|
|
473
|
+
overlays.forEach((overlay, index) => {
|
|
474
|
+
const srcLabel = `[vfxsrc${index}]`;
|
|
475
|
+
const baseSplitLabel = `[vfxbase${index}]`;
|
|
476
|
+
const cropLabel = `[vfxcrop${index}]`;
|
|
477
|
+
const nextLabel = `[vfx${index}]`;
|
|
478
|
+
const { rect } = overlay;
|
|
479
|
+
parts.push(`${vLabel}split=2${srcLabel}${baseSplitLabel}`);
|
|
480
|
+
parts.push(`${srcLabel}crop=${rect.w}:${rect.h}:${rect.x}:${rect.y},${overlay.filters.join(",")}${cropLabel}`);
|
|
481
|
+
parts.push(
|
|
482
|
+
`${baseSplitLabel}${cropLabel}overlay=${rect.x}:${rect.y}:enable='between(t,${overlay.startAt.toFixed(3)},${overlay.endAt.toFixed(3)})'${nextLabel}`
|
|
483
|
+
);
|
|
484
|
+
vLabel = nextLabel;
|
|
485
|
+
});
|
|
486
|
+
return vLabel;
|
|
487
|
+
}
|
|
488
|
+
function buildSingleSourceArgs(state, input, output, overlayInput, hasAudio, textOverlayPaths = []) {
|
|
489
|
+
const vf = buildVideoFilters(state, { includeExportScale: false });
|
|
490
|
+
const clips = state.clips;
|
|
491
|
+
const keepAudio = state.keepAudio && hasAudio;
|
|
492
|
+
const multi = clips.length >= 2;
|
|
493
|
+
const effectOverlays = listEffectOverlays(state.overlays, getProjectOutputSize(state));
|
|
494
|
+
const timedTextOverlays = listTimedTextOverlayWindows(state.overlays, textOverlayPaths.length);
|
|
495
|
+
const activeTextOverlayPaths = textOverlayPaths.slice(0, timedTextOverlays.length);
|
|
496
|
+
if (multi || overlayInput || activeTextOverlayPaths.length || effectOverlays.length) {
|
|
497
|
+
const parts = [];
|
|
498
|
+
let vLabel;
|
|
499
|
+
if (multi) {
|
|
500
|
+
clips.forEach((c, i) => {
|
|
501
|
+
parts.push(`[0:v]trim=start=${c.in}:end=${c.out},setpts=PTS-STARTPTS[v${i}]`);
|
|
502
|
+
if (keepAudio) {
|
|
503
|
+
parts.push(`[0:a]atrim=start=${c.in}:end=${c.out},asetpts=PTS-STARTPTS${declick(c.out - c.in)}[a${i}]`);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
const concatInputs = clips.map((_, i) => keepAudio ? `[v${i}][a${i}]` : `[v${i}]`).join("");
|
|
507
|
+
const concatOuts = keepAudio ? "[vcat][acat]" : "[vcat]";
|
|
508
|
+
parts.push(`${concatInputs}concat=n=${clips.length}:v=1:a=${keepAudio ? 1 : 0}${concatOuts}`);
|
|
509
|
+
vLabel = "[vcat]";
|
|
510
|
+
} else {
|
|
511
|
+
vLabel = "[0:v]";
|
|
512
|
+
}
|
|
513
|
+
if (vf.length) {
|
|
514
|
+
parts.push(`${vLabel}${vf.join(",")}[vflt]`);
|
|
515
|
+
vLabel = "[vflt]";
|
|
516
|
+
}
|
|
517
|
+
if (effectOverlays.length) {
|
|
518
|
+
vLabel = appendEffectOverlayFilters(parts, vLabel, effectOverlays);
|
|
519
|
+
}
|
|
520
|
+
if (overlayInput) {
|
|
521
|
+
parts.push(`${vLabel}[1:v]overlay=0:0[vout]`);
|
|
522
|
+
vLabel = "[vout]";
|
|
523
|
+
} else if (vLabel === "[0:v]") {
|
|
524
|
+
parts.push(`[0:v]null[vout]`);
|
|
525
|
+
vLabel = "[vout]";
|
|
526
|
+
}
|
|
527
|
+
if (activeTextOverlayPaths.length) {
|
|
528
|
+
const textInputStart = 1 + (overlayInput ? 1 : 0);
|
|
529
|
+
vLabel = appendTimedTextOverlayFilters(parts, vLabel, textInputStart, timedTextOverlays);
|
|
530
|
+
}
|
|
531
|
+
const exportScaleFilters = buildExportScaleFilters(state);
|
|
532
|
+
if (exportScaleFilters.length) {
|
|
533
|
+
parts.push(`${vLabel}${exportScaleFilters.join(",")}[vscaled]`);
|
|
534
|
+
vLabel = "[vscaled]";
|
|
535
|
+
}
|
|
536
|
+
const pre2 = [];
|
|
537
|
+
if (!multi && clips.length === 1) {
|
|
538
|
+
pre2.push("-ss", String(clips[0].in), "-t", String(clips[0].out - clips[0].in));
|
|
539
|
+
}
|
|
540
|
+
const args2 = ["-y", ...pre2, "-i", input];
|
|
541
|
+
if (overlayInput) args2.push("-i", overlayInput);
|
|
542
|
+
for (const textOverlayPath of activeTextOverlayPaths) args2.push("-i", textOverlayPath);
|
|
543
|
+
args2.push("-filter_complex", parts.join(";"), "-map", vLabel);
|
|
544
|
+
if (keepAudio) args2.push("-map", multi ? "[acat]" : "0:a?");
|
|
545
|
+
args2.push(...codecArgs(keepAudio, state));
|
|
546
|
+
args2.push(output);
|
|
547
|
+
return args2;
|
|
548
|
+
}
|
|
549
|
+
const fullVf = buildVideoFilters(state);
|
|
550
|
+
const pre = ["-ss", String(clips[0].in), "-t", String(clips[0].out - clips[0].in)];
|
|
551
|
+
const args = ["-y", ...pre, "-i", input];
|
|
552
|
+
if (fullVf.length) args.push("-vf", fullVf.join(","));
|
|
553
|
+
if (!keepAudio) args.push("-an");
|
|
554
|
+
args.push(...codecArgs(keepAudio, state));
|
|
555
|
+
args.push(output);
|
|
556
|
+
return args;
|
|
557
|
+
}
|
|
558
|
+
function buildFfmpegArgs(state, io, output) {
|
|
559
|
+
const { videoPaths, videoHasAudio, audioPaths, overlayPath, textOverlayPaths = [] } = io;
|
|
560
|
+
const music = state.audioClips ?? [];
|
|
561
|
+
const activeTransitions = hasActiveTransitions(state.transitions, state.clips);
|
|
562
|
+
const timedTextOverlays = listTimedTextOverlayWindows(state.overlays, textOverlayPaths.length);
|
|
563
|
+
const activeTextOverlayPaths = textOverlayPaths.slice(0, timedTextOverlays.length);
|
|
564
|
+
if (videoPaths.length === 1 && music.length === 0 && !activeTransitions) {
|
|
565
|
+
return buildSingleSourceArgs(state, videoPaths[0], output, overlayPath, videoHasAudio[0] ?? false, activeTextOverlayPaths);
|
|
566
|
+
}
|
|
567
|
+
const N = videoPaths.length;
|
|
568
|
+
const M = audioPaths.length;
|
|
569
|
+
const cw = state.canvas.w;
|
|
570
|
+
const ch = state.canvas.h;
|
|
571
|
+
const clips = state.clips;
|
|
572
|
+
const keepAudio = state.keepAudio && clips.some((c) => videoHasAudio[c.srcIdx]);
|
|
573
|
+
const frameRate = getExportFrameRate(state);
|
|
574
|
+
const total = clips.reduce((s, c) => s + (c.out - c.in), 0);
|
|
575
|
+
const parts = [];
|
|
576
|
+
clips.forEach((c, i) => {
|
|
577
|
+
parts.push(
|
|
578
|
+
`[${c.srcIdx}:v]trim=start=${c.in}:end=${c.out},setpts=PTS-STARTPTS,scale=${cw}:${ch}:force_original_aspect_ratio=increase,crop=${cw}:${ch},setsar=1,fps=${frameRate},format=yuv420p[v${i}]`
|
|
579
|
+
);
|
|
580
|
+
if (keepAudio) {
|
|
581
|
+
if (videoHasAudio[c.srcIdx]) {
|
|
582
|
+
parts.push(
|
|
583
|
+
`[${c.srcIdx}:a]atrim=start=${c.in}:end=${c.out},asetpts=PTS-STARTPTS${declick(c.out - c.in)},${AFORMAT}[a${i}]`
|
|
584
|
+
);
|
|
585
|
+
} else {
|
|
586
|
+
parts.push(`${ANULL},atrim=start=0:end=${c.out - c.in},asetpts=PTS-STARTPTS,${AFORMAT}[a${i}]`);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
let vLabel = "[vcat]";
|
|
591
|
+
let aLabel = keepAudio ? "[acat]" : "";
|
|
592
|
+
let effectiveTotal = total;
|
|
593
|
+
if (activeTransitions) {
|
|
594
|
+
const timeline = buildTransitionTimeline(parts, clips, state.transitions ?? [], keepAudio);
|
|
595
|
+
vLabel = timeline.vLabel;
|
|
596
|
+
aLabel = keepAudio ? timeline.aLabel : "";
|
|
597
|
+
effectiveTotal = timeline.duration;
|
|
598
|
+
} else {
|
|
599
|
+
const concatInputs = clips.map((_, i) => keepAudio ? `[v${i}][a${i}]` : `[v${i}]`).join("");
|
|
600
|
+
parts.push(`${concatInputs}concat=n=${clips.length}:v=1:a=${keepAudio ? 1 : 0}${keepAudio ? "[vcat][acat]" : "[vcat]"}`);
|
|
601
|
+
}
|
|
602
|
+
if (!keepAudio && music.length) {
|
|
603
|
+
parts.push(`${ANULL},atrim=start=0:end=${effectiveTotal},asetpts=PTS-STARTPTS,${AFORMAT}[acat]`);
|
|
604
|
+
aLabel = "[acat]";
|
|
605
|
+
}
|
|
606
|
+
if (music.length) {
|
|
607
|
+
music.forEach((a, j) => {
|
|
608
|
+
const ms = Math.max(0, Math.round(a.startAt * 1e3));
|
|
609
|
+
const clipDuration = Math.max(0, a.out - a.in);
|
|
610
|
+
const speed = clampAudioSpeed(a.speed);
|
|
611
|
+
const fadeIn = Math.min(Math.max(Number(a.fadeIn) || 0, 0), clipDuration);
|
|
612
|
+
const fadeOut = Math.min(
|
|
613
|
+
Math.max(Number(a.fadeOut) || 0, 0),
|
|
614
|
+
Math.max(0, clipDuration - fadeIn)
|
|
615
|
+
);
|
|
616
|
+
const audioFilters = [
|
|
617
|
+
`atrim=start=${a.in}:end=${a.out}`,
|
|
618
|
+
"asetpts=PTS-STARTPTS",
|
|
619
|
+
...buildAudioTempoFilters(speed),
|
|
620
|
+
`volume=${a.volume}`
|
|
621
|
+
];
|
|
622
|
+
if (fadeIn > 1e-4) {
|
|
623
|
+
audioFilters.push(`afade=t=in:st=0:d=${fadeIn}`);
|
|
624
|
+
}
|
|
625
|
+
if (fadeOut > 1e-4) {
|
|
626
|
+
audioFilters.push(
|
|
627
|
+
`afade=t=out:st=${Math.max(0, clipDuration - fadeOut)}:d=${fadeOut}`
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
audioFilters.push(AFORMAT, `adelay=${ms}|${ms}`);
|
|
631
|
+
parts.push(
|
|
632
|
+
`[${N + j}:a]${audioFilters.join(",")}[mu${j}]`
|
|
633
|
+
);
|
|
634
|
+
});
|
|
635
|
+
const mixInputs = `${aLabel}${music.map((_, j) => `[mu${j}]`).join("")}`;
|
|
636
|
+
parts.push(
|
|
637
|
+
`${mixInputs}amix=inputs=${1 + music.length}:duration=first:dropout_transition=0:normalize=0,${LIMITER}[aout]`
|
|
638
|
+
);
|
|
639
|
+
aLabel = "[aout]";
|
|
640
|
+
}
|
|
641
|
+
const vf = buildVideoFilters(state, { includeExportScale: false });
|
|
642
|
+
const effectOverlays = listEffectOverlays(state.overlays, getProjectOutputSize(state));
|
|
643
|
+
if (vf.length) {
|
|
644
|
+
parts.push(`${vLabel}${vf.join(",")}[vflt]`);
|
|
645
|
+
vLabel = "[vflt]";
|
|
646
|
+
}
|
|
647
|
+
if (effectOverlays.length) {
|
|
648
|
+
vLabel = appendEffectOverlayFilters(parts, vLabel, effectOverlays);
|
|
649
|
+
}
|
|
650
|
+
if (overlayPath) {
|
|
651
|
+
parts.push(`${vLabel}[${N + M}:v]overlay=0:0[vout]`);
|
|
652
|
+
vLabel = "[vout]";
|
|
653
|
+
}
|
|
654
|
+
if (activeTextOverlayPaths.length) {
|
|
655
|
+
const textInputStart = N + M + (overlayPath ? 1 : 0);
|
|
656
|
+
vLabel = appendTimedTextOverlayFilters(parts, vLabel, textInputStart, timedTextOverlays);
|
|
657
|
+
}
|
|
658
|
+
const exportScaleFilters = buildExportScaleFilters(state);
|
|
659
|
+
if (exportScaleFilters.length) {
|
|
660
|
+
parts.push(`${vLabel}${exportScaleFilters.join(",")}[vscaled]`);
|
|
661
|
+
vLabel = "[vscaled]";
|
|
662
|
+
}
|
|
663
|
+
const args = ["-y"];
|
|
664
|
+
for (const p of videoPaths) args.push("-i", p);
|
|
665
|
+
for (const p of audioPaths) args.push("-i", p);
|
|
666
|
+
if (overlayPath) args.push("-i", overlayPath);
|
|
667
|
+
for (const textOverlayPath of activeTextOverlayPaths) args.push("-i", textOverlayPath);
|
|
668
|
+
args.push("-filter_complex", parts.join(";"), "-map", vLabel);
|
|
669
|
+
const withAudio = !!aLabel;
|
|
670
|
+
if (withAudio) args.push("-map", aLabel);
|
|
671
|
+
args.push(...codecArgs(withAudio, state));
|
|
672
|
+
if (withAudio) args.push("-ar", "44100", "-ac", "2");
|
|
673
|
+
args.push(output);
|
|
674
|
+
return args;
|
|
675
|
+
}
|
|
676
|
+
function buildPosterArgs(input, time, output) {
|
|
677
|
+
return ["-y", "-ss", String(time), "-i", input, "-frames:v", "1", "-q:v", "2", output];
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export { buildFfmpegArgs, buildPosterArgs };
|
|
681
|
+
//# sourceMappingURL=index.js.map
|
|
682
|
+
//# sourceMappingURL=index.js.map
|