1
1
from enum import Enum , StrEnum
2
- from typing import Annotated , Generic , Literal , TypeVar , Union
2
+ from typing import Annotated , Generic , Literal , List , TypeVar , Union
3
3
4
4
from pydantic import BaseModel , Field
5
5
@@ -183,7 +183,7 @@ class VideoScriptTaskResult(BaseModel):
183
183
184
184
class BgmConfig (BaseModel ):
185
185
resource_id : str = ""
186
- volume : float = 0.0
186
+ volume : float = 1
187
187
188
188
189
189
class GlobalEditorConfig (BaseModel ):
@@ -196,52 +196,53 @@ class AudioEditorConfig(BaseModel):
196
196
resource_id : str = ""
197
197
start : float = 0.0
198
198
speed : float = 1.0
199
- volume : float = 25
199
+ volume : float = 1
200
200
201
201
202
- class VoiceoverEditorConfig (BaseModel ):
202
+ class EffectBase (BaseModel ):
203
+ style : str = ""
204
+ duration : float = 0.5
205
+
206
+
207
+ class FontBase (BaseModel ):
203
208
text : str = ""
204
209
font : str = ""
205
210
font_size : int = 0
206
211
font_color : str = ""
207
212
font_weight : str = ""
208
- lang : str = ""
209
- position_x : float | None = None
210
- position_y : float | None = None
211
- style : str = "0"
212
- highlight_color : str = ""
213
+
214
+
215
+ class VoiceoverEditorConfig (FontBase ):
216
+ display : bool = True
217
+ position_x : float = 0
218
+ position_y : float = 1
213
219
stroke_color : str = ""
214
220
mask_type : str = "roll_mask"
215
221
mask_color : str = "#800080"
216
222
217
223
218
- class TextoverEditorConfig (BaseModel ):
219
- text : str = ""
220
- font : str = ""
221
- font_size : int = 0
222
- font_color : str = ""
223
- font_weight : str = ""
224
- lang : str = ""
225
- position : str = "bottom"
226
- style : str = "0"
227
- max_lines : int = 3
228
- highlight_color : str = ""
224
+ class TextoverEditorConfig (FontBase ):
225
+ rotate : float = 0.0
226
+ position_x : float = 0
227
+ position_y : float = - 1
229
228
stroke_color : str = ""
230
- mask_color : str = ""
231
- effect_in : str = ""
232
- effect_out : str = ""
233
- effect_bubble : str = ""
229
+ style : str = "no_effect"
230
+ style_value : str = ""
231
+ in_effect : EffectBase = EffectBase ()
232
+ on_effect : EffectBase = EffectBase ()
233
+ out_effect : EffectBase = EffectBase ()
234
234
235
235
236
236
class ImageEditorConfig (BaseModel ):
237
237
resource_id : str = ""
238
238
start : float = 0.0
239
239
stop : float = 0.0
240
240
scale : float = 1.0
241
- position_x : float = 1. 0
242
- position_y : float = 1.0
241
+ position_x : float = 0
242
+ position_y : float = - 1
243
243
rotate : float = 0.0
244
- animation : str = ""
244
+ in_effect : EffectBase = EffectBase ()
245
+ out_effect : EffectBase = EffectBase ()
245
246
246
247
247
248
class VideoEditorConfig (BaseModel ):
@@ -262,8 +263,8 @@ class ChapterEditorConfig(BaseModel):
262
263
key : str = ""
263
264
audio : AudioEditorConfig = AudioEditorConfig ()
264
265
voiceover : VoiceoverEditorConfig = VoiceoverEditorConfig ()
265
- textover : TextoverEditorConfig = TextoverEditorConfig ()
266
- image : ImageEditorConfig = ImageEditorConfig ()
266
+ textovers : List [ TextoverEditorConfig ] = []
267
+ images : List [ ImageEditorConfig ] = []
267
268
video : VideoEditorConfig = VideoEditorConfig ()
268
269
transition : TransitionEditorConfig = TransitionEditorConfig ()
269
270
0 commit comments