@@ -268,7 +268,7 @@ def format(self, timecode: FrameTimecode) -> str:
268268 "weights" : ScoreWeightsValue (ContentDetector .DEFAULT_COMPONENT_WEIGHTS ),
269269 },
270270 "detect-content" : {
271- "filter-mode" : "merge" ,
271+ "filter-mode" : FlashFilter . Mode . MERGE ,
272272 "kernel-size" : KernelSizeValue (- 1 ),
273273 "luma-only" : False ,
274274 "min-scene-len" : TimecodeValue (0 ),
@@ -302,7 +302,7 @@ def format(self, timecode: FrameTimecode) -> str:
302302 "no-images" : False ,
303303 },
304304 "list-scenes" : {
305- "cut-format" : "timecode" ,
305+ "cut-format" : TimecodeFormat . TIMECODE ,
306306 "display-cuts" : True ,
307307 "display-scenes" : True ,
308308 "filename" : "$VIDEO_NAME-Scenes.csv" ,
@@ -315,7 +315,7 @@ def format(self, timecode: FrameTimecode) -> str:
315315 "backend" : "opencv" ,
316316 "default-detector" : "detect-adaptive" ,
317317 "downscale" : 0 ,
318- "downscale-method" : "linear" ,
318+ "downscale-method" : Interpolation . LINEAR ,
319319 "drop-short-scenes" : False ,
320320 "frame-skip" : 0 ,
321321 "merge-last-scene" : False ,
@@ -333,7 +333,7 @@ def format(self, timecode: FrameTimecode) -> str:
333333 "output" : None ,
334334 "quality" : RangeValue (_PLACEHOLDER , min_val = 0 , max_val = 100 ),
335335 "scale" : 1.0 ,
336- "scale-method" : "linear" ,
336+ "scale-method" : Interpolation . LINEAR ,
337337 "width" : 0 ,
338338 },
339339 "split-video" : {
@@ -442,6 +442,27 @@ def _parse_config(config: ConfigParser) -> Tuple[ConfigDict, List[str]]:
442442 value_type = "number"
443443 out_map [command ][option ] = config .getfloat (command , option )
444444 continue
445+ elif isinstance (CONFIG_MAP [command ][option ], Enum ):
446+ config_value = (
447+ config .get (command , option ).replace ("\n " , " " ).strip ().upper ()
448+ )
449+ try :
450+ parsed = CONFIG_MAP [command ][option ].__class__ [config_value ]
451+ out_map [command ][option ] = parsed
452+ except TypeError :
453+ errors .append (
454+ "Invalid [%s] value for %s: %s. Must be one of: %s."
455+ % (
456+ command ,
457+ option ,
458+ config .get (command , option ),
459+ ", " .join (
460+ str (choice ) for choice in CHOICE_MAP [command ][option ]
461+ ),
462+ )
463+ )
464+ continue
465+
445466 except ValueError as _ :
446467 errors .append (
447468 "Invalid [%s] value for %s: %s is not a valid %s."
0 commit comments