@bylqwjc/media-editor-server 1.0.27 → 1.0.30
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/core/dist/browser.cjs +1 -1
- package/core/dist/browser.d.ts +4 -21
- package/core/dist/browser.js +1 -1
- package/core/dist/chunk-MGKYVYOH.js +1 -0
- package/core/dist/chunk-USY6UDGL.js +1 -0
- package/core/dist/chunk-XCBM7P7N.js +1 -0
- package/core/dist/engine.cjs +1 -1
- package/core/dist/engine.d.ts +344 -648
- package/core/dist/engine.js +1 -1
- package/core/dist/filerobot.cjs +1 -1
- package/core/dist/filerobot.d.ts +1 -1
- package/core/dist/filerobot.js +1 -1
- package/core/dist/index.cjs +1 -1
- package/core/dist/index.d.ts +27 -13
- package/core/dist/index.js +1 -1
- package/core/dist/{platform-presets-Ca2LbKQ3.d.ts → platform-presets-B-o4C6uY.d.ts} +1 -1
- package/core/dist/state-B85vkf7_.d.ts +1027 -0
- package/core/package.json +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/core/dist/chunk-7D4QE3R2.js +0 -1
- package/core/dist/chunk-7PSQLYXL.js +0 -1
- package/core/dist/chunk-FAFKY4LX.js +0 -1
- package/core/dist/chunk-VDEZTXEA.js +0 -1
- package/core/dist/state-D2oM5s1a.d.ts +0 -2098
package/core/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { A as AudioClipT, C as ClipT, V as VideoEditStateT } from './state-
|
|
2
|
-
export { a as AudioClip, b as Clip,
|
|
3
|
-
export { D as DEFAULT_PLATFORM_TARGETS, a as EDITOR_MESSAGES, E as EditorLocale, I as IMAGE_PLATFORM_PRESETS, b as IMAGE_RATIO_PRESETS, P as PlatformPreset, c as PlatformTarget, R as RatioPreset, S as SizePreset, V as VIDEO_PLATFORM_RATIO_PRESETS, d as VIDEO_RATIO_PRESETS, e as VIDEO_SIZE_PRESETS, f as VideoPlatformRatioPreset, g as buildImagePlatformPresets, h as buildVideoPlatformRatioPresets, i as buildVideoSizePresets, p as parseRatio, t as tEditor, j as toHant } from './platform-presets-
|
|
1
|
+
import { A as AudioClipT, C as ClipT, V as VideoEditStateT } from './state-B85vkf7_.js';
|
|
2
|
+
export { a as AudioClip, b as Clip, c as Overlay, O as OverlayT, d as VideoEditState, e as defaultVideoEditState } from './state-B85vkf7_.js';
|
|
3
|
+
export { D as DEFAULT_PLATFORM_TARGETS, a as EDITOR_MESSAGES, E as EditorLocale, I as IMAGE_PLATFORM_PRESETS, b as IMAGE_RATIO_PRESETS, P as PlatformPreset, c as PlatformTarget, R as RatioPreset, S as SizePreset, V as VIDEO_PLATFORM_RATIO_PRESETS, d as VIDEO_RATIO_PRESETS, e as VIDEO_SIZE_PRESETS, f as VideoPlatformRatioPreset, g as buildImagePlatformPresets, h as buildVideoPlatformRatioPresets, i as buildVideoSizePresets, p as parseRatio, t as tEditor, j as toHant } from './platform-presets-B-o4C6uY.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
|
+
type TransitionT = {
|
|
7
|
+
type: 'none' | 'fade' | 'slide' | 'wipe' | 'flip' | 'clockWipe' | 'star' | 'circle' | 'rectangle';
|
|
8
|
+
duration: number;
|
|
9
|
+
};
|
|
10
|
+
type VideoEditStateWithTransitions = VideoEditStateT & {
|
|
11
|
+
transitions?: TransitionT[];
|
|
12
|
+
};
|
|
13
|
+
|
|
6
14
|
/**
|
|
7
15
|
* editor-core/timeline v2 —— 输出时间轴纯函数(多素材 clips/audioClips 操作)。
|
|
8
16
|
* 从 UI 抽出,Vue/React 壳共用;全部不可变(返回新数组)。
|
|
@@ -78,14 +86,12 @@ interface FfmpegIo {
|
|
|
78
86
|
/** index 与 audioClip.srcIdx 对齐 */
|
|
79
87
|
audioPaths: string[];
|
|
80
88
|
overlayPath?: string;
|
|
81
|
-
textOverlayPaths?: string[];
|
|
82
|
-
overlayLayerPaths?: string[];
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
85
91
|
* v2 主入口:多视频源 concat + 音乐 amix + 全局链 + overlay。
|
|
86
92
|
* 输入序:视频 0..N-1 → 音乐 N..N+M-1 → overlay N+M。
|
|
87
93
|
*/
|
|
88
|
-
declare function buildFfmpegArgs(state:
|
|
94
|
+
declare function buildFfmpegArgs(state: VideoEditStateWithTransitions, io: FfmpegIo, output: string): string[];
|
|
89
95
|
/** 封面帧:在 time 处抽 1 帧 jpg */
|
|
90
96
|
declare function buildPosterArgs(input: string, time: number, output: string): string[];
|
|
91
97
|
|
|
@@ -197,12 +203,20 @@ declare function buildFilterCss(filters: {
|
|
|
197
203
|
brightness: number;
|
|
198
204
|
contrast: number;
|
|
199
205
|
saturation: number;
|
|
200
|
-
temperature
|
|
201
|
-
tint
|
|
202
|
-
vibrance
|
|
203
|
-
gamma
|
|
204
|
-
|
|
205
|
-
|
|
206
|
+
temperature: number;
|
|
207
|
+
tint: number;
|
|
208
|
+
vibrance: number;
|
|
209
|
+
gamma: number;
|
|
210
|
+
highlights: number;
|
|
211
|
+
shadows: number;
|
|
212
|
+
whites: number;
|
|
213
|
+
blacks: number;
|
|
214
|
+
lightSense: number;
|
|
215
|
+
sharpen: number;
|
|
216
|
+
clarity: number;
|
|
217
|
+
grain: number;
|
|
218
|
+
fade: number;
|
|
219
|
+
vignette: number;
|
|
206
220
|
}, presetId?: string): string;
|
|
207
221
|
|
|
208
222
|
/**
|
|
@@ -247,4 +261,4 @@ declare function compensateAnnotationRotation(ann: {
|
|
|
247
261
|
rotation?: number;
|
|
248
262
|
};
|
|
249
263
|
|
|
250
|
-
export { AudioClipT, ClipT, DEG2RAD, FILTER_PRESETS, type FfmpegIo, type FilterPreset, type FitMode, type History, MIN_CLIP, VideoEditStateT, buildFfmpegArgs, buildFilterCss, buildPosterArgs, canRedo, canUndo, centeredMaxRect, clampAudioClip, clampRect, clipDuration, clipStartsAt, compensateAnnotationRotation, contentDuration, createHistory, duplicateClip, evenize, findFilterPreset, fitRects, locateOutput, normalizeDeg, outputSize, pushHistory, redo, remapSrcIndices, removeClip, reorderClips, replacePresent, rotatedSize, splitAtOutput, totalDuration, trimClipEdge, undo, usedVideoSrcIndices };
|
|
264
|
+
export { AudioClipT, ClipT, DEG2RAD, FILTER_PRESETS, type FfmpegIo, type FilterPreset, type FitMode, type History, MIN_CLIP, TransitionT, VideoEditStateT, VideoEditStateWithTransitions, buildFfmpegArgs, buildFilterCss, buildPosterArgs, canRedo, canUndo, centeredMaxRect, clampAudioClip, clampRect, clipDuration, clipStartsAt, compensateAnnotationRotation, contentDuration, createHistory, duplicateClip, evenize, findFilterPreset, fitRects, locateOutput, normalizeDeg, outputSize, pushHistory, redo, remapSrcIndices, removeClip, reorderClips, replacePresent, rotatedSize, splitAtOutput, totalDuration, trimClipEdge, undo, usedVideoSrcIndices };
|
package/core/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{outputSize as t,isOverlayHidden as e,findFilterPreset as n,normalizeDeg as s,overlayLayerRenderOrder as o}from"./chunk-VDEZTXEA.js";export{DEG2RAD,FILTER_PRESETS,buildFilterCss,centeredMaxRect,clampRect,evenize,findFilterPreset,fitRects,normalizeDeg,outputSize,rotatedSize}from"./chunk-VDEZTXEA.js";export{MIN_CLIP,canRedo,canUndo,clampAudioClip,clipDuration,clipStartsAt,contentDuration,createHistory,duplicateClip,locateOutput,pushHistory,redo,remapSrcIndices,removeClip,reorderClips,replacePresent,splitAtOutput,totalDuration,trimClipEdge,undo,usedVideoSrcIndices}from"./chunk-7D4QE3R2.js";import{DEFAULT_FILTERS as a}from"./chunk-7PSQLYXL.js";export{AudioClip,Clip,DEFAULT_FILTERS,ExportSettings,Overlay,Transition,VideoEditState,defaultVideoEditState}from"./chunk-7PSQLYXL.js";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-FAFKY4LX.js";function r(t,e,n,s){const o=Math.round(Number(t));return Number.isFinite(o)?Math.min(n,Math.max(e,o)):s}function i(t,e){const n=r(t,2,8192,e);return n%2==0?n:n-1}function u(t){return t.exportSettings??void 0}function c(t){return r(u(t)?.frameRate,12,120,30)}function h(e){const n=t(e.canvas,e),s=function(e){const n=t(e.canvas,e),s=u(e);if(!s)return n;const o=Number.isFinite(Number(s.width))&&Number(s.width)>0,a=Number.isFinite(Number(s.height))&&Number(s.height)>0;if(!o&&!a)return n;const r=n.w>0&&n.h>0?n.w/n.h:1;if(o&&a)return{w:i(s.width,n.w),h:i(s.height,n.h)};if(o){const t=i(s.width,n.w);return{w:t,h:i(t/r,n.h)}}const c=i(s.height,n.h);return{w:i(c*r,n.w),h:c}}(e);return s.w===n.w&&s.h===n.h?[]:[`scale=${s.w}:${s.h}`]}function l(t){const{brightness:e,contrast:n,saturation:s}=t,o=t.gamma??0,a=t.temperature??0,r=t.tint??0,i=t.vibrance??0,u=t.highlights??0,c=t.shadows??0,h=t.whites??0,l=t.blacks??0,p=t.lightSense??0;if(0===e&&0===n&&0===s&&0===o&&0===a&&0===r&&0===i&&0===u&&0===c&&0===h&&0===l&&0===p)return null;const $=[],f=e+.08*u+.06*c+.05*h-.05*l+.08*p,m=n+.08*h+.08*l,d=s+.65*i;0!==f&&$.push(`brightness=${f.toFixed(3)}`),0!==m&&$.push(`contrast=${(1+m).toFixed(3)}`),0!==d&&$.push(`saturation=${(1+d).toFixed(3)}`),0!==o&&$.push(`gamma=${(1+o*(o>0?1:.5)).toFixed(3)}`);const v=$.length?[`eq=${$.join(":")}`]:[];return 0===a&&0===r||v.push(`colorbalance=rs=${(.18*a+.08*r).toFixed(3)}:gs=${(.02*a-.04*r).toFixed(3)}:bs=${(.18*-a-.08*r).toFixed(3)}`),v.join(",")}function p(t){return Boolean(t.hidden)}function $(t,e,n,s,o,a){return p(e)?`color=c=black:s=${s}x${o}:r=${a}:d=${Math.max(.001,e.out-e.in)},setsar=1,format=yuv420p[v${n}]`:`[${t}:v]trim=start=${e.in}:end=${e.out},setpts=PTS-STARTPTS,scale=${s}:${o}:force_original_aspect_ratio=increase,crop=${s}:${o},setsar=1,fps=${a},format=yuv420p[v${n}]`}function f(t,e={}){const o=[];if(t.flipX&&o.push("hflip"),t.flipY&&o.push("vflip"),o.push(...function(t){const e=s(t);if(0===e)return[];if(90===e)return["transpose=1"];if(180===e)return["transpose=1","transpose=1"];if(270===e)return["transpose=2"];const n=`${e}*PI/180`;return[`rotate=${n}:ow=rotw(${n}):oh=roth(${n}):c=black`]}(t.rotation)),t.crop){const{x:e,y:n,width:s,height:a}=t.crop;o.push(`crop=${s}:${a}:${e}:${n}`)}if(t.scale){const{width:e,height:n,fit:s}=t.scale;"force"===s?o.push(`scale=${e}:${n}`):"cover"===s?o.push(`scale=${e}:${n}:force_original_aspect_ratio=increase`,`crop=${e}:${n}`):o.push(`scale=${e}:${n}:force_original_aspect_ratio=decrease`,`pad=${e}:${n}:(ow-iw)/2:(oh-ih)/2:${function(t){if("string"!=typeof t)return"0x000000";const e=t.trim(),n=e.match(/^#?([0-9a-fA-F]{3})$/);if(n)return`0x${n[1].split("").map(t=>t+t).join("").toLowerCase()}`;const s=e.match(/^#?([0-9a-fA-F]{6})$/);return s?`0x${s[1].toLowerCase()}`:"0x000000"}(t.scale.backgroundColor)}`)}const a=l(t.filters);a&&o.push(a);const r=n(t.filterPreset);return r&&o.push(r.vf),!1!==e.includeExportScale&&o.push(...h(t)),o.push(`fps=${c(t)}`),s(t.rotation)%90==0||t.scale||o.push("scale=trunc(iw/2)*2:trunc(ih/2)*2"),o}function m(t,e){const n=function(t){const e=String(u(t)?.format??"mp4").toLowerCase();return"mov"===e||"mxf"===e?e:"mp4"}(e),s="mxf"===n?["-c:v","mpeg2video","-pix_fmt","yuv422p"]:["-c:v","libx264","-preset","veryfast","-pix_fmt","yuv420p","-movflags","+faststart"],o=function(t){const e=Number(u(t)?.videoBitrateKbps);return Number.isFinite(e)&&e>=100?Math.round(e):0}(e);if(o>0?s.push("-b:v",`${o}k`,"-maxrate",`${o}k`,"-bufsize",`${Math.max(2*o,512)}k`):"mxf"===n&&s.push("-q:v","2"),t)if("mxf"===n)s.push("-c:a","pcm_s16le");else{s.push("-c:a",function(t){return"mp3"===u(t)?.audioCodec?"libmp3lame":"aac"}(e));const t=function(t){const e=Number(u(t)?.audioBitrateKbps);return Number.isFinite(e)&&e>=32?Math.round(e):0}(e);t>0&&s.push("-b:a",`${t}k`)}return"mxf"===n&&s.push("-f","mxf"),s}var d="aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo",v="anullsrc=r=44100:cl=stereo";function x(t){return t>.02?`,afade=t=in:st=0:d=0.01,afade=t=out:st=${Math.round(1e3*(t-.01))/1e3}:d=0.01`:""}function g(t,n=Number.POSITIVE_INFINITY){const s=[];for(const o of t??[]){if(e(o))continue;if("adjust"===o.type)continue;const t=Number(o.startAt),a=Number(o.endAt);if(Number.isFinite(t)&&Number.isFinite(a)&&!(a<=t)&&(s.push({startAt:Math.max(0,t),endAt:Math.max(t+.01,a)}),s.length>=n))break}return s}function b(t,e=2){const n=Math.max(e,Math.floor(Number(t)||e));return n%2==0?n:n-1}function S(t){const e=Number.isFinite(t.startAt)?Math.max(0,Number(t.startAt)):0,n=Number(t.endAt);return Number.isFinite(n)?{startAt:e,endAt:Math.max(e+.1,n)}:{startAt:e,endAt:e+3}}function A(t){const e=l({...a,...t}),s=n(t.filterPreset);return[e,s?.vf].filter(t=>Boolean(t))}function y(t,e){const n=Math.max(2,b(e.w)),s=Math.max(2,b(e.h)),o=Math.max(0,Math.min(n-2,b(t.x,0))),a=Math.max(0,Math.min(s-2,b(t.y,0))),r=Math.min(n-o,Math.max(2,b(t.w))),i=Math.min(s-a,Math.max(2,b(t.h)));return r<=1||i<=1?null:{x:o,y:a,w:r,h:i}}function T(t,n){const s=[];for(const o of t??[]){if(e(o))continue;if("adjust"!==o.type)continue;const t=y(o,n);if(!t)continue;const a=A(o);a.length&&s.push({rect:t,filters:a,...S(o)})}return s}function E(t,e,n,s){let o=e;return s.forEach((e,s)=>{const a=`[vtimed${n+s}]`;t.push(`${o}[${n+s}:v]overlay=0:0:enable='between(t,${e.startAt.toFixed(3)},${e.endAt.toFixed(3)})'${a}`),o=a}),o}function M(t,e,n){let s=e;return n.forEach((e,n)=>{const o=`[vadjsrc${n}]`,a=`[vadjbase${n}]`,r=`[vadjcrop${n}]`,i=`[vadj${n}]`,{rect:u}=e;t.push(`${s}split=2${o}${a}`),t.push(`${o}crop=${u.w}:${u.h}:${u.x}:${u.y},${e.filters.join(",")}${r}`),t.push(`${a}${r}overlay=${u.x}:${u.y}:enable='between(t,${e.startAt.toFixed(3)},${e.endAt.toFixed(3)})'${i}`),s=i}),s}function F(t){const e=Number(t.startAt),n=Number(t.endAt);return!Number.isFinite(e)||!Number.isFinite(n)||n<=e?"":`:enable='between(t,${Math.max(0,e).toFixed(3)},${Math.max(e+.01,n).toFixed(3)})'`}function P(t,e,n,s){const o=`[${s}src]`,a=`[${s}base]`,r=`[${s}crop]`,i=`[${s}]`,{rect:u}=n;return t.push(`${e}split=2${o}${a}`),t.push(`${o}crop=${u.w}:${u.h}:${u.x}:${u.y},${n.filters.join(",")}${r}`),t.push(`${a}${r}overlay=${u.x}:${u.y}:enable='between(t,${n.startAt.toFixed(3)},${n.endAt.toFixed(3)})'${i}`),i}function w(t,n,s,a,r,i,u){let c=n,h=0,l=0;for(const n of o(a??[])){if(e(n))continue;if("adjust"===n.type){const e=y(n,i),s=A(n);if(!e||!s.length)continue;c=P(t,c,{rect:e,filters:s,...S(n)},`v${u}adj${l}`),l++;continue}if(h>=r){h++;continue}const o=`[v${u}lay${h}]`;t.push(`${c}[${s+h}:v]overlay=0:0${F(n)}${o}`),c=o,h++}return c}function _(e,n,s){const{videoPaths:o,videoHasAudio:a,audioPaths:r,overlayPath:i,textOverlayPaths:u=[],overlayLayerPaths:l=[]}=n,b=(e.audioClips??[]).filter(t=>!t.muted),S=l.length>0,A=S?[]:g(e.overlays,u.length),y=S?[]:u.slice(0,A.length),F=S?l:[],P=S?[]:T(e.overlays,t(e.canvas,e));if(1===o.length&&0===b.length)return function(e,n,s,o,a,r=[],i=[]){const u=f(e,{includeExportScale:!1}),l=e.clips,d=e.keepAudio&&a,v=l.length>=2,b=l.some(p),S=c(e),A=i.length>0,y=A?[]:g(e.overlays,r.length),F=A?[]:r.slice(0,y.length),P=A?i:[],_=A?[]:T(e.overlays,t(e.canvas,e));if(v||b||o||F.length||P.length||_.length){const a=[];let r;if(v){l.forEach((t,n)=>{a.push($(0,t,n,e.canvas.w,e.canvas.h,S)),d&&a.push(`[0:a]atrim=start=${t.in}:end=${t.out},asetpts=PTS-STARTPTS${x(t.out-t.in)}[a${n}]`)});const t=l.map((t,e)=>d?`[v${e}][a${e}]`:`[v${e}]`).join(""),n=d?"[vcat][acat]":"[vcat]";a.push(`${t}concat=n=${l.length}:v=1:a=${d?1:0}${n}`),r="[vcat]"}else b?(a.push($(0,l[0],0,e.canvas.w,e.canvas.h,S)),r="[v0]"):r="[0:v]";u.length&&(a.push(`${r}${u.join(",")}[vflt]`),r="[vflt]"),P.length?(o&&(a.push(`${r}[1:v]overlay=0:0[vlegacy]`),r="[vlegacy]"),r=w(a,r,1+(o?1:0),e.overlays,P.length,t(e.canvas,e),"s")):_.length&&(r=M(a,r,_)),!P.length&&o?(a.push(`${r}[1:v]overlay=0:0[vout]`),r="[vout]"):"[0:v]"===r&&(a.push("[0:v]null[vout]"),r="[vout]"),F.length&&(r=E(a,r,1+(o?1:0),y));const i=h(e);i.length&&(a.push(`${r}${i.join(",")}[vscaled]`),r="[vscaled]");const c=[];v||1!==l.length||c.push("-ss",String(l[0].in),"-t",String(l[0].out-l[0].in));const p=["-y",...c,"-i",n];o&&p.push("-i",o);for(const t of P)p.push("-i",t);for(const t of F)p.push("-i",t);return p.push("-filter_complex",a.join(";"),"-map",r),d&&p.push("-map",v?"[acat]":"0:a?"),p.push(...m(d,e)),p.push(s),p}const R=["-ss",String(l[0].in),"-t",String(l[0].out-l[0].in)],j=f(e),I=["-y",...R,"-i",n];return j.length&&I.push("-vf",j.join(",")),d||I.push("-an"),I.push(...m(d,e)),I.push(s),I}(e,o[0],s,i,a[0]??!1,y,F);const _=o.length,R=r.length,j=e.canvas.w,I=e.canvas.h,N=e.clips,k=e.keepAudio&&N.some(t=>a[t.srcIdx]),L=c(e),O=N.reduce((t,e)=>t+(e.out-e.in),0),C=[];N.forEach((t,e)=>{C.push($(t.srcIdx,t,e,j,I,L)),k&&(a[t.srcIdx]?C.push(`[${t.srcIdx}:a]atrim=start=${t.in}:end=${t.out},asetpts=PTS-STARTPTS${x(t.out-t.in)},${d}[a${e}]`):C.push(`${v},atrim=start=0:end=${t.out-t.in},asetpts=PTS-STARTPTS,${d}[a${e}]`))});const D=N.map((t,e)=>k?`[v${e}][a${e}]`:`[v${e}]`).join("");C.push(`${D}concat=n=${N.length}:v=1:a=${k?1:0}${k?"[vcat][acat]":"[vcat]"}`);let V=k?"[acat]":"";if(!k&&b.length&&(C.push(`${v},atrim=start=0:end=${O},asetpts=PTS-STARTPTS,${d}[acat]`),V="[acat]"),b.length){b.forEach((t,e)=>{const n=Math.max(0,Math.round(1e3*t.startAt));C.push(function(t,e,n,s){const o=Math.min(2,Math.max(.5,e.speed??1)),a=function(t){return Math.max(.001,(t.out-t.in)/Math.max(.01,t.speed??1))}(e),r=Math.min(Math.max(0,e.fadeIn??0),a),i=Math.min(Math.max(0,e.fadeOut??0),a),u=[`atrim=start=${e.in}:end=${e.out}`,"asetpts=PTS-STARTPTS"];return Math.abs(o-1)>.001&&u.push(`atempo=${o.toFixed(3)}`),r>0&&u.push(`afade=t=in:st=0:d=${r.toFixed(3)}`),i>0&&u.push(`afade=t=out:st=${Math.max(0,a-i).toFixed(3)}:d=${i.toFixed(3)}`),u.push(`volume=${e.volume}`,d,`adelay=${n}|${n}`),`${t}${u.join(",")}[${s}]`}(`[${_+t.srcIdx}:a]`,t,n,`mu${e}`))});const t=`${V}${b.map((t,e)=>`[mu${e}]`).join("")}`;C.push(`${t}amix=inputs=${1+b.length}:duration=first:dropout_transition=0:normalize=0,alimiter=limit=0.95:level=disabled:latency=1[aout]`),V="[aout]"}let z="[vcat]";const X=f(e,{includeExportScale:!1});X.length&&(C.push(`${z}${X.join(",")}[vflt]`),z="[vflt]"),F.length?(i&&(C.push(`${z}[${_+R}:v]overlay=0:0[vlegacy]`),z="[vlegacy]"),z=w(C,z,_+R+(i?1:0),e.overlays,F.length,t(e.canvas,e),"m")):P.length&&(z=M(C,z,P)),!F.length&&i&&(C.push(`${z}[${_+R}:v]overlay=0:0[vout]`),z="[vout]"),y.length&&(z=E(C,z,_+R+(i?1:0),A));const G=h(e);G.length&&(C.push(`${z}${G.join(",")}[vscaled]`),z="[vscaled]");const Y=["-y"];for(const t of o)Y.push("-i",t);for(const t of r)Y.push("-i",t);i&&Y.push("-i",i);for(const t of F)Y.push("-i",t);for(const t of y)Y.push("-i",t);Y.push("-filter_complex",C.join(";"),"-map",z);const B=!!V;return B&&Y.push("-map",V),Y.push(...m(B,e)),B&&Y.push("-ar","44100","-ac","2"),Y.push(s),Y}function R(t,e,n){return["-y","-ss",String(e),"-i",t,"-frames:v","1","-q:v","2",n]}export{_ as buildFfmpegArgs,R as buildPosterArgs};
|
|
1
|
+
import{findFilterPreset as t,normalizeDeg as e,outputSize as s}from"./chunk-USY6UDGL.js";import{DEG2RAD as n,FILTER_PRESETS as a,buildFilterCss as r,centeredMaxRect as i,clampRect as o,evenize as u,findFilterPreset as c,fitRects as l,normalizeDeg as p,outputSize as h,rotatedSize as f}from"./chunk-USY6UDGL.js";import{AudioClip as d,Clip as $,MIN_CLIP as m,Overlay as v,VideoEditState as S,canRedo as g,canUndo as b,clampAudioClip as x,clipDuration as E,clipStartsAt as M,contentDuration as A,createHistory as T,defaultVideoEditState as P,duplicateClip as y,locateOutput as R,pushHistory as _,redo as w,remapSrcIndices as I,removeClip as F,reorderClips as N,replacePresent as O,splitAtOutput as L,totalDuration as D,trimClipEdge as j,undo as C,usedVideoSrcIndices as k}from"./chunk-MGKYVYOH.js";import{DEFAULT_PLATFORM_TARGETS as V,EDITOR_MESSAGES as z,IMAGE_PLATFORM_PRESETS as G,IMAGE_RATIO_PRESETS as H,VIDEO_PLATFORM_RATIO_PRESETS as U,VIDEO_RATIO_PRESETS as q,VIDEO_SIZE_PRESETS as Y,buildImagePlatformPresets as B,buildVideoPlatformRatioPresets as K,buildVideoSizePresets as W,compensateAnnotationRotation as X,parseRatio as Z,tEditor as J,toHant as Q}from"./chunk-XCBM7P7N.js";function tt(t){return Math.max(-1,Math.min(1,Number(t)||0))}function et(t){return Math.max(0,Math.min(1,Number(t)||0))}function st(t,e,s,n){const a=Math.round(Number(t));return Number.isFinite(a)?Math.min(s,Math.max(e,a)):n}function nt(t){return Math.min(Math.max(Number(t)||1,.5),2)}function at(t){const e=[];let s=nt(t);for(;s<.499999||s>2.000001;)s<.5?(e.push("atempo=0.5"),s/=.5):(e.push("atempo=2"),s/=2);return Math.abs(s-1)>1e-4&&e.push(`atempo=${s.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`),e}function rt(t,e){const s=st(t,2,8192,e);return s%2==0?s:s-1}function it(t){return t?.exportSettings??null}function ot(t){return st(it(t)?.frameRate,12,120,30)}function ut(t){return s(t.canvas,t)}function ct(t){const e=ut(t),n=function(t){const e=s(t.canvas,t),n=it(t);if(!n)return e;const a=Number.isFinite(Number(n.width))&&Number(n.width)>0,r=Number.isFinite(Number(n.height))&&Number(n.height)>0;if(!a&&!r)return e;const i=e.w>0&&e.h>0?e.w/e.h:1;if(a&&r)return{w:rt(n.width,e.w),h:rt(n.height,e.h)};if(a){const t=rt(n.width,e.w);return{w:t,h:rt(t/i,e.h)}}const o=rt(n.height,e.h);return{w:rt(o*i,e.w),h:o}}(t);return n.w===e.w&&n.h===e.h?[]:[`scale=${n.w}:${n.h}`]}function lt(t){const e=tt(t?.brightness),s=tt(t?.contrast),n=tt(t?.saturation),a=tt(t?.gamma);if(0===e&&0===s&&0===n&&0===a)return null;const r=[];if(0!==e||0!==s){const t=`clip(((val*${pt(Math.max(0,1+e))})-128)*${pt(Math.max(0,1+s))}+128,0,255)`;r.push(`lutrgb=r='${t}':g='${t}':b='${t}'`)}const i=[];return 0!==n&&i.push(`saturation=${1+n}`),0!==a&&i.push(`gamma=${(1+a*(a>0?1:.5)).toFixed(3)}`),i.length&&r.push(`eq=${i.join(":")}`),r.join(",")}function pt(t){return""+Math.round(1e3*t)/1e3}function ht(t){const e=tt(t?.temperature),s=tt(t?.tint);if(0===e&&0===s)return null;const n=tt(.18*e+.08*s),a=tt(.02*e-.12*s),r=tt(.18*-e+.08*s);return`colorbalance=rs=${pt(n)}:gs=${pt(a)}:bs=${pt(r)}`}function ft(t){const e=tt(t?.vibrance);return 0===e?null:`vibrance=intensity=${pt(e)}`}function dt(t,e,s){if(t===e)return s<t?0:1;const n=Math.max(0,Math.min(1,(s-t)/(e-t)));return n*n*(3-2*n)}function $t(t){const e={highlights:tt(t?.highlights),shadows:tt(t?.shadows),whites:tt(t?.whites),blacks:tt(t?.blacks),lightSense:tt(t?.lightSense),fade:et(t?.fade)};return Object.values(e).some(t=>Math.abs(t)>1e-4)?`curves=master='${[0,.18,.36,.5,.68,.84,1].map(t=>`${pt(t)}/${pt(function(t,e){const s=1-dt(.18,.62,t),n=1-dt(.04,.32,t),a=dt(.38,.84,t),r=dt(.7,.98,t),i=function(t){const e=dt(.08,.4,t),s=1-dt(.6,.92,t);return Math.max(0,Math.min(1,e*s*2.2))}(t),o=e.shadows*s*.28+e.highlights*a*.24+e.blacks*n*.2+e.whites*r*.2+e.lightSense*i*.18+e.fade*(.12+.06*s);return Math.max(0,Math.min(1,t+o))}(t,e))}`).join(" ")}'`:null}function mt(t){const e=[],s=et(t?.clarity),n=et(t?.sharpen);return s>1e-4&&e.push(`unsharp=lx=7:ly=7:la=${pt(1.8*s)}:cx=7:cy=7:ca=0`),n>1e-4&&e.push(`unsharp=lx=3:ly=3:la=${pt(.35+2.1*n)}:cx=3:cy=3:ca=${pt(.55*n)}`),e}function vt(t){const e=et(t?.grain);return e<=1e-4?null:`noise=alls=${Math.round(6+26*e)}:allf=t`}function St(t){const e=et(t?.vignette);return e<=1e-4?null:`vignette=angle=${pt(Math.max(.12,.42-.22*e))}*PI`}function gt(s,n={}){const a=[];if(s.flipX&&a.push("hflip"),s.flipY&&a.push("vflip"),a.push(...function(t){const s=e(t);if(0===s)return[];if(90===s)return["transpose=1"];if(180===s)return["transpose=1","transpose=1"];if(270===s)return["transpose=2"];const n=`${s}*PI/180`;return[`rotate=${n}:ow=rotw(${n}):oh=roth(${n}):c=black`]}(s.rotation)),s.crop){const{x:t,y:e,width:n,height:r}=s.crop;a.push(`crop=${n}:${r}:${t}:${e}`)}if(s.scale){const{width:t,height:e,fit:n}=s.scale;"force"===n?a.push(`scale=${t}:${e}`):"cover"===n?a.push(`scale=${t}:${e}:force_original_aspect_ratio=increase`,`crop=${t}:${e}`):a.push(`scale=${t}:${e}:force_original_aspect_ratio=decrease`,`pad=${t}:${e}:(ow-iw)/2:(oh-ih)/2`)}const r=lt(s.filters);r&&a.push(r);const i=ht(s.filters);i&&a.push(i);const o=ft(s.filters);o&&a.push(o);const u=$t(s.filters);u&&a.push(u),a.push(...mt(s.filters));const c=vt(s.filters);c&&a.push(c);const l=St(s.filters);l&&a.push(l);const p=t(s.filterPreset);return p&&a.push(p.vf),!1!==n.includeExportScale&&a.push(...ct(s)),a.push(`fps=${ot(s)}`),e(s.rotation)%90!=0&&!s.scale&&a.push("scale=trunc(iw/2)*2:trunc(ih/2)*2"),a}var bt={fade:"fade",slide:"slideleft",wipe:"wipeleft",flip:"horzopen",clockWipe:"radial",star:"pixelize",circle:"circleopen",rectangle:"rectcrop"},xt={fade:"qsin",slide:"tri",wipe:"tri",flip:"exp",clockWipe:"qsin",star:"tri",circle:"qsin",rectangle:"qsin"};function Et(t){return t.out-t.in}function Mt(t,e,s){const n=t&&"string"==typeof t.type?t.type:"none",a=bt[n]?n:"none",r=Math.max(0,Math.min(1.2,e-.05,s-.05));if("none"===a||r<=.05)return{type:"none",duration:0,effect:"fade",curve:"tri"};const i=Number(t?.duration);return{type:a,duration:Math.min(Math.max(Number.isFinite(i)?i:.4,.1),r),effect:bt[a],curve:xt[a]??"tri"}}function At(t,e){const s=function(t){const e=String(it(t)?.format??"mp4").toLowerCase();return"mov"===e||"mxf"===e?e:"mp4"}(e),n="mxf"===s?["-c:v","mpeg2video","-pix_fmt","yuv422p"]:["-c:v","libx264","-preset","veryfast","-pix_fmt","yuv420p","-movflags","+faststart"],a=function(t){const e=Number(it(t)?.videoBitrateKbps);return Number.isFinite(e)&&e>=100?Math.round(e):0}(e);if(a>0?n.push("-b:v",`${a}k`,"-maxrate",`${a}k`,"-bufsize",`${Math.max(2*a,512)}k`):"mxf"===s&&n.push("-q:v","2"),t)if("mxf"===s)n.push("-c:a","pcm_s16le");else{n.push("-c:a",function(t){return"mp3"===it(t)?.audioCodec?"libmp3lame":"aac"}(e));const t=function(t){const e=Number(it(t)?.audioBitrateKbps);return Number.isFinite(e)&&e>=32?Math.round(e):0}(e);t>0&&n.push("-b:a",`${t}k`)}return"mxf"===s&&n.push("-f","mxf"),n}var Tt="aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo",Pt="anullsrc=r=44100:cl=stereo";function yt(t){return t>.02?`,afade=t=in:st=0:d=0.01,afade=t=out:st=${Math.round(1e3*(t-.01))/1e3}:d=0.01`:""}function Rt(t,e=0){const s=Math.max(e,Math.floor(Number(t)||0));return s%2==0?s:s-1}function _t(t){const e=Number.isFinite(t?.startAt)?Math.max(0,Number(t.startAt)):0,s=Number(t?.endAt);return Number.isFinite(s)?{startAt:e,endAt:Math.max(e+.5,s)}:{startAt:e,endAt:e+3}}function wt(t,e){const s=Math.max(2,Rt(e.w,2)),n=Math.max(2,Rt(e.h,2));return s>1&&n>1?{x:0,y:0,w:s,h:n}:null}function It(e){if("filter"===e?.type){const s=t(e.filterPreset);return s?[s.vf]:[]}if("adjust"!==e?.type)return[];const s=[],n=lt(e);n&&s.push(n);const a=ht(e);a&&s.push(a);const r=ft(e);r&&s.push(r);const i=$t(e);i&&s.push(i),s.push(...mt(e));const o=vt(e);o&&s.push(o);const u=St(e);return u&&s.push(u),s}function Ft(t,e){const s=[];for(const n of t??[]){if("filter"!==n?.type&&"adjust"!==n?.type)continue;const t=wt(0,e);if(!t)continue;const a=It(n);a.length&&s.push({rect:t,filters:a,..._t(n)})}return s}function Nt(t,e=1/0){const s=[];for(const n of t??[]){if("pen"!==n?.type&&"line"!==n?.type&&"arrow"!==n?.type&&"rect"!==n?.type&&"ellipse"!==n?.type&&"text"!==n?.type&&"sticker"!==n?.type)continue;const t=Number(n.startAt),a=Number(n.endAt);if(Number.isFinite(t)&&Number.isFinite(a)&&!(a<=t)&&(s.push({startAt:Math.max(0,t),endAt:Math.max(t+.01,a)}),s.length>=e))break}return s}function Ot(t,e,s,n){let a=e;return n.forEach((e,n)=>{const r=`[vtxt${s+n}]`;t.push(`${a}[${s+n}:v]overlay=0:0:enable='between(t,${e.startAt.toFixed(3)},${e.endAt.toFixed(3)})'${r}`),a=r}),a}function Lt(t,e,s){let n=e;return s.forEach((e,s)=>{const a=`[vfxsrc${s}]`,r=`[vfxbase${s}]`,i=`[vfxcrop${s}]`,o=`[vfx${s}]`,{rect:u}=e;t.push(`${n}split=2${a}${r}`),t.push(`${a}crop=${u.w}:${u.h}:${u.x}:${u.y},${e.filters.join(",")}${i}`),t.push(`${r}${i}overlay=${u.x}:${u.y}:enable='between(t,${e.startAt.toFixed(3)},${e.endAt.toFixed(3)})'${o}`),n=o}),n}function Dt(t,e,s){const{videoPaths:n,videoHasAudio:a,audioPaths:r,overlayPath:i,textOverlayPaths:o=[]}=e,u=t.audioClips??[],c=function(t,e){if(!Array.isArray(e)||e.length<2)return!1;for(let s=0;s<e.length-1;s++){const n=Mt(t?.[s],Et(e[s]),Et(e[s+1]));if("none"!==n.type&&n.duration>0)return!0}return!1}(t.transitions,t.clips),l=Nt(t.overlays,o.length),p=o.slice(0,l.length);if(1===n.length&&0===u.length&&!c)return function(t,e,s,n,a,r=[]){const i=gt(t,{includeExportScale:!1}),o=t.clips,u=t.keepAudio&&a,c=o.length>=2,l=Ft(t.overlays,ut(t)),p=Nt(t.overlays,r.length),h=r.slice(0,p.length);if(c||n||h.length||l.length){const a=[];let r;if(c){o.forEach((t,e)=>{a.push(`[0:v]trim=start=${t.in}:end=${t.out},setpts=PTS-STARTPTS[v${e}]`),u&&a.push(`[0:a]atrim=start=${t.in}:end=${t.out},asetpts=PTS-STARTPTS${yt(t.out-t.in)}[a${e}]`)});const t=o.map((t,e)=>u?`[v${e}][a${e}]`:`[v${e}]`).join(""),e=u?"[vcat][acat]":"[vcat]";a.push(`${t}concat=n=${o.length}:v=1:a=${u?1:0}${e}`),r="[vcat]"}else r="[0:v]";i.length&&(a.push(`${r}${i.join(",")}[vflt]`),r="[vflt]"),l.length&&(r=Lt(a,r,l)),n?(a.push(`${r}[1:v]overlay=0:0[vout]`),r="[vout]"):"[0:v]"===r&&(a.push("[0:v]null[vout]"),r="[vout]"),h.length&&(r=Ot(a,r,1+(n?1:0),p));const f=ct(t);f.length&&(a.push(`${r}${f.join(",")}[vscaled]`),r="[vscaled]");const d=[];!c&&1===o.length&&d.push("-ss",String(o[0].in),"-t",String(o[0].out-o[0].in));const $=["-y",...d,"-i",e];n&&$.push("-i",n);for(const t of h)$.push("-i",t);return $.push("-filter_complex",a.join(";"),"-map",r),u&&$.push("-map",c?"[acat]":"0:a?"),$.push(...At(u,t)),$.push(s),$}const f=gt(t),d=["-y","-ss",String(o[0].in),"-t",String(o[0].out-o[0].in),"-i",e];return f.length&&d.push("-vf",f.join(",")),u||d.push("-an"),d.push(...At(u,t)),d.push(s),d}(t,n[0],s,i,a[0]??!1,p);const h=n.length,f=r.length,d=t.canvas.w,$=t.canvas.h,m=t.clips,v=t.keepAudio&&m.some(t=>a[t.srcIdx]),S=ot(t),g=m.reduce((t,e)=>t+(e.out-e.in),0),b=[];m.forEach((t,e)=>{b.push(`[${t.srcIdx}:v]trim=start=${t.in}:end=${t.out},setpts=PTS-STARTPTS,scale=${d}:${$}:force_original_aspect_ratio=increase,crop=${d}:${$},setsar=1,fps=${S},format=yuv420p[v${e}]`),v&&(a[t.srcIdx]?b.push(`[${t.srcIdx}:a]atrim=start=${t.in}:end=${t.out},asetpts=PTS-STARTPTS${yt(t.out-t.in)},${Tt}[a${e}]`):b.push(`${Pt},atrim=start=0:end=${t.out-t.in},asetpts=PTS-STARTPTS,${Tt}[a${e}]`))});let x="[vcat]",E=v?"[acat]":"",M=g;if(c){const e=function(t,e,s,n){const a=function(t,e){const s=[];let n=0;for(let a=0;a<t.length-1;a++){const r=Mt(e?.[a],Et(t[a]),Et(t[a+1]));"none"!==r.type&&r.duration>0&&(s.push({start:n,end:a,transition:r}),n=a+1)}return s.push({start:n,end:t.length-1,transition:null}),s}(e,s).map((s,a)=>{const r=function(t,e,s){let n=0;for(let a=e;a<=s;a++)n+=Et(t[a]);return n}(e,s.start,s.end);if(s.start===s.end)return{vLabel:`[v${s.start}]`,aLabel:n?`[a${s.start}]`:"",duration:r,transition:s.transition};const i=[];for(let t=s.start;t<=s.end;t++)i.push(n?`[v${t}][a${t}]`:`[v${t}]`);const o=`[sgv${a}]`,u=n?`[sga${a}]`:"";return t.push(`${i.join("")}concat=n=${s.end-s.start+1}:v=1:a=${n?1:0}${n?`${o}${u}`:o}`),{vLabel:o,aLabel:u,duration:r,transition:s.transition}});let r=a[0].vLabel,i=n?a[0].aLabel:"",o=a[0].duration;for(let e=1;e<a.length;e++){const s=a[e-1].transition,u=a[e],c=`[vx${e}]`,l=Math.max(0,o-s.duration);if(t.push(`${r}${u.vLabel}xfade=transition=${s.effect}:duration=${s.duration}:offset=${l}${c}`),r=c,n){const n=`[ax${e}]`;t.push(`${i}${u.aLabel}acrossfade=d=${s.duration}:c1=${s.curve}:c2=${s.curve}${n}`),i=n}o=o+u.duration-s.duration}return{vLabel:r,aLabel:i,duration:o}}(b,m,t.transitions??[],v);x=e.vLabel,E=v?e.aLabel:"",M=e.duration}else{const t=m.map((t,e)=>v?`[v${e}][a${e}]`:`[v${e}]`).join("");b.push(`${t}concat=n=${m.length}:v=1:a=${v?1:0}${v?"[vcat][acat]":"[vcat]"}`)}if(!v&&u.length&&(b.push(`${Pt},atrim=start=0:end=${M},asetpts=PTS-STARTPTS,${Tt}[acat]`),E="[acat]"),u.length){u.forEach((t,e)=>{const s=Math.max(0,Math.round(1e3*t.startAt)),n=Math.max(0,t.out-t.in),a=nt(t.speed),r=Math.min(Math.max(Number(t.fadeIn)||0,0),n),i=Math.min(Math.max(Number(t.fadeOut)||0,0),Math.max(0,n-r)),o=[`atrim=start=${t.in}:end=${t.out}`,"asetpts=PTS-STARTPTS",...at(a),`volume=${t.volume}`];r>1e-4&&o.push(`afade=t=in:st=0:d=${r}`),i>1e-4&&o.push(`afade=t=out:st=${Math.max(0,n-i)}:d=${i}`),o.push(Tt,`adelay=${s}|${s}`),b.push(`[${h+e}:a]${o.join(",")}[mu${e}]`)});const t=`${E}${u.map((t,e)=>`[mu${e}]`).join("")}`;b.push(`${t}amix=inputs=${1+u.length}:duration=first:dropout_transition=0:normalize=0,alimiter=limit=0.95:level=disabled:latency=1[aout]`),E="[aout]"}const A=gt(t,{includeExportScale:!1}),T=Ft(t.overlays,ut(t));A.length&&(b.push(`${x}${A.join(",")}[vflt]`),x="[vflt]"),T.length&&(x=Lt(b,x,T)),i&&(b.push(`${x}[${h+f}:v]overlay=0:0[vout]`),x="[vout]"),p.length&&(x=Ot(b,x,h+f+(i?1:0),l));const P=ct(t);P.length&&(b.push(`${x}${P.join(",")}[vscaled]`),x="[vscaled]");const y=["-y"];for(const t of n)y.push("-i",t);for(const t of r)y.push("-i",t);i&&y.push("-i",i);for(const t of p)y.push("-i",t);y.push("-filter_complex",b.join(";"),"-map",x);const R=!!E;return R&&y.push("-map",E),y.push(...At(R,t)),R&&y.push("-ar","44100","-ac","2"),y.push(s),y}function jt(t,e,s){return["-y","-ss",String(e),"-i",t,"-frames:v","1","-q:v","2",s]}export{d as AudioClip,$ as Clip,V as DEFAULT_PLATFORM_TARGETS,n as DEG2RAD,z as EDITOR_MESSAGES,a as FILTER_PRESETS,G as IMAGE_PLATFORM_PRESETS,H as IMAGE_RATIO_PRESETS,m as MIN_CLIP,v as Overlay,U as VIDEO_PLATFORM_RATIO_PRESETS,q as VIDEO_RATIO_PRESETS,Y as VIDEO_SIZE_PRESETS,S as VideoEditState,Dt as buildFfmpegArgs,r as buildFilterCss,B as buildImagePlatformPresets,jt as buildPosterArgs,K as buildVideoPlatformRatioPresets,W as buildVideoSizePresets,g as canRedo,b as canUndo,i as centeredMaxRect,x as clampAudioClip,o as clampRect,E as clipDuration,M as clipStartsAt,X as compensateAnnotationRotation,A as contentDuration,T as createHistory,P as defaultVideoEditState,y as duplicateClip,u as evenize,c as findFilterPreset,l as fitRects,R as locateOutput,p as normalizeDeg,h as outputSize,Z as parseRatio,_ as pushHistory,w as redo,I as remapSrcIndices,F as removeClip,N as reorderClips,O as replacePresent,f as rotatedSize,L as splitAtOutput,J as tEditor,Q as toHant,D as totalDuration,j as trimClipEdge,C as undo,k as usedVideoSrcIndices};
|
|
@@ -43,7 +43,7 @@ interface RatioPreset {
|
|
|
43
43
|
declare function parseRatio(r: string): number;
|
|
44
44
|
/** 图片比例预设:精确 7 项(顺序即 UI 顺序) */
|
|
45
45
|
declare const IMAGE_RATIO_PRESETS: RatioPreset[];
|
|
46
|
-
/**
|
|
46
|
+
/** 视频比例预设:精确 4 项(顺序即 UI 顺序) */
|
|
47
47
|
declare const VIDEO_RATIO_PRESETS: RatioPreset[];
|
|
48
48
|
interface VideoPlatformRatioPreset {
|
|
49
49
|
platform: string;
|