@vvfx/sdk 0.0.0-alpha.34 → 0.0.0-alpha.36

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/dist/index.d.cts CHANGED
@@ -55,6 +55,12 @@ declare const MEDIA_TYPE: {
55
55
  readonly GIF: "GIF";
56
56
  readonly AlphaMaskVideo: "AlphaMaskVideo";
57
57
  };
58
+ declare const QUALITY_TO_FFMPEG_ARGS: {
59
+ highest: string;
60
+ high: string;
61
+ medium: string;
62
+ low: string;
63
+ };
58
64
 
59
65
  declare global {
60
66
  interface Window {
@@ -114,6 +120,25 @@ type ExportMediaInitOptions = {
114
120
  */
115
121
  isOutputBuffer?: boolean;
116
122
  };
123
+ type GifConfig = {
124
+ /**
125
+ * @description GIF 导出时的帧率
126
+ */
127
+ fps?: number;
128
+ /**
129
+ * @description GIF 导出时的缩放比例
130
+ * 默认 '-1:-1', 表示不缩放
131
+ * 例如 '100:-1', 表示宽度 100,高度自动
132
+ * 例如 '-1:100', 表示宽度自动,高度 100
133
+ */
134
+ scale?: string;
135
+ /**
136
+ * @description GIF 导出时的质量
137
+ * 默认 'highest'
138
+ * 可选 'highest', 'high', 'medium', 'low'
139
+ */
140
+ quality?: keyof typeof QUALITY_TO_FFMPEG_ARGS;
141
+ };
117
142
  type ExportMediaItemOptions = {
118
143
  /**
119
144
  * 尺寸
@@ -143,6 +168,10 @@ type ExportMediaItemOptions = {
143
168
  * 视频背景颜色,默认 #000000
144
169
  */
145
170
  backgroundColor?: string;
171
+ /**
172
+ * 导出 GIF 时,设置的导出配置
173
+ */
174
+ gifConfig?: GifConfig;
146
175
  };
147
176
 
148
177
  type SDKMode = 'product' | 'template';
@@ -757,22 +786,6 @@ type ViewParam = {
757
786
  * @description 导出参数
758
787
  */
759
788
  type ExportParam = {
760
- /**
761
- * @description 导出视频时长
762
- */
763
- time?: number;
764
- /**
765
- * @description 导出大小上限 - 单位kb
766
- */
767
- fileSizeLimit: number;
768
- /**
769
- * @description 是否开启音轨
770
- */
771
- audioEnable: boolean;
772
- /**
773
- * @description 视频fps - 默认 30
774
- */
775
- fps?: number;
776
789
  /**
777
790
  * @description 导出视频类型 - 预留参数
778
791
  */
@@ -781,7 +794,7 @@ type ExportParam = {
781
794
  * @description 视频名称
782
795
  */
783
796
  name?: string;
784
- };
797
+ } & Omit<ExportMediaItemOptions, 'scene' | 'size'>;
785
798
  /**
786
799
  * @description 视图属性
787
800
  */
package/dist/index.d.ts CHANGED
@@ -55,6 +55,12 @@ declare const MEDIA_TYPE: {
55
55
  readonly GIF: "GIF";
56
56
  readonly AlphaMaskVideo: "AlphaMaskVideo";
57
57
  };
58
+ declare const QUALITY_TO_FFMPEG_ARGS: {
59
+ highest: string;
60
+ high: string;
61
+ medium: string;
62
+ low: string;
63
+ };
58
64
 
59
65
  declare global {
60
66
  interface Window {
@@ -114,6 +120,25 @@ type ExportMediaInitOptions = {
114
120
  */
115
121
  isOutputBuffer?: boolean;
116
122
  };
123
+ type GifConfig = {
124
+ /**
125
+ * @description GIF 导出时的帧率
126
+ */
127
+ fps?: number;
128
+ /**
129
+ * @description GIF 导出时的缩放比例
130
+ * 默认 '-1:-1', 表示不缩放
131
+ * 例如 '100:-1', 表示宽度 100,高度自动
132
+ * 例如 '-1:100', 表示宽度自动,高度 100
133
+ */
134
+ scale?: string;
135
+ /**
136
+ * @description GIF 导出时的质量
137
+ * 默认 'highest'
138
+ * 可选 'highest', 'high', 'medium', 'low'
139
+ */
140
+ quality?: keyof typeof QUALITY_TO_FFMPEG_ARGS;
141
+ };
117
142
  type ExportMediaItemOptions = {
118
143
  /**
119
144
  * 尺寸
@@ -143,6 +168,10 @@ type ExportMediaItemOptions = {
143
168
  * 视频背景颜色,默认 #000000
144
169
  */
145
170
  backgroundColor?: string;
171
+ /**
172
+ * 导出 GIF 时,设置的导出配置
173
+ */
174
+ gifConfig?: GifConfig;
146
175
  };
147
176
 
148
177
  type SDKMode = 'product' | 'template';
@@ -757,22 +786,6 @@ type ViewParam = {
757
786
  * @description 导出参数
758
787
  */
759
788
  type ExportParam = {
760
- /**
761
- * @description 导出视频时长
762
- */
763
- time?: number;
764
- /**
765
- * @description 导出大小上限 - 单位kb
766
- */
767
- fileSizeLimit: number;
768
- /**
769
- * @description 是否开启音轨
770
- */
771
- audioEnable: boolean;
772
- /**
773
- * @description 视频fps - 默认 30
774
- */
775
- fps?: number;
776
789
  /**
777
790
  * @description 导出视频类型 - 预留参数
778
791
  */
@@ -781,7 +794,7 @@ type ExportParam = {
781
794
  * @description 视频名称
782
795
  */
783
796
  name?: string;
784
- };
797
+ } & Omit<ExportMediaItemOptions, 'scene' | 'size'>;
785
798
  /**
786
799
  * @description 视图属性
787
800
  */